{"id":1880,"date":"2021-01-28T18:15:00","date_gmt":"2021-01-28T17:15:00","guid":{"rendered":"https:\/\/robermb.com\/blog\/?p=1880"},"modified":"2021-03-11T16:54:43","modified_gmt":"2021-03-11T15:54:43","slug":"how-to-install-foreman-and-katello-satellite-free-version-on-centos-7","status":"publish","type":"post","link":"https:\/\/robermb.com\/blog\/geeks\/how-to-install-foreman-and-katello-satellite-free-version-on-centos-7\/","title":{"rendered":"How to install Foreman &#038; Katello (Satellite free version) on CentOS 7"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p>With <strong>Katello <\/strong>&amp; <strong>Foreman<\/strong>,<strong> <\/strong>you can install and configure the <strong>open source<\/strong> version of <strong>Red Hat <a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Satellite_(software)\" target=\"_blank\"><span class=\"has-inline-color has-black-color\">Satellite<\/span><\/a><\/strong>, to manage an infrastructure, OS patching and configuration, etc.<\/p>\n\n\n\n<p>Some practical information :<\/p>\n\n\n\n<ul><li><strong><span class=\"has-inline-color has-black-color\"><a rel=\"noreferrer noopener\" href=\"https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_satellite\/6.0\/html\/user_guide\/chap-red_hat_satellite-user_guide-introduction_to_red_hat_satellite\" target=\"_blank\">Red Hat Satellite<\/a><\/span> :<\/strong> is a system management solution that enables you to deploy, configure, and maintain your systems across physical, virtual, and cloud environments. Satellite provides provisioning, remote management and monitoring of multiple Red&nbsp;Hat Enterprise Linux deployments with a single, centralized tool.<\/li><\/ul>\n\n\n\n<ul><li><strong><span class=\"has-inline-color has-black-color\"><a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Foreman_(software)\" target=\"_blank\">The Foreman<\/a><\/span> :<\/strong> For provision and Life Cycle Management of physical and virtual systems.<\/li><\/ul>\n\n\n\n<ul><li><strong><a href=\"https:\/\/theforeman.org\/plugins\/katello\/\" target=\"_blank\" rel=\"noreferrer noopener\">Katello <\/a>:<\/strong> Foreman Plug-in for Subscription and Repository Management. (RHEL patching)<\/li><\/ul>\n\n\n\n<p><em><span class=\"has-inline-color has-luminous-vivid-amber-color\"><span style=\"text-decoration: underline;\"><strong>Note<\/strong><\/span> : <\/span><span style=\"color:#ffdd80\" class=\"has-inline-color\"><strong>Foreman <\/strong>and <strong>Katello <\/strong>are actually two of the <strong>components <\/strong>that make up <strong>Red Hat Satellite<\/strong>.<\/span><\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>P<\/strong>rerequisites<\/h3>\n\n\n\n<p>For this lab, for <strong>testing purposes<\/strong>, we will use a <strong>virtual machine<\/strong> like the following :<\/p>\n\n\n\n<p><strong>OS <\/strong>: RHEL 7, CentOS 7 (64bits)<br><strong>CPU <\/strong>: 2 minimum<br><strong>RAM <\/strong>: 8 GB minimum<br><strong>DISK <\/strong>: 140GB = 40GB(OS) + 100GB(\/var\/lib\/pulp)<\/p>\n\n\n\n<p><em><span class=\"has-inline-color has-luminous-vivid-amber-color\"><strong><span style=\"text-decoration: underline;\">Note<\/span> <\/strong>: <\/span><span style=\"color:#ffdd80\" class=\"has-inline-color\"><strong>\/var\/lib\/pulp<\/strong> : Location to store the content to sync. The recommended <strong>minimum size<\/strong> should be <strong>30GB<\/strong> for each Operating System we are about to Sync.<\/span><\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of the Lab<\/h3>\n\n\n\n<p>Once we have the Linux <strong>CentOS 7 virtual machine ready<\/strong>, we go through the <strong>preparation <\/strong>to install Foreman, <strong>making <\/strong>some small <strong>configurations<\/strong>.<\/p>\n\n\n\n<p>Set the <strong>hostname <\/strong>and add an entry in \/etc\/hosts :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># hostnamectl set-hostname \"foremanlab.mylab.com\"\n\n# echo \"10.79.94.99 foremanlab.mylab.com foremanlab\" &gt;&gt; \/etc\/hosts\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># hostnamectl status\n   Static hostname: foremanlab.mylab.com\n         Icon name: computer-vm\n           Chassis: vm\n        Machine ID: 7ad2153585ca450d80296226f31fe064\n           Boot ID: b6fa901bb2eb4e28b36fb48198024bfc\n    Virtualization: vmware\n  Operating System: CentOS Linux 7 (Core)\n       CPE OS Name: cpe:\/o:centos:centos:7\n            Kernel: Linux 3.10.0-1127.19.1.el7.x86_64\n      Architecture: x86-64<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># dnsdomainname -f\nforemanlab.mylab.com<\/code><\/pre>\n\n\n\n<p><strong>Update <\/strong>the machine and <strong>reboot <\/strong>it :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># yum update -y ; reboot<\/code><\/pre>\n\n\n\n<p>The <strong>time synchronization<\/strong> for Foreman and Katello is really important. For that, we will <strong>install chrony<\/strong>, <strong>enable <\/strong>and <strong>start <\/strong>the service :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># yum install chrony\n# systemctl enable chronyd\n# systemctl start chronyd\n# chronyc sources\n<\/code><\/pre>\n\n\n\n<p>Then, we must <strong>enable NTP synchronization <\/strong>:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># timedatectl set-ntp true\n# timedatectl status\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Firewall Requirement<\/strong><\/h3>\n\n\n\n<p>The <strong>ports <\/strong>we must <strong>open <\/strong>in the <strong>Firewall <\/strong>on Foreman machine are :<\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">TCP<\/span><\/strong> : 53, 80, 443, 5647, 9090<br><strong><span style=\"text-decoration: underline;\">UDP<\/span><\/strong> : 67-69, 53<\/p>\n\n\n\n<p>We just have to <strong>execute <\/strong>the following <strong>commands <\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># firewall-cmd --add-port={53,80,443,5647,9090}\/tcp --permanent\n# firewall-cmd --add-port={67-69,53}\/udp --permanent\n# firewall-cmd --reload\n# firewall-cmd --list-all\n<\/code><\/pre>\n\n\n\n<p><em><span class=\"has-inline-color has-luminous-vivid-amber-color\"><span style=\"text-decoration: underline;\">Note<\/span> :<\/span> <span style=\"color:#ffdd80\" class=\"has-inline-color\">If we plan to setup a DNS server in the same machine, it\u2019s necessary to open port 53 UDP and TCP.<\/span><\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Storage Requirement<\/strong><\/h3>\n\n\n\n<p>We need to have ready the filesystem <strong>\/var\/lib\/pulp<\/strong> with <strong>100 GB<\/strong> of space.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># df -h \/var\/lib\/pulp\nFilesystem                       Size  Used Avail Use% Mounted on\n\/dev\/mapper\/centos-var_lib_pulp  100G   33M  100G   1% \/var\/lib\/pulp<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Add Repositories<\/strong><\/h3>\n\n\n\n<p>Check the <strong>current repositories <\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># yum repolist\nLoaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: centos.crazyfrogs.org\n * extras: ftp.pasteur.fr\n * updates: centos.crazyfrogs.org\nrepo id                                  \t        repo name                                    status\nbase\/7\/x86_64                              CentOS-7 - Base                              10,070\nextras\/7\/x86_64                            CentOS-7 - Extras                               413\nupdates\/7\/x86_64                         CentOS-7 - Updates                            1,134\nrepolist: 11,617\n<\/code><\/pre>\n\n\n\n<p><strong>Add <\/strong>the required <strong>Repositories <\/strong>for the installation using yum :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># yum -y localinstall https:\/\/yum.theforeman.org\/releases\/2.3\/el7\/x86_64\/foreman-release.rpm\r\n\r\nhttps:&#47;&#47;yum.theforeman.org\/releases\/2.3\/el7\/x86_64\/release-2.3.3-1.el7.noarch.rpm\r\n\r\n# yum -y localinstall https:\/\/fedorapeople.org\/groups\/katello\/releases\/yum\/3.18\/katello\/el7\/x86_64\/katello-repos-latest.rpm\r\n\r\n# yum -y localinstall https:\/\/yum.puppet.com\/puppet6-release-el-7.noarch.rpm\r\n\r\n# yum -y localinstall https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm\r\n\r\n# yum -y install epel-release centos-release-scl-rh\r<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Install Foreman<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># yum -y install foreman-installer\n# yum -y update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Install Katello<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># yum -y install katello\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Setup Katello<\/strong><\/h3>\n\n\n\n<p>Start to <strong>setup <\/strong>Katello by running foreman-installer. <\/p>\n\n\n\n<p>While running<strong> foreman-installer <\/strong>we can use multiple options to <strong>set <\/strong>the <strong>admin User\/Password<\/strong>. <\/p>\n\n\n\n<p><em><span class=\"has-inline-color has-luminous-vivid-amber-color\"><strong><span style=\"text-decoration: underline;\">Note<\/span> <\/strong>: <\/span><span style=\"color:#ffdd80\" class=\"has-inline-color\">If the option &#8220;<strong>&#8211;scenario katello<\/strong>&#8221; is not used, it will set up with the puppet.<\/span><\/em><\/p>\n\n\n\n<p>To <strong>set up<\/strong> with <strong>more modules <\/strong>it possible to add them by editing below <strong>YAML file<\/strong>. This should be done before starting with running foreman-installer :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vim \/etc\/foreman-installer\/scenarios.d\/katello.yaml\n<\/code><\/pre>\n\n\n\n<p>In my setup, I have appended with <strong>postgresql<\/strong>, <strong>pulp<\/strong>, <strong>candlepin<\/strong>, <strong>qpid<\/strong>, <strong>tftp<\/strong>, <strong>dhcp <\/strong>and <strong>dns<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:order:\n- certs\n- foreman\n- katello\n- foreman_proxy\n- foreman_proxy::plugin::pulp\n- foreman_proxy_content\n- puppet\n<strong>- postgresql\n- pulp\n- candlepin\n- qpid\n- tftp\n- dhcp\n- dns<\/strong><\/code><\/pre>\n\n\n\n<p><strong>Enable true for required plugins<\/strong> by editing the below answer file. <\/p>\n\n\n\n<p>For instance, to <strong>enable <\/strong>the <strong>ansible plugin<\/strong>, replace \u201cfalse\u201d with \u201ctrue\u201d &#8211;&gt; <strong>foreman::plugin::ansible: true<\/strong> :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vim \/etc\/foreman-installer\/scenarios.d\/katello-answers.yaml\nforeman_proxy::plugin::pulp: true\n<strong>foreman::plugin::ansible: true\n<\/strong>foreman::plugin::azure: false\nforeman::plugin::bootdisk: false\nforeman::plugin::chef: false\nforeman::plugin::default_hostgroup: false\nforeman::plugin::digitalocean: false\nforeman::plugin::discovery: false\nforeman::plugin::expire_hosts: false\nforeman::plugin::hooks: false\nforeman::plugin::inventory_upload: false\nforeman::plugin::kubevirt: false\nforeman::plugin::memcache: false\nforeman::plugin::monitoring: false\nforeman::plugin::openscap: false\nforeman::plugin::puppetdb: false\nforeman::plugin::remote_execution: false\nforeman::plugin::remote_execution::cockpit: false\nforeman::plugin::salt: false\nforeman::plugin::setup: false\nforeman::plugin::snapshot_management: false\nforeman::plugin::tasks: true\nforeman::plugin::templates: false\nforeman::plugin::virt_who_configure: false\nforeman_proxy::plugin::ansible: false\nforeman_proxy::plugin::chef: false\nforeman_proxy::plugin::dhcp::infoblox: false\nforeman_proxy::plugin::dhcp::remote_isc: false\nforeman_proxy::plugin::discovery: false\nforeman_proxy::plugin::dns::infoblox: false\nforeman_proxy::plugin::monitoring: false\nforeman_proxy::plugin::openscap: false\nforeman_proxy::plugin::remote_execution::ssh: false\nforeman_proxy::plugin::salt: false\n<strong>foreman::compute::ec2: true\n<\/strong>foreman::compute::gce: false\nforeman::compute::libvirt: false\nforeman::compute::openstack: false\nforeman::compute::ovirt: false\nforeman::compute::rackspace: false\n<strong>foreman::compute::vmware: true\n<\/strong>foreman::cli: true\n<strong>foreman::cli::ansible: true\n<\/strong>foreman::cli::azure: false\nforeman::cli::discovery: false\nforeman::cli::kubevirt: false\nforeman::cli::openscap: false\nforeman::cli::remote_execution: false\nforeman::cli::tasks: false\nforeman::cli::templates: false\nforeman::cli::virt_who_configure: false\n<\/code><\/pre>\n\n\n\n<p>Install python-gofer : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># yum -y install python-gofer-qpid<\/code><\/pre>\n\n\n\n<p>Execute <strong>foreman-installer <\/strong>with the following options to <strong>set up<\/strong> <strong>Katello <\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># foreman-installer \\\n--scenario katello \\\n--foreman-initial-admin-username admin \\\n--foreman-initial-admin-password 'password'\n<\/code><\/pre>\n\n\n\n<p>Meanwhile, to <strong>monitor <\/strong>the <strong>installation progress <\/strong>check the <strong>log <\/strong>file with tail command :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># tail -f \/var\/log\/foreman-installer\/katello.log\n<\/code><\/pre>\n\n\n\n<p><em><span class=\"has-inline-color has-luminous-vivid-amber-color\"><strong><span style=\"text-decoration: underline;\">Note<\/span><\/strong> : <\/span><span style=\"color:#ffdd80\" class=\"has-inline-color\">It took around <strong>25 minutes<\/strong> to <strong>complete <\/strong>the Katello <strong>installation<\/strong>.<\/span><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Preparing installation <span class=\"has-inline-color has-vivid-green-cyan-color\">Done\n<\/span>\n<span class=\"has-inline-color has-vivid-green-cyan-color\">  Success!\n<\/span>  * <span class=\"has-inline-color has-vivid-cyan-blue-color\">Katello <\/span>is running at <span class=\"has-inline-color has-vivid-cyan-blue-color\">https:\/\/foremanlab.mylab.com<\/span>\n      Initial credentials are <span class=\"has-inline-color has-vivid-cyan-blue-color\">admin <\/span><span class=\"has-inline-color has-black-color\">\/ <\/span><span class=\"has-inline-color has-vivid-cyan-blue-color\">password<\/span>\n  * To install an additional Foreman proxy on separate machine continue by running:\n      foreman-proxy-certs-generate --foreman-proxy-fqdn \"$FOREMAN_PROXY\" --certs-tar \"\/root\/$FOREMAN_PROXY-certs.tar\"\n  \n  The full log is at <span class=\"has-inline-color has-vivid-cyan-blue-color\">\/var\/log\/foreman-installer\/katello.log<\/span><\/code><\/pre>\n\n\n\n<p>Once completed with the installation <strong>verify <\/strong>the <strong>service status <\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># katello-service status | grep -i \"Active\"\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Accessing Foreman GUI<\/strong><\/h3>\n\n\n\n<p><strong>Access <\/strong>the foreman GUI using the <strong>FQDN url<\/strong> have you configured : <\/p>\n\n\n\n<p><span class=\"has-inline-color has-vivid-cyan-blue-color\">https:\/\/foremanlab.mylab.com<\/span> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"369\" src=\"https:\/\/robermb.com\/blog\/wp-content\/uploads\/foreman_login-e1611844661376.png\" alt=\"\" class=\"wp-image-1898\"\/><\/figure>\n\n\n\n<p>Once completed with the installation verify the service status :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl status foreman.service\r\n# systemctl status foreman-proxy.service\r<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure DHCP and DNS on Foreman-proxy : <\/h3>\n\n\n\n<p>Get <strong>oauth_consumer <\/strong>key and secret values :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># cat \/etc\/foreman\/settings.yaml | grep oauth_\r<\/code><\/pre>\n\n\n\n<p>Configure the DHCP and DNS on foreman-proxy : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># foreman-installer --enable-foreman-proxy \\\r\n--foreman-proxy-tftp true \\\r\n--foreman-proxy-tftp-servername=10.79.204.102 \\\r\n--foreman-proxy-dhcp true \\\r\n--foreman-proxy-dhcp-interface \"ens224\" \\\r\n--foreman-proxy-dhcp-gateway \"10.79.204.1\" \\\r\n--foreman-proxy-dhcp-nameservers \"10.79.204.102\" \\\r\n--foreman-proxy-dhcp-range \"10.79.204.160 10.79.204.170\" \\\r\n--foreman-proxy-dhcp-server \"10.79.204.102\" \\\r\n--foreman-proxy-dns true \\\r\n--foreman-proxy-dns-forwarders \"8.8.8.8; 4.4.4.4\" \\\r\n--foreman-proxy-dns-interface \"ens224\" \\\r\n--foreman-proxy-dns-reverse \"204.79.10.in-addr.arpa\" \\\r\n--foreman-proxy-dns-server \"10.79.204.102\" \\\r\n--foreman-proxy-dns-zone \"data.bluesoft-group.com\" \\\r\n--foreman-oauth-consumer-key \"PvQYpbBVB6RsMyAL7X6eBs686UPEYGqR\" \\\r\n--foreman-oauth-consumer-secret \"KGQaMurCGn4C5H4jK98qc8B256ca7YVL\"\r<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Introduction With Katello &amp; Foreman, you can install and configure the open source version of Red Hat Satellite, to manage &hellip; <a href=\"https:\/\/robermb.com\/blog\/geeks\/how-to-install-foreman-and-katello-satellite-free-version-on-centos-7\/\" class=\"more-link\">More <span class=\"screen-reader-text\">How to install Foreman &#038; Katello (Satellite free version) on CentOS 7<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1890,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[103,2,8],"tags":[123,124,125,35,48,122],"_links":{"self":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/1880"}],"collection":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/comments?post=1880"}],"version-history":[{"count":38,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/1880\/revisions"}],"predecessor-version":[{"id":1952,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/posts\/1880\/revisions\/1952"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/media\/1890"}],"wp:attachment":[{"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/media?parent=1880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/categories?post=1880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robermb.com\/blog\/wp-json\/wp\/v2\/tags?post=1880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}