<?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>Adhoc Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/adhoc/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/adhoc/</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>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 Adhoc Commands Lab &#038; Excercise &#8211; Part 1</title>
		<link>https://www.scmgalaxy.com/tutorials/ansible-adhoc-commands-lab-excercise-part-1/</link>
					<comments>https://www.scmgalaxy.com/tutorials/ansible-adhoc-commands-lab-excercise-part-1/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 05 Sep 2018 08:36:10 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Adhoc]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[excercise]]></category>
		<category><![CDATA[Lab]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5283</guid>

					<description><![CDATA[<p>Execution Mode &#8211; Local Write a Ansible Adhoc Commands to create a group called &#8220;deploy&#8221; Write a Ansible Adhoc Commands [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ansible-adhoc-commands-lab-excercise-part-1/">Ansible Adhoc Commands Lab &#038; Excercise &#8211; Part 1</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>Execution Mode &#8211; Local</strong></p>
<ol>
<li>
<h4>Write a Ansible Adhoc Commands to create a group called &#8220;deploy&#8221;</h4>
</li>
<li>
<h4>Write a Ansible Adhoc Commands to create a user called &#8220;deploy-user&#8221; which is part of group called &#8220;group&#8221; and with /bin/bash shell.</h4>
</li>
<li>
<h4>Write a Ansble Adhoc commands install package named &#8220;httpd&#8221; in RHEL/centos.</h4>
</li>
<li>
<h4>Write a Ansible Adhoc commands to start and enable the service named &#8220;httpd&#8221;</h4>
</li>
<li>
<h4>Write a Ansible commands to create a file called &#8220;index.html&#8221; in /var/www/html with some dummy html contents.</h4>
</li>
<li>
<h4>Write a Ansible commands to reboot a self machine.</h4>
</li>
<li>
<h4>Write a Ansible commands to install a package called &#8220;git&#8221;, &#8220;wget&#8221;.</h4>
</li>
<li>
<h4>Write a Ansible Adhoc commands to clone git repo. thttps://github.com/scmgalaxy/ansible-role-template</h4>
</li>
</ol>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ansible-adhoc-commands-lab-excercise-part-1/">Ansible Adhoc Commands Lab &#038; Excercise &#8211; Part 1</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/ansible-adhoc-commands-lab-excercise-part-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
