<?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>Playbook Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/playbook/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/playbook/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:07:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>How to use template in Ansible?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-use-template-in-ansible/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-use-template-in-ansible/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Thu, 06 Sep 2018 07:08:49 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[jinja2]]></category>
		<category><![CDATA[Playbook]]></category>
		<category><![CDATA[template]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5296</guid>

					<description><![CDATA[<p>How to use template in Ansible? ##### Step 1 &#8211; Create your inventory file with ##### ##### Step 2 &#8211; [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-template-in-ansible/">How to use template in Ansible?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>How to use template in Ansible?</strong></p>
<p><strong>##### Step 1 &#8211; Create your inventory file with #####</strong></p>
<pre class="brush: plain; title: ; notranslate">$ vi inventory
35.154.85.120 ansible_user=root ansible_ssh_private_key_file=remote.pem
35.154.85.120 ansible_user=root ansible_ssh_private_key_file=remote.pem</pre>
<p><strong>##### Step 2 &#8211; Create templates directory #####</strong></p>
<pre class="brush: plain; title: ; notranslate">$ mkdir templates
$ vi templates/index.j2

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
&lt;h1&gt; Welcome to DevOpsSchool.com Ansible Training&lt;/h1&gt;
&lt;h3&gt; This is Deployed in OS Family - {{ ansible_os_family }} &lt;/h3&gt;
&lt;h3&gt; This is Deployed in OS Family - {{ ansible_hostname }} &lt;/h3&gt;
&lt;h3&gt; Company Name - {{ companyname }} &lt;/h3&gt;
companyname

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>&lt;strong&gt;##### Step 3 &#8211; Create a playbook.yaml#####&lt;/strong&gt;</p>
<pre class="brush: plain; title: ; notranslate">---
- name: This sets up an httpd webserver
hosts: all
remote_user: ec2-user
become: yes
vars:
ansible_ssh_private_key_file: remote.pem
companyname: DevOpsSchool.com
pack: httpd
tasks:
- name: Install the httpd apps
yum: name={{ pack }}
- name: Deploy configuration File
template: src=templates/index.j2 dest=/var/www/html/index.html
- name: start the httpd service
service: name={{ pack }} state=started</pre>
<p><strong>##### Step 4 &#8211; Last comamds to execute #####</strong></p>
<pre class="brush: plain; title: ; notranslate">$ ansible-playbook -i inventory httpd.yaml</pre>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-template-in-ansible/">How to use template in Ansible?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-use-template-in-ansible/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Run Ansible Adhoc commands or playbook in Local mode</title>
		<link>https://www.scmgalaxy.com/tutorials/run-ansible-adhoc-commands-or-playbook-in-local-mode/</link>
					<comments>https://www.scmgalaxy.com/tutorials/run-ansible-adhoc-commands-or-playbook-in-local-mode/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Thu, 06 Sep 2018 06:51:08 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Adhoc]]></category>
		<category><![CDATA[Local mode]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[Playbook]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5294</guid>

					<description><![CDATA[<p>If you are trying to run Ansible Adhoc commands or playbook in Local mode, these articles will help you. Ansible [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/run-ansible-adhoc-commands-or-playbook-in-local-mode/">Run Ansible Adhoc commands or playbook in Local mode</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you are trying to run Ansible Adhoc commands or playbook in Local mode, these articles will help you.</p>
<p>Ansible can&#8217;t run playbooks locally without ssh if ansible_connection=local is defined in the hosts file, although it can run playbooks locally without ssh with connection: local in the playbook or with flag &#8211;connection=local.</p>
<p><strong># # # # # # # # # # # # Method 1 # # # # # # # # # # # # # # # # # #</strong></p>
<pre class="brush: plain; title: ; notranslate">ansible 127.0.0.1 -m file -a &quot;dest=/opt/a.txt mode=600 state=touch&quot;
ansible 127.0.0.1 -m file -a &quot;dest=/opt/a.txt mode=600 state=file&quot;</pre>
<p><strong># # # # # # # # # # # # Method 2 # # # # # # # # # # # # # # # # # #</strong></p>
<pre class="brush: plain; title: ; notranslate">Inventory file
127.0.0.1 ansible_connection=local
localhost ansible_connection=local</pre>
<p><strong># # # # # # # # # # # # Method 3 # # # # # # # # # # # # # # # # # #</strong></p>
<pre class="brush: plain; title: ; notranslate">---

- name: run the playbook tasks on the localhost
hosts: 127.0.0.1
connection: local
become: yes
tasks:

- name: print out the hostname of target
command: hostname

- name: ensure aptitude is installed
command: apt-get -y install aptitude

- name: update the apt package index i.e. apt-get update
apt: update_cache=yes

- name: upgrade system packages i.e. apt-get upgrade
apt: upgrade=yes

</pre>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/run-ansible-adhoc-commands-or-playbook-in-local-mode/">Run Ansible Adhoc commands or playbook in Local mode</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/run-ansible-adhoc-commands-or-playbook-in-local-mode/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ansible Playbook Lab &#038; Excercise – Part 2</title>
		<link>https://www.scmgalaxy.com/tutorials/ansible-playbook-lab-excercise-part-2/</link>
					<comments>https://www.scmgalaxy.com/tutorials/ansible-playbook-lab-excercise-part-2/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 05 Sep 2018 08:55:39 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[excercise]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Module]]></category>
		<category><![CDATA[Playbook]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5289</guid>

					<description><![CDATA[<p>Execution Mode – Remote Write a Ansible Playbook to create a group called “deploy” Write a Ansible Playbook to create [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ansible-playbook-lab-excercise-part-2/">Ansible Playbook Lab &#038; Excercise – Part 2</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Execution Mode – Remote</p>
<ol>
<li>
<h4>Write a Ansible Playbook to create a group called “deploy”</h4>
</li>
<li>
<h4>Write a Ansible Playbook to create a user called “deploy-user” which is part of group called “group” and with /bin/bash shell.</h4>
</li>
<li>
<h4>Write a Ansible Playbook to install package named “httpd” in RHEL/centos.</h4>
</li>
<li>
<h4>Write a Ansible Playbook to start and enable the service named “httpd”</h4>
</li>
<li>
<h4>Write a Ansible Playbook to create a file called “index.html” in /var/www/html with some dummy html contents.</h4>
</li>
<li>
<h4>Write a Ansible Playbook to reboot a self machine.</h4>
</li>
<li>
<h4>Write a Ansible Playbook to install a package called “git”, “wget”.</h4>
</li>
<li>
<h4>Write a Ansible Playbook to clone git repo. thttps://github.com/scmgalaxy/ansible-role-template</h4>
</li>
<li>
<h4>Now Merge all Top Playbook into one and run and verify</h4>
</li>
</ol>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ansible-playbook-lab-excercise-part-2/">Ansible Playbook Lab &#038; Excercise – Part 2</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/ansible-playbook-lab-excercise-part-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
