{"id":376,"date":"2017-04-24T21:48:00","date_gmt":"2017-04-24T21:48:00","guid":{"rendered":"https:\/\/questy.org\/?p=376"},"modified":"2024-09-26T19:02:29","modified_gmt":"2024-09-26T19:02:29","slug":"scaling-puppet-enterprise-part-v-gitlab","status":"publish","type":"post","link":"https:\/\/questy.org\/index.php\/2017\/04\/24\/scaling-puppet-enterprise-part-v-gitlab\/","title":{"rendered":"Scaling Puppet Enterprise &#8211; Part V &#8211; GitLab"},"content":{"rendered":"\n<p>If you&#8217;ve been following for the past 5 installments, we&#8217;re nearing the end! Note that each of the prior articles required other things to have been completed before reading\/performing the contained steps, but this article is a bit different. In all truth, you could do this process at any point, but I placed it here for one reason alone. <em>&#8220;Why do this manually when I could get Puppet to do it for me?&#8221;<\/em><\/p>\n\n\n\n<p>The importance of this particular step is that we need a place to hold our &#8220;control repo&#8221; <em>(more on this later)<\/em> and if you don&#8217;t already have Git installed in your environment, you&#8217;ll need it. So, before finishing up the installation and configuration of Code Manager, utilizing Puppet to install GitLab is a good test that everything is installed and configured properly, and all the components are communicating as expected.<\/p>\n\n\n\n<p>Without further delay, let&#8217;s continue.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Create a Machine to Serve as the GitLab Server<\/h3>\n\n\n\n<p>Provision a new node according to our earlier chart to serve as your GitLab server. While I list specifications, you may find more mileage by scaling the Git server larger. If you will be expanding your Puppet team and will have dozens to hundreds of people developing for Puppet, scaling will be a consideration. Also, while outside the scope of this article, you will want to configure offsite backup and\/or replication to a geographically separte location for your GitLab server. This is of paramount importance. If you lose this server, all configuration for all systems managed in all environments across your organization would be lost. This isn&#8217;t the end of the world in terms of business continuity, but trying to recreate all that code from the ground up would be prohibitive.<\/p>\n\n\n\n<p>Yes, people will have recent copies of the repo on their local machines. Yes, with some nonzero level of effort, you should be able to get the repos back. No, it&#8217;s not fun, and you&#8217;ll have a bad time. Just back up your server, and if possible\u2026replicate it elsewhere in your organization.<\/p>\n\n\n\n<p>My intial suggested specifications on this server are:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ssconsultinggroup.net\/wp-content\/uploads\/2020\/05\/gitlab_specs.png?w=900\" alt=\"\" class=\"wp-image-1533\"\/><\/figure>\n\n\n\n<p>I don&#8217;t specify disk for \/opt and \/var here, as each of these images carries ample disk with it. If you believe you will need additional storage for your Git instance, feel free to scale this as you see fit.<\/p>\n\n\n\n<p>Once the server is installed, go ahead and install the Puppet Agent on it, pointing to the compiler VIP like so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -k https:\/\/compile.example.com:8140\/packages\/current\/install.bash | bash<\/code><\/pre>\n\n\n\n<p>Once the agent installation is complete, in the Puppet Enterprise Console, navigate to <strong>Nodes | Unsigned Certificates<\/strong> and accept the new cert request for the GitLab server. Once that is complete, SSH to the GitLab server, and run <strong>puppet agent -t<\/strong> to complete the initial configuration of the node.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create a Profile to Manage the GitLab Installation<\/h3>\n\n\n\n<p>On the Puppet Enterprise Master, install the <strong>vshn-gitlab<\/strong> module.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>puppet module install vshn-gitlab<\/code><\/pre>\n\n\n\n<p><strong>NOTE: You will need to perform this on ALL catalog compilers in your infrastructure. If the GitLab serer checks in and doesn&#8217;t find either the vshn-gitlab module or the profile you&#8217;re creating below on the master the load balancer refers it to, the catalog run will fail.<\/strong><\/p>\n\n\n\n<p>On the Puppet Enterprise Master <em>(eg. master.example.com)<\/em> create a new profile in <strong>$codedir\/environments\/production\/modules\/profiles\/manifests\/gitlab.pp<\/strong>.<\/p>\n\n\n\n<p><em>(Puppet Enterprise has an internal variable for $codedir now. If you have made no modifications to this in the puppet.conf, the default location is \/etc\/puppetlabs\/code.)<\/em><\/p>\n\n\n\n<p>The profile you create should look like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Configure GitLab Server\nclass profiles::gitlab {\n\n  class { 'gitlab':\n    external_url =&gt; 'http:\/\/git.example.com',\n  }\n\n}<\/code><\/pre>\n\n\n\n<p>Save this as gitlab.pp.<\/p>\n\n\n\n<p>In the Puppet Enterprise Console, create a new classification group.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigate to <strong>Nodes | Classification<\/strong><\/li>\n\n\n\n<li>Create a group called &#8216;<strong>GitLab<\/strong>&#8216; with a parent of &#8216;<strong>All Nodes<\/strong>&#8216; in the Production Environment<\/li>\n\n\n\n<li>Pin the <strong>git.example.com<\/strong> node into the newly created <strong>GitLab<\/strong> group.<\/li>\n\n\n\n<li>Choose the &#8216;<strong>Classes<\/strong>&#8216; tab and click the &#8216;<strong>Refresh<\/strong>&#8216; icon to pick up your newly created profile.<\/li>\n\n\n\n<li>Add the <strong>profiles::gitlab<\/strong> class to the classification group.<\/li>\n\n\n\n<li>Commit the changes.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Caveats<\/h3>\n\n\n\n<p>Since we&#8217;re mid-setup and have multiple compilers but do <strong>not<\/strong> have code sync enabled, we have to manually copy the new profile to all your compilers in the same location. This allows the agent on the GitLab server to pick up the profile regardless of where the load balancer sends the agent request.<\/p>\n\n\n\n<p>Once the profile is in place, run <strong>puppet agent -t<\/strong> on your GitLab server, and Puppet will then install the GitLab software onto the server. At this point, after a short delay, you should be able to retrieve your GitLab server in a browser <em>(e.g. http:\/\/git.example.com)<\/em> and login with the default credentials.<\/p>\n\n\n\n<p>In our example, <strong>git.example.com<\/strong> is the server and the login would be automatically set to <strong>admin@example.com<\/strong> with a password of <strong>5iveL!fe<\/strong>. These are defaults set by the GitLab installer.<\/p>\n\n\n\n<p>Your GitLab server should now be up, running, and ready for action in your Puppet Environment. Look for the final installment to bring everything together and finish the installation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve been following for the past 5 installments, we&#8217;re nearing the end! Note that each of the prior articles required other things to have been completed before reading\/performing the contained steps, but this article is a bit different. In all truth, you could do this process at any point, but I placed it here [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[2,4],"tags":[],"class_list":["post-376","post","type-post","status-publish","format-standard","hentry","category-puppet-administration","category-puppet-education"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts\/376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/comments?post=376"}],"version-history":[{"count":1,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts\/376\/revisions"}],"predecessor-version":[{"id":377,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts\/376\/revisions\/377"}],"wp:attachment":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/media?parent=376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/categories?post=376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/tags?post=376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}