{"id":6656,"date":"2020-12-18T11:53:54","date_gmt":"2020-12-18T17:53:54","guid":{"rendered":"http:\/\/gregsowell.com\/?p=6656"},"modified":"2020-12-18T11:58:59","modified_gmt":"2020-12-18T17:58:59","slug":"installing-an-ansible-automation-platform-cluster","status":"publish","type":"post","link":"https:\/\/gregsowell.com\/?p=6656","title":{"rendered":"Installing An Ansible Automation Platform Cluster"},"content":{"rendered":"<p><a href=\"http:\/\/gregsowell.com\/wp-content\/uploads\/2020\/12\/ansible-clustering.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gregsowell.com\/wp-content\/uploads\/2020\/12\/ansible-clustering-300x169.png\" alt=\"\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-6660\" srcset=\"https:\/\/gregsowell.com\/wp-content\/uploads\/2020\/12\/ansible-clustering-300x169.png 300w, https:\/\/gregsowell.com\/wp-content\/uploads\/2020\/12\/ansible-clustering-768x432.png 768w, https:\/\/gregsowell.com\/wp-content\/uploads\/2020\/12\/ansible-clustering-1024x576.png 1024w, https:\/\/gregsowell.com\/wp-content\/uploads\/2020\/12\/ansible-clustering.png 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nClustering the AAP is a good idea for multiple reasons: it allows some HA(a node can die and you can keep operating), you are able to distribute the load across multiple control nodes, and you can connect to any of them via the standard GUI.<\/p>\n<p>A cluster setup follows the <a href=\"https:\/\/docs.ansible.com\/ansible-tower\/latest\/html\/quickinstall\/index.html\">standard install process<\/a>, but with a couple of tweaks.<\/p>\n<p>The standard install process has you download the latest AAP files, but in my case <a href=\"https:\/\/releases.ansible.com\/ansible-tower\/setup\/ansible-tower-setup-3.7.4-1.tar.gz\">I&#8217;m sticking with 3.7.4<\/a>.<\/p>\n<p>Here&#8217;s the <a href=\"https:\/\/docs.ansible.com\/ansible-tower\/latest\/html\/administration\/clustering.html\">standard cluster install documentation<\/a>, but it leaves out a couple of key points.<\/p>\n<h2>Install Process<\/h2>\n<p>I&#8217;ve spun up 4 updated Centos7 boxes for my quick lab demo.  10.1.12.81, 82, and 83 are my clustered user interface servers(Tower), and 84 is my standalone database server.<\/p>\n<p>Here&#8217;s my modified inventory file for this setup:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">[tower]\r\n# localhost ansible_connection=local\r\n10.1.12.81 ansible_user=root ansible_password=MyPassword\r\n10.1.12.82 ansible_user=root ansible_password=MyPassword\r\n10.1.12.83 ansible_user=root ansible_password=MyPassword\r\n\r\n[database]\r\n10.1.12.84 ansible_user=root ansible_password=MyPassword\r\n\r\n[all:vars]\r\nadmin_password=&#039;redhat&#039;\r\n\r\npg_host=&#039;10.1.12.84&#039;\r\npg_port=&#039;5432&#039;\r\n\r\npg_database=&#039;awx&#039;\r\npg_username=&#039;awx&#039;\r\npg_password=&#039;redhat&#039;<\/code><\/pre>\n<p>I&#8217;m actually running this via the 10.1.12.81 server, which begs the question, why did I comment out the localhost entry and instead put it in just like the other hosts?  Well, the answer is because it threw an error when I did that LOL.  So even if you are doing the install from one of the servers, add it to the list just like the others.<\/p>\n<p>Notice that I also specified a user and password for the process to SSH to the hosts with.  If I run the script now it will fail with the following message:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">TASK [awx_install : Fail play when grabbing SECRET_KEY fails] ******************************************************************************************\r\nfatal: [10.1.12.81]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;Failed to read \/etc\/tower\/SECRET_KEY from primary tower node&quot;}\r\nfatal: [10.1.12.82]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;Failed to read \/etc\/tower\/SECRET_KEY from primary tower node&quot;}\r\nfatal: [10.1.12.83]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;Failed to read \/etc\/tower\/SECRET_KEY from primary tower node&quot;}<\/code><\/pre>\n<p><strong>The quick fix for this is to type &#8220;ssh 10.1.12.81&#8221;, then accept the SSH key.  Then ssh to 82, 83, and 84.<\/strong><\/p>\n<p>Now once I run the .\/setup.sh script it completes juuuuust fine.<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">PLAY RECAP *********************************************************************************************************************************************\r\n10.1.12.81                 : ok=136  changed=77   unreachable=0    failed=0    skipped=66   rescued=0    ignored=2\r\n10.1.12.82                 : ok=124  changed=69   unreachable=0    failed=0    skipped=63   rescued=0    ignored=1\r\n10.1.12.83                 : ok=124  changed=69   unreachable=0    failed=0    skipped=63   rescued=0    ignored=1\r\n10.1.12.84                 : ok=55   changed=23   unreachable=0    failed=0    skipped=35   rescued=0    ignored=0<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>Setting up a cluster really isn&#8217;t that bad, and it can profit you a lot of resiliency and additional flexibility in your environment.  Let me know if you have any questions or comments.<\/p>\n<p>Thanks and happy clustering.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Clustering the AAP is a good idea for multiple reasons: it allows some HA(a node can die and you can keep operating), you are\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49,14,13],"tags":[],"class_list":["post-6656","post","type-post","status-publish","format-standard","hentry","category-ansible","category-linux","category-server"],"_links":{"self":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/6656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6656"}],"version-history":[{"count":4,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/6656\/revisions"}],"predecessor-version":[{"id":6661,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/6656\/revisions\/6661"}],"wp:attachment":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}