<?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>Introduction to Ansible Part 1 Archives -</title>
	<atom:link href="https://barriersec.com/category/linux-system-administration/introduction-to-ansible-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>https://barriersec.com/category/linux-system-administration/introduction-to-ansible-part-1/</link>
	<description></description>
	<lastBuildDate>Mon, 14 Sep 2020 03:16:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.15</generator>

<image>
	<url>https://barriersec.com/wp-content/uploads/cropped-Monochrome-on-Transparent-32x32.png</url>
	<title>Introduction to Ansible Part 1 Archives -</title>
	<link>https://barriersec.com/category/linux-system-administration/introduction-to-ansible-part-1/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Introduction to Ansible : Part 1</title>
		<link>https://barriersec.com/2018/05/introduction-ansible-part-1/</link>
		
		<dc:creator><![CDATA[goutham madhwaraj]]></dc:creator>
		<pubDate>Wed, 23 May 2018 22:56:35 +0000</pubDate>
				<category><![CDATA[Introduction to Ansible Part 1]]></category>
		<category><![CDATA[Linux System Administration]]></category>
		<category><![CDATA[ansible]]></category>
		<category><![CDATA[ansible2]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[infrastructure automation]]></category>
		<guid isPermaLink="false">https://barriersec.com/?p=112</guid>

					<description><![CDATA[<p>In one of my recent projects, I had this specific task , to automate Jboss Application server deployment. since it&#8230;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2018/05/introduction-ansible-part-1/">Introduction to Ansible : Part 1</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In one of my recent projects, I had this specific task , to automate Jboss Application server deployment. since it was running on a Ubuntu  machine , I thought of automating the whole process altogether . I had several Options , I chose Ansible as it satisfied all my requirements and less overhead Server administration .</p>
<p>In this article we will look at basics of Ansible and we will cover some more extensive features in later tutorials.</p>
<p>What is Ansible?</p>
<p>Ansible is an Infrastructure Automation Tool , widely used for automating day to day management of remote server tasks.</p>
<p>Why Ansible?</p>
<blockquote><p>Management of multiple  Linux remote Hosts using SSH, in parallel.</p>
<p>Also supports Windows environment using powershell</p>
<p>Easy to use and works out of the box, no overhead of installing extra tools on slave machines . (relies on SSH for controlling)</p>
<p>Uses concept of states in which comparision of current state and the desired state of the task at hand is made, if the condition satisfies , task returns the existing state without running the task .</p></blockquote>
<p>You can read more about Ansible  : https://www.ansible.com</p>
<p>Main goal of this tutorial : have a centralized server with ansible installed to control remote(slave) machines to run or accomplish a specific task.</p>
<p>Lets Now setup ansible on Server machine.</p>
<p>How To install Ansible ?</p>
<p>You can install Ansible as a python pip package.</p>
<p>&gt; <strong>pip install ansible</strong></p>
<p>Once done, create a test project folder and inside it lets create an inventory file named &#8220;hosts&#8221; . This file is mainly used to define various groups of machine we would like to remotely manage.(use your favourite text editor and save this as content)</p>
<p>content of hosts file :</p>
<p style="text-align: center;">[myMachine]</p>
<p style="text-align: center;">127.0.0.1</p>
<p style="text-align: center;">[remoteMachines]</p>
<p style="text-align: center;">192.168.1.112</p>
<p style="text-align: center;">192.168.1.113</p>
<p>As we can see , there are two groups with labels <strong>myMachine</strong> and remoteMachines to administer different set of machines. <strong>myMachine</strong> would control my local machine ,whereas the <strong>remoteMachines </strong>would control other machines in the network.</p>
<p>Note : As a prerequisite the server machine should be configured to auto SSH  to slave machines. ( to avoid specifying parameters on runtime)</p>
<p>now lets run a simple task against myMachine (that is localhost)</p>
<p style="text-align: center;"><strong>&gt; ansible -i hosts   myMachine &#8211;connection=<span class="hljs-built_in">local</span>  -m ping</strong></p>
<p>&nbsp;</p>
<p>here we can see , -i parameter specifies the inventory file name , in this case its &#8220;hosts&#8221; . myMachine specifies the group label of the machines for which task has to run. here machines under that label will run the task. &#8220;&#8211;connection=local&#8221; which specifies run the command on localhost (not to use SSH). -m arg specifies the module to be used. Here we are using Ping module.(we will see more in upcoming tutorials)</p>
<p>typical response should be,</p>
<p style="text-align: center;">127.0.0.1 | success &gt;&gt; {<br />
<span class="hljs-string">&#8220;changed&#8221;</span>: <span class="hljs-literal">false</span>,<br />
<span class="hljs-string">&#8220;ping&#8221;</span>: <span class="hljs-string">&#8220;pong&#8221;</span><br />
}</p>
<p>If you have successfully completed this , congratulations! you have run your first ansible task. In upcoming tutorials, we will look at more granular ways of running tasks using concept of roles.</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2018/05/introduction-ansible-part-1/">Introduction to Ansible : Part 1</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
