{"id":64,"date":"2014-07-09T07:17:15","date_gmt":"2014-07-09T07:17:15","guid":{"rendered":"http:\/\/tuxlabs.com\/?p=64"},"modified":"2014-08-16T21:03:59","modified_gmt":"2014-08-16T21:03:59","slug":"how-to-install-the-foreman-on-centos-6-5","status":"publish","type":"post","link":"https:\/\/tuxlabs.com\/?p=64","title":{"rendered":"How To: Install The Foreman on CentOS 6.5"},"content":{"rendered":"<h2><a href=\"http:\/\/tuxlabs.com\/wp-content\/uploads\/2014\/07\/2014-08-16-02.03.35-pm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-141\" src=\"http:\/\/tuxlabs.com\/wp-content\/uploads\/2014\/07\/2014-08-16-02.03.35-pm.png\" alt=\"2014-08-16 02.03.35 pm\" width=\"511\" height=\"205\" \/><\/a><\/h2>\n<h2>Overview<\/h2>\n<p>In this tutorial I will be demonstrating how to install The Foreman on the Linux CentOS 6.5 operating system. If you are not familiar with CentOS it is the Community version of RedHat Linux Enterprise, hence the name C(ommunity)ENT(erprise) O(perating)S(ystem). For more information on CentOS see : https:\/\/www.centos.org\/. I chose CentOS over Ubuntu or other Linux flavors for this set of tutorials because of it&#8217;s ubiquity in enterprise environments and because of RedHat&#8217;s leadership in the Openstack ecosystem. We will discuss Openstack (www.openstack.org) in later tutorials, for now The Foreman represents a great first step to setting up a world class Cloud environment.<\/p>\n<h2>Why The Foreman<\/h2>\n<p>&#8220;Foreman is an open source project that helps system administrators manage servers throughout their lifecycle, from provisioning and configuration to orchestration and monitoring. Using Puppet or Chef and Foreman&#8217;s smart proxy architecture, you can easily automate repetitive tasks, quickly deploy applications, and proactively manage change, both on-premise with VMs and bare-metal or in the cloud.&#8221; From their website (www.theforeman.org).<\/p>\n<p>In other words it builds on well known configuration management systems (puppet in our case) and fully automates &#8216;things&#8217; to provision and manage bare metal (physical) systems and Cloud Virtual Machines. This is really helpful when you have an Openstack Cloud and need to add compute nodes quickly.<\/p>\n<h2>Starting The Install<\/h2>\n<p>My 3 machines in my lab, diamond, ruby and emerald are all running CentOS 6.5. To make sure I cover all the dependencies needed I did a minimal install on these machines. So you will see me install some convenience dependencies as well, which I will point out. The following steps are based loosely on the <span style=\"text-decoration: underline;\">http:\/\/theforeman.org\/manuals\/1.5\/quickstart_guide.html<\/span><\/p>\n<p>You will want to install The Foreman on your &#8216;master&#8217; or machine you intend to the be the &#8216;controller&#8217; of your Cloud. In my case, diamond.tuxlabs.com<\/p>\n<h3>Installing Basic System Dependencies<\/h3>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">yum install -y openssh-clients\r\nyum install -y yum-utils\r\nyum install scl-utils scl-utils-build\r\nyum install -y wget\r\nyum install -y bind-utils<\/pre>\n<p>scl-utils is used for managing the rails console, the rest should be pretty self explanatory.<\/p>\n<h3>Installing Foreman Dependencies<\/h3>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">wget https:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm\r\nrpm -ivh epel-release-6-8.noarch.rpm<\/pre>\n<h3>Add Yum Repos<\/h3>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">yum-config-manager --enable rhel-6-server-optional-rpms rhel-server-rhscl-6-rpms<\/pre>\n<p><strong>Check to make sure the Repo was added using<\/strong><\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">yum repolist<\/pre>\n<h3>Installing The Foreman<\/h3>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">yum -y install http:\/\/yum.theforeman.org\/releases\/1.5\/el6\/x86_64\/foreman-release.rpm\r\nyum -y install foreman-installer<\/pre>\n<p><strong>\u00a0After grabbing the packages&#8230;finally&#8230;run the installer<\/strong><\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">foreman-installer<\/pre>\n<p>This part is pretty cool because foreman&#8217;s automated installer seems to work quite well, it takes a few minutes, but when completed you should see something like this.<\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">Preparing installation Done                                             \r\n  Success!\r\n  * Foreman is running at https:\/\/diamond.tuxlabs.com\r\n      Default credentials are 'admin:changeme'\r\n  * Foreman Proxy is running at https:\/\/diamond.tuxlabs.com:8443\r\n  * Puppetmaster is running at port 8140\r\n  The full log is at \/var\/log\/foreman-installer\/foreman-installer.log\r\n[root@diamond tuxninja]#<\/pre>\n<h3>Iptables<\/h3>\n<p>If you have iptables running, you will have to flush the rules or open the need ports.<\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">iptables --flush<\/pre>\n<h3>\u00a0Puppet<\/h3>\n<p>At this point Puppet should be installed on diamond (and your machine). You should test it by running the agents twice, yes twice \ud83d\ude42 The first time clears some warnings.<\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">puppet agent --test\r\npuppet agent --test<\/pre>\n<h3><strong>Follow the instructions for installing the NTP module in Puppet<\/strong><\/h3>\n<p>http:\/\/theforeman.org\/manuals\/1.5\/index.html#2.2PuppetManagement<\/p>\n<p>I could have re-wrote this or cropped it, but it was written very simply. Definitely do this though so you get a feel for how to add puppet modules and manage them in The Foreman.<\/p>\n<h2>The Clients<\/h2>\n<p>Now before we get into The Foreman Dashboard, let&#8217;s setup our clients so we have more interesting stuff to look at then this one node. ssh to each of your machines (ruby,emerald in my case), and sudo or become root and run&#8230;<\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">rpm  -ivh http:\/\/yum.puppetlabs.com\/el\/6.4\/products\/x86_64\/puppetlabs-release-6-7.noarch.rpm\r\nyum install -y puppet<\/pre>\n<p><strong>\u00a0Then start puppet<\/strong><\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">\/etc\/init.d\/puppet start<\/pre>\n<h3>\u00a0Sign The Certs<\/h3>\n<p>Puppet uses SSL certificates to authenticate clients that it manages. By default you must permit each client by manually signing the certificate before the client is authenticated with the puppet master. Back on the master server (diamond) run the following modified for the correct FQDN&#8217;s (full hostnames).<\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true \">puppet cert --sign ruby.tuxlabs.com\r\npuppet cert --sign emerald.tuxlabs.com<\/pre>\n<h3>Auto Starting<\/h3>\n<p>Make sure Puppet starts on boot, do this on all machines<\/p>\n<pre class=\"top-set:false bottom-set:false nums:false nums-toggle:false lang:default decode:true\">chkconfig puppet on<\/pre>\n<h2>The Dashboard<\/h2>\n<p>Finally :-), If you have set everything up correctly you should be able to reach your console @ https:\/\/yourserversip.com or if you have DNS at the https:\/\/yourserversname.com (aka the FQDN Fully Qualified Domain Name).\u00a0 Note the console uses SSL so you want to use HTTPS (on port 443 by default) not HTTP (which is port 80 by default), so just remember the HTTPS part and you should see a login screen, like this.<\/p>\n<p><a href=\"http:\/\/tuxlabs.com\/wp-content\/uploads\/2014\/07\/TheForemanOverview.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-70\" src=\"http:\/\/tuxlabs.com\/wp-content\/uploads\/2014\/07\/TheForemanOverview.png\" alt=\"TheForemanOverview\" width=\"774\" height=\"347\" \/><\/a><\/p>\n<p>The first time Login is : admin and the Password is : changeme &#8230; make sure you do like the password says ! Also feel free to change you display name in your profile.<\/p>\n<h2>The End<\/h2>\n<p>Now that you have The Foreman installed. The next logical step is to install Openstack. I will cover that next time folks, I hope this helps out !<\/p>\n","protected":false},"excerpt":{"rendered":"<a href=\"https:\/\/tuxlabs.com\/?p=64\" rel=\"bookmark\" title=\"Permalink to How To: Install The Foreman on CentOS 6.5\"><p>Overview In this tutorial I will be demonstrating how to install The Foreman on the Linux CentOS 6.5 operating system. If you are not familiar with CentOS it is the Community version of RedHat Linux Enterprise, hence the name C(ommunity)ENT(erprise) O(perating)S(ystem). For more information on CentOS see : https:\/\/www.centos.org\/. I chose CentOS over Ubuntu or [&hellip;]<\/p>\n<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,5,12],"tags":[],"class_list":{"0":"post-64","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-howtos","7":"category-puppet","8":"category-systems-administration","9":"h-entry","10":"hentry"},"_links":{"self":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":11,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions\/142"}],"wp:attachment":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}