<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ansible Tower &#8211; Made For Cloud</title>
	<atom:link href="https://madeforcloud.com/category/ansible-tower/feed/" rel="self" type="application/rss+xml" />
	<link>https://madeforcloud.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sun, 12 Jul 2026 02:02:20 +0000</lastBuildDate>
	<language>en-AU</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>
	<item>
		<title>The Two Patterns of Ansible Automation</title>
		<link>https://madeforcloud.com/2026/07/12/the-two-patterns-of-ansible-automation/</link>
					<comments>https://madeforcloud.com/2026/07/12/the-two-patterns-of-ansible-automation/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sun, 12 Jul 2026 02:01:14 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Ansible Tower]]></category>
		<category><![CDATA[AWX]]></category>
		<category><![CDATA[ansible]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=313</guid>

					<description><![CDATA[Pipeline Execution vs Controller Execution Most teams don’t realize they’re choosing an automation architecture every time they run a playbook. They think they’re choosing a tool. They’re actually choosing a pattern. In my opinion, there are only two patterns that matter: Both work. Both fail. Both solve different problems. This article breaks down the patterns,&#8230;<p><a class="more-link" href="https://madeforcloud.com/2026/07/12/the-two-patterns-of-ansible-automation/" title="Continue reading &#8216;The Two Patterns of Ansible Automation&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">Pipeline Execution vs Controller Execution</h3>



<p class="wp-block-paragraph">Most teams don’t realize they’re choosing an automation architecture every time they run a playbook. They think they’re choosing a tool. They’re actually choosing a <strong>pattern</strong>.</p>



<p class="wp-block-paragraph">In my opinion, there are only two patterns that matter:</p>



<ol start="1" class="wp-block-list">
<li><strong>Pipeline‑Driven Execution</strong></li>



<li><strong>Controller‑Driven Execution (AWX/AAP)</strong></li>
</ol>



<p class="wp-block-paragraph">Both work. Both fail. Both solve different problems.</p>



<p class="wp-block-paragraph">This article breaks down the patterns, the guidance for using them, the anti‑patterns that cause outages, and when combining them actually makes sense.</p>



<h1 class="wp-block-heading">Pattern 1: Pipeline‑Driven Execution</h1>



<h3 class="wp-block-heading">“Automation lives in Git. Execution happens in CI.”</h3>



<p class="wp-block-paragraph">This is the alleged cloud‑native. I hate the term &#8216;cloud-native&#8217;, it&#8217;s just a modern pattern and can equally apply to on-premises, but I&#8217;ll use it as it&#8217;s become an industry norm.</p>



<p class="wp-block-paragraph">The pipeline:</p>



<ul class="wp-block-list">
<li>checks out the repo</li>



<li>runs <mark style="background-color:#eee" class="has-inline-color">ansible-playbook</mark> directly</li>



<li>injects secrets at runtime</li>



<li>uses inventories stored in Git</li>



<li>uses vars stored in Git</li>



<li>uses execution environments defined in Git</li>



<li>tests automation before deploying</li>



<li>runs deterministically and reproducibly</li>
</ul>



<p class="wp-block-paragraph">This pattern treats Ansible like any other automation tool: <strong>code &#8212;> test &#8212;> deploy &#8212;> verify</strong>.</p>



<h3 class="wp-block-heading">When to use it</h3>



<p class="wp-block-paragraph">Pipeline execution is the right answer when you need:</p>



<ul class="wp-block-list">
<li>reproducibility</li>



<li>portability</li>



<li>deterministic execution</li>



<li>Git as the single source of truth</li>



<li>cloud‑neutral automation</li>



<li>ephemeral runners</li>



<li>multi‑cloud or hybrid cloud</li>



<li>developer‑friendly workflows</li>



<li>automation that can run anywhere</li>
</ul>



<p class="wp-block-paragraph">This is the pattern used by &#8216;cloud‑native&#8217; teams, platform teams, and anyone who values <strong>Git truth over controller truth</strong>.</p>



<h3 class="wp-block-heading">Strengths</h3>



<ul class="wp-block-list">
<li>Fully reproducible</li>



<li>Fully portable</li>



<li>Fully version‑controlled</li>



<li>No hidden state</li>



<li>No GUI configuration</li>



<li>No controller dependency</li>



<li>Works in any CI/CD system</li>



<li>Works locally</li>



<li>Works in DR</li>



<li>Works in multi‑cloud</li>
</ul>



<h3 class="wp-block-heading">Weaknesses</h3>



<ul class="wp-block-list">
<li>Pipelines must understand environment boundaries</li>



<li>Pipelines must manage secrets securely</li>



<li>Pipelines must enforce guardrails</li>



<li>Pipelines can become too flexible</li>



<li>Pipelines can accidentally bypass governance</li>
</ul>



<p class="wp-block-paragraph">This is why enterprises often avoid this pattern, not because it’s wrong, but because they fear losing control. The fear is real.</p>



<h1 class="wp-block-heading">Pattern 2: Controller‑Driven Execution (AWX/AAP)</h1>



<h3 class="wp-block-heading">“Automation runs inside a governed platform.”</h3>



<p class="wp-block-paragraph">This is the typical enterprise pattern.</p>



<p class="wp-block-paragraph">AWX/AAP:</p>



<ul class="wp-block-list">
<li>pulls playbooks from Git</li>



<li>stores inventories</li>



<li>stores credentials</li>



<li>enforces RBAC</li>



<li>provides audit trails</li>



<li>standardizes execution environments</li>



<li>triggers automation from events</li>



<li>provides multi‑team visibility</li>
</ul>



<p class="wp-block-paragraph">This pattern treats Ansible as a <strong>governed automation platform</strong>, not a CLI tool.</p>



<h3 class="wp-block-heading">When to use it</h3>



<p class="wp-block-paragraph">Controller execution is the right answer when you need:</p>



<ul class="wp-block-list">
<li>RBAC</li>



<li>credential isolation</li>



<li>auditability</li>



<li>inventory synchronization</li>



<li>standardized execution environments</li>



<li>event‑driven automation</li>



<li>multi‑team governance</li>



<li>compliance and regulatory controls</li>
</ul>



<p class="wp-block-paragraph">This is the pattern used by large enterprises, regulated industries, and teams with strict governance requirements.</p>



<h3 class="wp-block-heading">Strengths</h3>



<ul class="wp-block-list">
<li>Centralized governance</li>



<li>Centralized credentials</li>



<li>Centralized inventory</li>



<li>Centralized audit</li>



<li>Standardized execution environments</li>



<li>Event‑driven automation</li>



<li>Multi‑team visibility</li>



<li>Strong guardrails</li>
</ul>



<h3 class="wp-block-heading">Weaknesses</h3>



<ul class="wp-block-list">
<li>Hidden state</li>



<li>GUI configuration</li>



<li>Non‑portable automation</li>



<li>Not fully reproducible</li>



<li>Not fully version‑controlled</li>



<li>Controller dependency</li>



<li>Harder to test automation before deployment</li>



<li>Harder to run automation outside AWX</li>
</ul>



<p class="wp-block-paragraph">This is why &#8216;cloud‑native&#8217; teams avoid this pattern, not because it’s wrong, but because it’s not portable.</p>



<h1 class="wp-block-heading">Anti‑Patterns</h1>



<p class="wp-block-paragraph">These are the patterns that break automation, cause outages, and create drift.</p>



<h2 class="wp-block-heading">Anti‑Pattern 1: AWX as the “automation store”</h2>



<p class="wp-block-paragraph">Pipelines call AWX job templates as if AWX stores automation.</p>



<p class="wp-block-paragraph">It doesn’t.</p>



<p class="wp-block-paragraph">AWX stores <strong>configuration</strong>, not automation.</p>



<p class="wp-block-paragraph">Automation lives in Git. AWX overrides Git with controller‑side state.</p>



<p class="wp-block-paragraph">This creates split‑brain automation, if you think git is the source of truth, surprise, it isn&#8217;t.</p>



<h2 class="wp-block-heading">Anti‑Pattern 2: Pipelines storing credentials</h2>



<p class="wp-block-paragraph">This is a governance failure.</p>



<p class="wp-block-paragraph">Pipelines should inject secrets at runtime, not store them.</p>



<p class="wp-block-paragraph">AWX should manage credentials. Actually, just about anything else should manage credentials.</p>



<h2 class="wp-block-heading">Anti‑Pattern 3: AWX storing inventories that drift from Git</h2>



<p class="wp-block-paragraph">Inventories should be version‑controlled.</p>



<p class="wp-block-paragraph">If AWX is the inventory source of truth, Git is no longer authoritative.</p>



<p class="wp-block-paragraph">This breaks reproducibility.</p>



<h2 class="wp-block-heading">Anti‑Pattern 4: Pipelines bypassing RBAC</h2>



<p class="wp-block-paragraph">If pipelines can run any playbook against any host using any credential, you’ve lost governance.</p>



<p class="wp-block-paragraph">This is dangerous in enterprise environments.</p>



<h2 class="wp-block-heading">Anti‑Pattern 5: AWX storing controller‑side vars that override Git</h2>



<p class="wp-block-paragraph">This creates non‑deterministic execution.</p>



<p class="wp-block-paragraph">Playbooks behave differently depending on controller configuration.</p>



<p class="wp-block-paragraph">This breaks portability.</p>



<h1 class="wp-block-heading">Does the Combination Make Sense?</h1>



<p class="wp-block-paragraph">Here’s the part most teams miss:</p>



<p class="wp-block-paragraph"><strong>The two patterns are not mutually exclusive.</strong> <strong>They are complementary.</strong></p>



<h1 class="wp-block-heading">The Practical Guidance</h1>



<h2 class="wp-block-heading">Use pipeline execution when:</h2>



<ul class="wp-block-list">
<li>automation must be reproducible</li>



<li><strong>automation must be portable</strong></li>



<li>automation must be version‑controlled</li>



<li><strong>automation must run anywhere</strong></li>



<li><strong>automation must be tested before deployment</strong></li>
</ul>



<h2 class="wp-block-heading">Use controller execution when:</h2>



<ul class="wp-block-list">
<li>governance matters</li>



<li>RBAC matters</li>



<li>credential isolation matters</li>



<li>auditability matters</li>



<li>inventory sync matters</li>



<li>event‑driven automation matters</li>
</ul>



<h2 class="wp-block-heading">Use both when:</h2>



<ul class="wp-block-list">
<li>you need reproducibility <strong>and</strong> governance</li>



<li>you need portability <strong>and</strong> control</li>



<li>you need Git truth <strong>and</strong> environment truth</li>



<li>you need cloud‑native execution <strong>and</strong> enterprise guardrails</li>
</ul>



<p class="wp-block-paragraph">This is the two‑layer architecture.</p>



<h1 class="wp-block-heading">Final Takeaway</h1>



<p class="wp-block-paragraph">There are two patterns.</p>



<p class="wp-block-paragraph">Trying to make one do both is how teams create drift, outages, and brittle automation.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2026/07/12/the-two-patterns-of-ansible-automation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ansible Tower provider for Cloudforms / ManageIQ</title>
		<link>https://madeforcloud.com/2020/01/14/ansible-tower-provider-for-cloudforms-manageiq/</link>
					<comments>https://madeforcloud.com/2020/01/14/ansible-tower-provider-for-cloudforms-manageiq/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Tue, 14 Jan 2020 00:54:14 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Ansible Tower]]></category>
		<category><![CDATA[Cloudforms]]></category>
		<category><![CDATA[ManageIQ]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=99</guid>

					<description><![CDATA[Always fun to strike problems in what should be the simplest things. I wanted to add Ansible Tower as a service into ManageIQ. Cloudforms would have a similar result. Following the very simple instructions at https://www.manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/index I proceeded to add the new provider. It&#8217;s all pretty straight forward. Putting in the URL to my Tower&#8230;<p><a class="more-link" href="https://madeforcloud.com/2020/01/14/ansible-tower-provider-for-cloudforms-manageiq/" title="Continue reading &#8216;Ansible Tower provider for Cloudforms / ManageIQ&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Always fun to strike problems in what should be the simplest things.   I wanted to add Ansible Tower as a service into ManageIQ.  Cloudforms would have a similar result.</p>



<p class="wp-block-paragraph">Following the very simple instructions at <a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://www.manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/index" target="_blank">https://www.manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/index</a> I proceeded to add the new provider.</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://madeforcloud.com/wp-content/uploads/2020/01/index-1024x481.png" alt="" class="wp-image-100"/></figure>



<p class="wp-block-paragraph">It&#8217;s all pretty straight forward.  Putting in the URL to my Tower server I get greeted with a bunch of errors.</p>



<pre class="wp-block-preformatted"><strong>Credential validation was not successful:  {:headers=>{"server"=>"nginx", "date"=>"Mon, 13 Jan 2020  23:42:12 GMT", "content-type"=>"text/html; charset=utf-8",  "content-length"=>"3873", "connection"=>"close",  "vary"=>"Cookie, Accept-Language, Origin",  "content-language"=>"en", "x-api-total-time"=>"0.046s"</strong>
.
.
.
blah blah
.
.
<strong>status=>404</strong></pre>



<p class="wp-block-paragraph">By default ManageIQ and Cloudforms search for /api/v1 on the Tower server.  /api/v1 was deprecated and removed as of Ansible Tower 3.6, see <a href="https://docs.ansible.com/ansible-tower/latest/html/towerapi/conventions.html" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">https://docs.ansible.com/ansible-tower/latest/html/towerapi/conventions.html</a></p>



<p class="wp-block-paragraph">So, what is a person to do?   Hit the google.  Eventually I came across this bugzilla item <a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://bugzilla.redhat.com/show_bug.cgi?id=1740860" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1740860</a> and it gave a hint as to just specifying the /api/v2 in the URL I gave to ManageIQ rather than just the base hostname.  eg.  https://blah&#8230;./api/v2</p>



<p class="wp-block-paragraph">Tried it,  it worked!  My credential validated and a provider refresh was automatically initiated and all my Ansible Tower templates and inventories were discovered correctly.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2020/01/14/ansible-tower-provider-for-cloudforms-manageiq/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure Credentials for Ansible</title>
		<link>https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/</link>
					<comments>https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/#comments</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sun, 24 Nov 2019 03:42:16 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Ansible Tower]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=72</guid>

					<description><![CDATA[So, you need Ansible to connect to Azure. Congrats, Ansible is awesome for managing Azure resources. The Ansible team has already put together a scenario on how to integrate Ansible with Azure over at https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html The section &#8216;Authenticating with Azure&#8216; sounds like the right place, but you can&#8217;t use your AD username / password from&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/" title="Continue reading &#8216;Azure Credentials for Ansible&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">So, you need Ansible to connect to Azure.   Congrats,  Ansible is awesome for managing Azure resources.   The Ansible team has already put together a scenario on how to integrate Ansible with Azure over at <a href="https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html">https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html</a>   </p>



<p class="wp-block-paragraph">The section &#8216;<strong>Authenticating with Azure</strong>&#8216; sounds like the right place, but you can&#8217;t use your AD username / password from Ansible because you turned on 2FA &#8211;  You turned it on RIGHT?  So the option left to you is to create a Service Principal (SP).</p>



<p class="wp-block-paragraph"><strong>Note:  having 2FA on your account is what you should be doing, so don&#8217;t turn it off.</strong></p>



<p class="wp-block-paragraph">It&#8217;s quite simple to create a credential for Ansible to use when connecting to Azure.  Simply, fire up the Cloud Shell  (awesome feature BTW Microsoft) and create a Service Principal (SP).</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://madeforcloud.com/wp-content/uploads/2019/11/AzureCloudShell-1024x133.png" alt="" class="wp-image-73"/></figure>



<p class="wp-block-paragraph">But <span style="text-decoration: underline;">Hang On</span>,  what is a Service Principal?  The Ansible guide refers you to the Azure documentation over at <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal">https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal</a>  which you will read, and if you&#8217;re like me,  you&#8217;ll wonder what you actually just read.   Have no fear.  As I mentioned above you can use a simple Azure CLI command (via the Cloud Shell you just started) and create the Service Principal.     Think of the Service Principal as a credential an application (in this case Ansible) can use to access the Azure service(s).  </p>



<pre class="wp-block-code"><code>geoff@Azure:~$ az ad sp create-for-rbac --name svc-ansible-azure  # (optional if not specified one will be generated)  --password 'ALovelyComplexPasswor@'
Changing "svc-ansible-azure" to a valid URI of "http://svc-ansible-azure", which is the required format used for service principal names
Creating a role assignment under the scope of "/subscriptions/88888888-4444-4444-4444-cccccccccccc"
  Retrying role assignment creation: 1/36
  Retrying role assignment creation: 2/36
{
  "appId": "appid888-4444-4444-4444-cccccccccccc",
  "displayName": "svc-ansible-azure",
  "name": "http://svc-ansible-azure",
  "password": "password-4444-4444-4444-cccccccccccc",
  "tenant": "tenant88-4444-4444-4444-cccccccccccc"
}
geoff@Azure:~$</code></pre>



<p class="wp-block-paragraph">If you want to see what that command just did in the Azure portal, head over to the Azure Active Directory -> App registrations blade.</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://madeforcloud.com/wp-content/uploads/2019/11/aad.png" alt="" class="wp-image-74"/></figure>



<p class="wp-block-paragraph">and then you can see the Service Principal you just created.</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://madeforcloud.com/wp-content/uploads/2019/11/appregistrations.png" alt="" class="wp-image-75"/></figure>



<p class="wp-block-paragraph">So what do you do with the new credential.</p>



<p class="wp-block-paragraph">The Ansible Azure scenario guide has a section on what to do, however, it&#8217;s a bit too vague for me.</p>



<h4 class="wp-block-heading">Using Environment Variables</h4>



<p class="wp-block-paragraph">To pass service principal credentials via the environment, define the following variables:</p>



<ul class="wp-block-list"><li>AZURE_CLIENT_ID</li><li>AZURE_SECRET</li><li>AZURE_SUBSCRIPTION_ID</li><li>AZURE_TENANT</li></ul>



<p class="wp-block-paragraph">Azure has given me :</p>



<p class="wp-block-paragraph">&#8220;appId&#8221;: &#8220;appid888-4444-4444-4444-cccccccccccc&#8221;,<br>&#8220;displayName&#8221;: &#8220;svc-ansible-azure&#8221;,<br>&#8220;name&#8221;: &#8220;http://svc-ansible-azure&#8221;,<br>&#8220;password&#8221;: &#8220;password-4444-4444-4444-cccccccccccc&#8221;,<br>&#8220;tenant&#8221;: &#8220;tenant88-4444-4444-4444-cccccccccccc&#8221;</p>



<p class="wp-block-paragraph">For your sanity,  <br>AZURE_CLIENT_ID ==&gt; appId<br>AZURE_SECRET ==&gt; password<br>AZURE_TENANT ==&gt; tenant</p>



<p class="wp-block-paragraph">The remaining item, AZURE_SUBSCRIPTION_ID  is exactly that,  you can also get from the Cloud Shell as follows</p>



<pre class="wp-block-code"><code>geoff@Azure:~$ az account list
[
  {
    "cloudName": "AzureCloud",
    "id": "subscrip-4444-4444-4444-cccccccccccc
    "isDefault": true,
.
.
.</code></pre>



<p class="wp-block-paragraph">In this case AZURE_SUBSCRIPTION_ID ==> id ,   whichever id in your account that is valid for your use case.</p>



<p class="wp-block-paragraph">If you want to add these credentials into Ansible Tower, simply create a Credential of type <strong>Microsoft Azure Resource Manager </strong>and use the values you&#8217;ve deduced above.   Ansible Tower will automatically translate them into Environment Variables for your Tower template execution.</p>



<p class="wp-block-paragraph">Enjoy Ansible and Azure!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Adding a custom credential type in Ansible Tower for ServiceNOW</title>
		<link>https://madeforcloud.com/2019/11/08/adding-a-custom-credential-type-in-ansible-tower-for-servicenow/</link>
					<comments>https://madeforcloud.com/2019/11/08/adding-a-custom-credential-type-in-ansible-tower-for-servicenow/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Fri, 08 Nov 2019 04:07:31 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Ansible Tower]]></category>
		<category><![CDATA[ServiceNOW]]></category>
		<guid isPermaLink="false">http://madeforcloud.com/?p=53</guid>

					<description><![CDATA[It&#8217;s been one of those weeks and I needed to get some more experience with the ansible ServiceNOW modules, specifically within Ansible Tower. It looked pretty simple and in fact it really was quite simple. Ansible Tower neatly stores credentials within it &#8211; or externally if that fills you with joy. There isn&#8217;t a ServiceNow&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/11/08/adding-a-custom-credential-type-in-ansible-tower-for-servicenow/" title="Continue reading &#8216;Adding a custom credential type in Ansible Tower for ServiceNOW&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">It&#8217;s been one of those weeks and I needed to get some more experience with the ansible ServiceNOW  modules, specifically within Ansible Tower.   It looked pretty simple and in fact it really was quite simple.</p>



<p class="wp-block-paragraph">Ansible Tower neatly stores credentials within it &#8211; or externally if that fills you with joy.  There isn&#8217;t a ServiceNow credential type in Ansible Tower.   Undeterred, I thought I would use machine credentials, but tower has an annoying behavior of only allowing 1 instance of each credential type attached to a tower template and I am already using machine credentials in my template.   </p>



<p class="wp-block-paragraph">Fortunately on the left hand side of the tower ui there&#8217;s an entry labelled  <strong>credential types</strong> </p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="http://madeforcloud.com/wp-content/uploads/2019/11/credtype.png" alt="" class="wp-image-54"/></figure></div>



<p class="wp-block-paragraph">When creating the credential type you need to supply two (2) pieces of information.  The first piece is called the <strong>Input configuration</strong> &#8211; or what the fields look like on the web ui when you create a credential of this type and secondly, the <strong>Injector configuration</strong> which details what do do with thew credentials.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="http://madeforcloud.com/wp-content/uploads/2019/11/credconfig.png" alt="" class="wp-image-55"/></figure></div>



<p class="wp-block-paragraph">In my case,  the new credential type is called SNOW and i&#8217;m providing the instance name, username and password as part of the structure for this credential &#8211; via the Input configuration and then I detail that I want to store this data in environment variables that will be accessible from my playbook when run in tower.</p>



<h4 class="wp-block-heading">Input configuration</h4>



<pre class="wp-block-code"><code>fields:
  - id: instance
    type: string
    label: Instance
  - id: username
    type: string
    label: Username
  - id: password
    type: string
    label: Password
    secret: true
required:
  - instance
  - username
  - password
</code></pre>



<h4 class="wp-block-heading">Injector configuration</h4>



<pre class="wp-block-code"><code>env:
  SN_INSTANCE: '{{instance}}'
  SN_PASSWORD: '{{password}}'
  SN_USERNAME: '{{username}}'</code></pre>



<p class="wp-block-paragraph">The way you use them in your playbook is quite simple.  The following is a snippet of playbook showing that.</p>



<pre class="wp-block-code"><code>
   - name: Create an incident
     snow_record:
       username: '{{ lookup("env", "SN_USERNAME") }}'
       password: '{{ lookup("env", "SN_PASSWORD") }}'
       instance: '{{ lookup("env", "SN_INSTANCE") }}'
       state: present
       data:
         short_description: "This is a test incident opened by Ansible"
         severity: 3
         priority: 2
     register: new_incident</code></pre>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2019/11/08/adding-a-custom-credential-type-in-ansible-tower-for-servicenow/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ansible Tower &#8211; Local_Action + Sudo ?</title>
		<link>https://madeforcloud.com/2019/10/27/ansible-tower-local_action-sudo/</link>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sun, 27 Oct 2019 01:04:20 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Ansible Tower]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">http://madeforcloud.com/?p=15</guid>

					<description><![CDATA[There are many times when you run an Ansible playbook through Ansible Tower and you have to become a privileged user on the target system. This is business as usual for Ansible and Ansible Tower. This is normally achieved by specifying become as part of your playbook, such as this snippet. Typically, as part of&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/10/27/ansible-tower-local_action-sudo/" title="Continue reading &#8216;Ansible Tower &#8211; Local_Action + Sudo ?&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">There are many times when you run an Ansible playbook through Ansible Tower and you have to <em>become</em> a privileged user on the target system.  This is <em>business as usual</em> for Ansible and Ansible Tower.     </p>



<p class="wp-block-paragraph">This is normally achieved by specifying <em>become</em> as part of your playbook, such as this snippet.</p>



<pre class="wp-block-code"><code>---
- name: Patch Linux
  hosts: all
  gather_facts: true
  become: true</code></pre>



<p class="wp-block-paragraph">Typically, as part of a patching playbook, you would reboot the system and wait for the reboot to finish using a code fragment like this :</p>



<pre class="wp-block-code"><code> - name: Wait for server to restart
   local_action:
     module: wait_for
       host={{ ansible_ssh_host }}
       port=22
       delay=60
       timeout=300
</code></pre>



<p class="wp-block-paragraph">This local_action inherits the <em>become: true</em> from the parent definition and this is where Tower starts to complain.   Remember, with Ansible Tower, it&#8217;s the tower server itself where the local_action will  run.   You can expect to see something like this :</p>



<pre class="wp-block-code"><code>"module_stderr": "sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?\n",</code></pre>



<p class="wp-block-paragraph">No,  you <strong>SHOULD NOT</strong> enable the awx user to use sudo on the Tower system as  the AWX service user is intentionally restricted from sudo operations.  The best approach is to de-privilege the local_action.   Fortunately, local_action has it&#8217;s own <em>become</em> capability so you can turn off the request for privileged access as you don&#8217;t need it.</p>



<p class="wp-block-paragraph">The above code block is now :</p>



<pre class="wp-block-code"><code> - name: Wait for server to restart
   become: false
   local_action:
     module: wait_for
       host={{ ansible_ssh_host }}
       port=22
       delay=60
       timeout=300</code></pre>



<p class="wp-block-paragraph">and the tower job template will execute without any errors.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
