<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[CloudForms Now]]></provider_name><provider_url><![CDATA[http://cloudformsblog.redhat.com]]></provider_url><author_name><![CDATA[Victor Estival Lopez]]></author_name><author_url><![CDATA[https://cloudformsblog.redhat.com/author/vestival271017/]]></author_url><title><![CDATA[Infrastructure Tour Italy Part&nbsp;3]]></title><type><![CDATA[link]]></type><html><![CDATA[<p><strong>Introduction</strong></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">Red Hat held an event on the infrastructure part of our portfolio in Milan and Rome on April 17th and 19th, 2018. Part of the demos presented was focused on the Automation topic managed with Red Hat Ansible and Red Hat Ansible Tower:</span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">The event information and agenda is available at:</span></p>
<p><a href="https://www.redhat.com/en/events/infrastructure-tour-milan-2018"><span style="font-weight:400;">https://www.redhat.com/en/events/infrastructure-tour-milan-2018</span></a></p>
<p><a href="https://www.redhat.com/en/events/infrastructure-tour-rome-2018"><span style="font-weight:400;">https://www.redhat.com/en/events/infrastructure-tour-rome-2018</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">This is the third part of the series of articles written by my colleague Rinaldo Bergamini you can find them </span><a href="https://cloudformsblog.redhat.com/2018/07/09/infrastructure-tour-italy-part-1/"><span style="font-weight:400;">here</span></a><span style="font-weight:400;"> and </span><a href="https://cloudformsblog.redhat.com/2018/07/16/infrastructure-tour-italy-part-2"><span style="font-weight:400;">here</span></a><span style="font-weight:400;">.</span></p>
<p><span style="font-weight:400;">In this part, I would like to show you how you can Automate “everything” with Red Hat Ansible and Ansible Tower.</span></p>
<p><!--more--></p>
<p><span style="font-weight:400;">At that time Ansible Tower demo was configured literally in a manual way. That means I had to:</span></p>
<ol>
<li style="font-weight:400;"><span style="font-weight:400;">Choose a cloud provider  </span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Define IAM users</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Define Networks and Storage details</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Create Instances for Tower and servers for my use cases</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Install and Configure Tower</span></li>
</ol>
<p>&nbsp;</p>
<p><span style="font-weight:400;">We showed to the audience several use cases  :</span></p>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">Application deployment [PROVISIONING] </span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Application configuration [CONFIGURATION MANAGEMENT]</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Infrastructure Day 2 Operations [ORCHESTRATION] </span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Proactive &amp; Automatic Analysis w/ Insights [SECURITY]</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Security Content/Vulnerability Assessment &amp; Remediation [SECURITY]</span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-weight:400;">After the event as you can imagine, I used the same demo to show to our customers how Ansible can help them due to three of it’s main core values:  it’s </span><b>SIMPLE, </b><span style="font-weight:400;"> it’s </span><b>POWERFUL,</b><span style="font-weight:400;"> it’s</span><b> AGENT LESS</b></p>
<p><span style="font-weight:400;">After few days in my mind comes a new idea:</span><b> my demo needs to be fully automated!</b></p>
<p><span style="font-weight:400;">In the</span> <a href="https://developers.redhat.com/blog/2017/11/02/build-software-defined-data-center-red-hat-cloudforms-openstack-2/"><b>past</b></a> <span style="font-weight:400;">I have done something similar in an OpenStack/Cloudforms environment using Heat. </span></p>
<p><span style="font-weight:400;">I did the same but using a public cloud provider and the power of Ansible</span></p>
<p><span style="font-weight:400;">What do I mean? I want to start building AUTOMATICALLY the whole environment from scratch in order to: </span></p>
<p>&nbsp;</p>
<ol>
<li style="font-weight:400;"><span style="font-weight:400;">Show an end-to-end deployment of multiple servers/services</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Quickly reproduce the demo if needed</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Track changes → ansible playbook are YAML based files so we can track changes on git</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Rebuild old demo environment using the latest version  (demo was based on Tower 3.2.3 version. Now we are at 3.2.6) </span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Avoid to re-invent the wheel every time we need a demo environment</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Use this effort as a baseline for new use cases</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Write this follow-up post for who have joined us during the event 😉</span></li>
</ol>
<p>&nbsp;</p>
<p><span style="font-weight:400;">I think we can call this approach as </span><b>Automation </b><b>3 </b><b>or Cubed Automation </b><b>  </b></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">We want to “Automate” the setup of the “Automation”</span> <span style="font-weight:400;">environment “Automating” several tasks </span></p>
<p><span style="font-weight:400;">Let’s start understanding what the main folder contains and how the playbook was designed&#8230; </span></p>
<p><i><span style="font-weight:400;">Folder structure</span></i></p>
<p><img data-attachment-id="2536" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-08-04/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-08-04.png" data-orig-size="672,962" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.08.04" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-08-04.png?w=210" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-08-04.png?w=672" class="alignnone size-large wp-image-2536" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-08-04.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-08-04.png 672w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-08-04.png?w=105 105w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-08-04.png?w=210 210w" sizes="(max-width: 672px) 100vw, 672px" /></p>
<p><span style="font-weight:400;">In the main dir there are: </span></p>
<p>&nbsp;</p>
<ol>
<li style="font-weight:400;"><b>setup.ini</b><span style="font-weight:400;"> file [1] where basically we need to configure some basic stuff in order to configure the environment. </span>There are 3 sections:   <i style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;">[tower], [rhsm], [gce], and w</i>e have to write down on the<i style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;"> [tower]</i><span style="font-weight:400;"> section,  the version we want to install, the tower’s admin password (tower_password variable), etc.<br />
</span><br />
We need also to declare our Red Hat Customer Portal user in order to register our instances to the Red Hat Portal under the<i style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;"> [rhsm]</i><span style="font-weight:400;"> section. The password</span> is not a clear text password, instead, the playbook will use vault. You can refer to <a style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;" href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_vault.html">this document</a><span style="font-weight:400;"><span style="font-weight:400;"> in order to correctly encrypt your password encoding it inside the playbook yaml file.</span></span>As prerequisites on GCE side, we have to:</li>
</ol>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">create two service accounts: </span>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">the first one called </span><i><span style="font-weight:400;">service_account_instance_creation@xxxxx</span></i><span style="font-weight:400;"> which will be used to create instances on GCE. You need also to download it in JSON format and use it as credentials (parameter </span><i><i><span style="font-weight:400;">service_account_instance_creation_credentials)</span></i></i><img data-attachment-id="2538" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-10-27/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-10-27.png" data-orig-size="596,784" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.10.27" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-10-27.png?w=228" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-10-27.png?w=596" class="alignnone size-full wp-image-2538" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-10-27.png" alt="" /></li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type:none;">
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">the second one called tower-service-account which needs to be download as .p12  </span>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">you need to extract the private key from .p12 file with the command:  </span><i><span style="font-weight:400;">cat xxxxxxx.p12 | openssl pkcs12 -nodes -nocerts -passin pass:notasecret | openssl rsa &gt; privateKey.pem.<br />
</span></i>This keyfile will be used in the future (playbook enhancement) by Tower to authenticate Tower to GCP and use the dynamic inventory feature  (not available right now)</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><span style="font-weight:400;">[1] setup.ini file </span></p>
<p><img data-attachment-id="2539" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-13-20/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png" data-orig-size="1268,546" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.13.20" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png?w=1024" class="alignnone size-large wp-image-2539" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-13-20.png 1268w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p>&nbsp;</p>
<ol>
<li></li>
<li><b>Inventory File</b><span style="font-weight:400;"> where you need to put the hosts being part of the inventory you’ll manage with Ansible. Those hosts will be created  by our playbook</span></li>
<li><b style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;">Gce_createinstances </b><span style="font-weight:400;"> main playbook file that will execute some tasks and role.</span></li>
<li><b>License</b><span style="font-weight:400;"> is the tower license file that will be loaded to Tower using a POST to it’s APIs</span></li>
<li><b>README</b><span style="font-weight:400;"> basic prerequisites and guidelines</span></li>
<li><b>Roles</b><span style="font-weight:400;"> folders used by the main playbook to organize playbooks and tasks by their own scope</span></li>
</ol>
<p>&nbsp;</p>
<p><span style="font-weight:400;">I don’t want to explain all the playbooks/roles/tasks in details. </span></p>
<p><span style="font-weight:400;">DISCLAIMER: At the time of writing the git repo is private. As soon as possible I’ll release it as Open Source of course and then feel free to contribute with pull request!</span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">Now let’s watch this short video where you can see how we can set up the whole environment (tower included) in </span><b>less than 30 minutes </b></p>
<p>&nbsp;</p>
<p><span class="embed-youtube" style="text-align:center; display: block;"><iframe class='youtube-player' type='text/html' width='640' height='360' src='https://www.youtube.com/embed/PFnAO5HPVTQ?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' allowfullscreen='true' style='border:0;'></iframe></span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">At the end of the entire playbook run the whole environment is up and running in 28 minutes! [2]</span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">[2] ansible output</span></p>
<p><img data-attachment-id="2540" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-35-20/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png" data-orig-size="1308,528" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.35.20" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png?w=1024" class="alignnone size-large wp-image-2540" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-35-20.png 1308w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">Now let’s log in to Ansible Tower to quickly highlights the configuration performed</span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">The role</span><i><span style="font-weight:400;"> Tower</span></i><span style="font-weight:400;"> has configured our Tower environment executing the setup, loading the license file and creating admin user using a mix of APIs call and ansible tower modules.</span></p>
<p><span style="font-weight:400;">Then the role</span><i><span style="font-weight:400;"> tower_uc_setup</span></i><span style="font-weight:400;"> has created for us the skeleton for our automation building 4 projects, 4 inventory, 7 hosts, some groups and a lot of pre-configured job_templates and workflow identified by an id and a prefix inside the template name</span></p>
<p>&nbsp;</p>
<p><i><span style="font-weight:400;">Tower homepage</span></i></p>
<p><img data-attachment-id="2541" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-37-00/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png" data-orig-size="1470,428" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.37.00" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png?w=1024" class="alignnone size-large wp-image-2541" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-00.png 1470w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><i><span style="font-weight:400;">Configured hosts</span></i></p>
<p><img data-attachment-id="2542" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-37-35/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png" data-orig-size="1450,478" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.37.35" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png?w=1024" class="alignnone size-large wp-image-2542" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-37-35.png 1450w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">First of all, we want to use a preconfigured job template called </span><i><span style="font-weight:400;">“UC-1 [Provisioning] &#8211; WebServers + Haproxy + Nagios “</span></i><span style="font-weight:400;">  in order to install our web servers (httpd1/httpd2), a load balancer (haproxy) and a monitoring system (nagios)</span></p>
<p>&nbsp;</p>
<p><i><span style="font-weight:400;">“UC-1 [Provisioning] &#8211; WebServers + Haproxy + Nagios “</span></i> <span style="font-weight:400;">Job Template</span></p>
<p><img data-attachment-id="2543" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-38-07/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png" data-orig-size="1288,520" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.38.07" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png?w=1024" class="alignnone size-large wp-image-2543" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-07.png 1288w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">Executing it  will configure everything in 11 minutes</span></p>
<p><img data-attachment-id="2544" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-38-26/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png" data-orig-size="1268,600" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.38.26" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png?w=1024" class="alignnone size-large wp-image-2544" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-38-26.png 1268w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><i><span style="font-weight:400;">Index.html showed calling httpd1 server</span></i></p>
<p><img data-attachment-id="2545" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-39-27/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png" data-orig-size="1280,600" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.39.27" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png?w=1024" class="alignnone size-large wp-image-2545" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-39-27.png 1280w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><i><span style="font-weight:400;">Nagios configured with hostgroups and services</span></i></p>
<p><img data-attachment-id="2546" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-40-31/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png" data-orig-size="1296,446" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.40.31" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png?w=1024" class="alignnone size-large wp-image-2546" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-31.png 1296w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">In addition, the Haproxy server will balance the two web servers in a round robin fashion.</span></p>
<p><span style="font-weight:400;">Of course during the demo setup (runtime)  we could also execute the template using the available module </span><a href="https://docs.ansible.com/ansible/2.6/modules/tower_job_launch_module.html#tower-job-launch-module"><span style="font-weight:400;">tower_job_launch</span></a><span style="font-weight:400;"> but in this case I would like to show how quickly this template can avoid spending your time on repetitive and boring tasks executing it manually from the Tower UI</span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">I have also configured other templates able to:</span></p>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">Exclude a web server from a load balancer</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Execute a custom command on a server</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Re-include web server from Load Balancer</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Unmonitor the web server from Nagios</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Re-monitor the web server from Nagios</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Rolling updates for all the project servers</span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-weight:400;">All the playbooks used in this demo as job templates are available here </span></p>
<p>&nbsp;</p>
<p><a href="https://github.com/MikeNald/ansible-tower-examples"><b>https://github.com/MikeNald/ansible-tower-examples</b></a></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">After the first run of the gce_createinstances playbook they will be available inside Tower</span></p>
<p><img data-attachment-id="2547" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-40-53/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png" data-orig-size="1272,570" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.40.53" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png?w=1024" class="alignnone size-large wp-image-2547" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-40-53.png 1272w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">The setup will also configure an entire workflow able to </span></p>
<p>&nbsp;</p>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">Exclude web server from LB → in case of success → temporary disable monitoring → in case of success → run command on server → always →</span></li>
</ul>
<p><span style="font-weight:400;">re-include it into monitoring → always re-include web server on LB</span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">The workflow includes also a survey asking the end user for a target host and command to be executed </span></p>
<p><img data-attachment-id="2548" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-42-24/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png" data-orig-size="1284,740" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.42.24" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png?w=1024" class="alignnone size-large wp-image-2548" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-42-24.png 1284w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><img data-attachment-id="2549" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-43-23/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png" data-orig-size="1302,404" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.43.23" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png?w=1024" class="alignnone size-large wp-image-2549" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-23.png 1302w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">This is just an example of what Tower can do … here the full list of available use cases addressed by this Demo with several kinds of playbooks, workflows, survey, etc</span></p>
<p><img data-attachment-id="2550" data-permalink="https://cloudformsblog.redhat.com/2018/09/10/infrastructure-tour-italy-part-3/screen-shot-2018-09-10-at-18-43-51/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png" data-orig-size="1184,304" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-09-10 at 18.43.51" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png?w=1024" class="alignnone size-large wp-image-2550" src="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/09/screen-shot-2018-09-10-at-18-43-51.png 1184w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">For instance, I have configured an Openscap scan of a rhel system, create a remediation profile for it, build a report and fix the findings using job_template number 16, 17 and 18</span></p>
<p><span style="font-weight:400;">Then I have configured a workflow to execute those playbooks in a consistent way.</span></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">The result is a rhel server where the Standard System Security Profile (ssg-rhel7-ds.xml) was used as a baseline and applied to the system.</span></p>
<p><span style="font-weight:400;">The report is loaded on git repo automatically by the playbook “UC-8 [Security] &#8211; Openscap Security Scan “ and can be viewed </span><a href="https://htmlpreview.github.io/?https://raw.githubusercontent.com/MikeNald/ansible-tower-examples/master/security/report/rhel-scap-scan-xccdf-report.html"><span style="font-weight:400;">here</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">Another example is the fully automated </span><a href="https://docs.ansible.com/ansible-tower/latest/html/userguide/insights.html"><span style="font-weight:400;">Insight Integration</span></a><span style="font-weight:400;"> in order to proactively resolve possible wrong configurations or security issues on systems executing pre-configured ansible playbooks made available from Insights.</span></p>
<p>&nbsp;</p>
<p><b>Resources:</b></p>
<p>&nbsp;</p>
<p><a href="https://github.com/MikeNald/ansible-tower-examples"><b>https://github.com/MikeNald/ansible-tower-examples</b></a></p>
<p><a href="https://docs.ansible.com/ansible-tower/"><b>https://docs.ansible.com/ansible-tower/</b></a></p>
<p><a href="https://docs.ansible.com/ansible/latest/modules/list_of_all_modules.html"><b>https://docs.ansible.com/ansible/latest/modules/list_of_all_modules.html</b></a></p>
<p><a href="https://docs.ansible.com/ansible-tower/latest/html/userguide/insights.html"><b>https://docs.ansible.com/ansible-tower/latest/html/userguide/insights.html</b></a></p>
<p>&nbsp;</p>
<p><b>Conclusion:</b></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">This post would like to show you how much Ansible is powerful, simple and integrated with a broad ecosystem.</span></p>
<p><span style="font-weight:400;">More than 1.600 modules are available, an entire galaxy (</span><a href="https://galaxy.ansible.com/"><span style="font-weight:400;">https://galaxy.ansible.com/</span></a><span style="font-weight:400;">) of re-usable roles is ready without needs to install plugins or agent on remote systems resulting in a quick adoption of the solution and avoiding an overhead to your systems without increasing surface attack!</span></p>
<p><span style="font-weight:400;">What are you waiting for?  Now you can perform your own </span><b>AUTOMATION </b></p>
]]></html><thumbnail_url><![CDATA[https://cloudformsredhat.files.wordpress.com/2018/09/arch-of-constantine-3044634_640.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[440]]></thumbnail_width><thumbnail_height><![CDATA[293]]></thumbnail_height></oembed>