<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Ansible Tutorials and Notes Nov 2023	</title>
	<atom:link href="https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/</link>
	<description>Lets Learn, Do it &#38; Share! Thats a Best DevOps!!!</description>
	<lastBuildDate>Fri, 03 Nov 2023 16:07:22 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
	<item>
		<title>
		By: Ankur Malik		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-950</link>

		<dc:creator><![CDATA[Ankur Malik]]></dc:creator>
		<pubDate>Fri, 03 Nov 2023 16:07:22 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-950</guid>

					<description><![CDATA[---
- hosts: localhost

&#160;tasks:
&#160;&#160;&#160;- name: create a group
&#160;&#160;&#160;&#160;group:
&#160;&#160;&#160;&#160;&#160;state: present
&#160;&#160;&#160;&#160;&#160;name: deploy

&#160;&#160;&#160;- name: Install git, wget and httpd
&#160;&#160;&#160;&#160;apt:
&#160;&#160;&#160;&#160;&#160;name: &quot;{{ package }}&quot;
&#160;&#160;&#160;&#160;&#160;state: present
&#160;&#160;&#160;&#160;vars:
&#160;&#160;&#160;&#160;&#160;package:
&#160;&#160;&#160;&#160;&#160;&#160;- git
&#160;&#160;&#160;&#160;&#160;&#160;- wget
&#160;&#160;&#160;&#160;&#160;&#160;- apache2

&#160;&#160;&#160;- name: start the service httpd and enable
&#160;&#160;&#160;&#160;service:
&#160;&#160;&#160;&#160;&#160;&#160;name: apache2
&#160;&#160;&#160;&#160;&#160;&#160;state: started
&#160;&#160;&#160;&#160;&#160;&#160;enabled: true

&#160;&#160;&#160;- name: create a user - deploy
&#160;&#160;&#160;&#160;user:
&#160;&#160;&#160;&#160;&#160;name: deploy
&#160;&#160;&#160;&#160;&#160;state: present
&#160;&#160;&#160;&#160;&#160;shell: /bin/bash
&#160;&#160;&#160;&#160;&#160;group: deploy

&#160;&#160;&#160;- name: Template index.html
&#160;&#160;&#160;&#160;template:
&#160;&#160;&#160;&#160;&#160;src: apache2.j2
&#160;&#160;&#160;&#160;&#160;dest: /var/www/html/index.html
&#160;&#160;&#160;&#160;vars:
&#160;&#160;&#160;&#160;&#160;portnumber: 8080
...]]></description>
			<content:encoded><![CDATA[<p>&#8212;<br />
&#8211; hosts: localhost</p>
<p>&nbsp;tasks:<br />
&nbsp;&nbsp;&nbsp;&#8211; name: create a group<br />
&nbsp;&nbsp;&nbsp;&nbsp;group:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: present<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: deploy</p>
<p>&nbsp;&nbsp;&nbsp;&#8211; name: Install git, wget and httpd<br />
&nbsp;&nbsp;&nbsp;&nbsp;apt:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: &#8220;{{ package }}&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: present<br />
&nbsp;&nbsp;&nbsp;&nbsp;vars:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;package:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211; git<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211; wget<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211; apache2</p>
<p>&nbsp;&nbsp;&nbsp;&#8211; name: start the service httpd and enable<br />
&nbsp;&nbsp;&nbsp;&nbsp;service:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: apache2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: started<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled: true</p>
<p>&nbsp;&nbsp;&nbsp;&#8211; name: create a user &#8211; deploy<br />
&nbsp;&nbsp;&nbsp;&nbsp;user:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: deploy<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: present<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shell: /bin/bash<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group: deploy</p>
<p>&nbsp;&nbsp;&nbsp;&#8211; name: Template index.html<br />
&nbsp;&nbsp;&nbsp;&nbsp;template:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;src: apache2.j2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest: /var/www/html/index.html<br />
&nbsp;&nbsp;&nbsp;&nbsp;vars:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;portnumber: 8080<br />
&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Faisal		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-949</link>

		<dc:creator><![CDATA[Faisal]]></dc:creator>
		<pubDate>Fri, 03 Nov 2023 15:04:26 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-949</guid>

					<description><![CDATA[1.A. ansible-playbook grp.yaml

-------------------
- name: Ensure group deploy1 exists
&#160;hosts: localhost

&#160;tasks:
&#160;&#160;- name: Ensure group deploy1 exists
&#160;&#160;&#160;ansible.builtin.group:
&#160;&#160;&#160;&#160;name: deploy1
&#160;&#160;&#160;&#160;state: present

2.A. ansible-playbook usr.yaml

----------------
- name: Ensure user deploy1 exists
&#160;hosts: localhost

&#160;tasks:
&#160;&#160;- name: Ensure user deploy1 exists
&#160;&#160;&#160;ansible.builtin.user:
&#160;&#160;&#160;&#160;name: deploy1
&#160;&#160;&#160;&#160;comment: Test user
&#160;&#160;&#160;&#160;uid: 1040
&#160;&#160;&#160;&#160;group: deploy1

3.A.ansible-playbook pkg.yaml

---------------
- name: updating package
&#160;hosts: localhost

&#160;tasks:
&#160;&#160;- name: &lt;span&gt;updating package&lt;/span&gt;
&#160;&#160;&#160;ansible.builtin.package:
&#160;&#160;&#160;&#160;name:
&#160;&#160;&#160;&#160;&#160;- httpd
&#160;&#160;&#160;&#160;&#160;- mariadb-server
&#160;&#160;&#160;&#160;state: latest

4.A. ansible-playbook ser.yaml

-----------------
- name: Restart service
&#160;hosts: localhost

&#160;tasks:
&#160;&#160;- name: Restart service httpd, in all cases
&#160;&#160;&#160;ansible.builtin.service:
&#160;&#160;&#160;&#160;name: httpd

5.A. ansible-playbook file.yaml

----------
- name: create file
&#160;hosts: localhost

&#160;tasks:
&#160;&#160;- name: Touch a file, using symbolic modes to set the permissions (equivalent to 0644)
&#160;&#160;&#160;ansible.builtin.file:
&#160;&#160;&#160;path: /etc/foo.conf
&#160;&#160;&#160;state: touch
&#160;&#160;&#160;mode: u=rw,g=r,o=r]]></description>
			<content:encoded><![CDATA[<p>1.A. ansible-playbook grp.yaml</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8211; name: Ensure group deploy1 exists<br />
&nbsp;hosts: localhost</p>
<p>&nbsp;tasks:<br />
&nbsp;&nbsp;&#8211; name: Ensure group deploy1 exists<br />
&nbsp;&nbsp;&nbsp;ansible.builtin.group:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: deploy1<br />
&nbsp;&nbsp;&nbsp;&nbsp;state: present</p>
<p>2.A. ansible-playbook usr.yaml</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8211; name: Ensure user deploy1 exists<br />
&nbsp;hosts: localhost</p>
<p>&nbsp;tasks:<br />
&nbsp;&nbsp;&#8211; name: Ensure user deploy1 exists<br />
&nbsp;&nbsp;&nbsp;ansible.builtin.user:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: deploy1<br />
&nbsp;&nbsp;&nbsp;&nbsp;comment: Test user<br />
&nbsp;&nbsp;&nbsp;&nbsp;uid: 1040<br />
&nbsp;&nbsp;&nbsp;&nbsp;group: deploy1</p>
<p>3.A.ansible-playbook pkg.yaml</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8211; name: updating package<br />
&nbsp;hosts: localhost</p>
<p>&nbsp;tasks:<br />
&nbsp;&nbsp;&#8211; name: <span>updating package</span><br />
&nbsp;&nbsp;&nbsp;ansible.builtin.package:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211; httpd<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211; mariadb-server<br />
&nbsp;&nbsp;&nbsp;&nbsp;state: latest</p>
<p>4.A. ansible-playbook ser.yaml</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8211; name: Restart service<br />
&nbsp;hosts: localhost</p>
<p>&nbsp;tasks:<br />
&nbsp;&nbsp;&#8211; name: Restart service httpd, in all cases<br />
&nbsp;&nbsp;&nbsp;ansible.builtin.service:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: httpd</p>
<p>5.A. ansible-playbook file.yaml</p>
<p>&#8212;&#8212;&#8212;-<br />
&#8211; name: create file<br />
&nbsp;hosts: localhost</p>
<p>&nbsp;tasks:<br />
&nbsp;&nbsp;&#8211; name: Touch a file, using symbolic modes to set the permissions (equivalent to 0644)<br />
&nbsp;&nbsp;&nbsp;ansible.builtin.file:<br />
&nbsp;&nbsp;&nbsp;path: /etc/foo.conf<br />
&nbsp;&nbsp;&nbsp;state: touch<br />
&nbsp;&nbsp;&nbsp;mode: u=rw,g=r,o=r</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Danny Rubiano		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-948</link>

		<dc:creator><![CDATA[Danny Rubiano]]></dc:creator>
		<pubDate>Fri, 03 Nov 2023 14:57:47 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-948</guid>

					<description><![CDATA[&lt;strong&gt;What is Ansible?&lt;/strong&gt;
 Ansible is an open-source IT automation tool that automates tasks such as software provisioning, configuration management, and deployment. Ansible is agentless, meaning that it does not require any software to be installed on the remote hosts that it manages. This makes Ansible easy to set up and use, and it can be used to manage a wide variety of systems, including Linux, Windows, and macOS.
 &lt;strong&gt;Why Ansible?&lt;/strong&gt;
 There are many reasons to choose Ansible for IT automation, including:
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Easy to use:&lt;/strong&gt;&#160;Ansible is a very user-friendly tool, even for those who are new to IT automation.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Agentless:&lt;/strong&gt;&#160;Ansible does not require any software to be installed on the remote hosts that it manages.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Powerful:&lt;/strong&gt;&#160;Ansible can be used to automate a wide variety of tasks, from simple software provisioning to complex configuration management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Flexible:&lt;/strong&gt;&#160;Ansible can be used to manage a wide variety of systems, including Linux, Windows, and macOS.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Scalable:&lt;/strong&gt;&#160;Ansible can be used to manage large numbers of systems without requiring any additional infrastructure.&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Ansible Architecture&lt;/strong&gt;
 Ansible has a simple architecture that consists of two main components:
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Control node:&lt;/strong&gt;&#160;The control node is the machine that runs Ansible and from which Ansible commands are issued.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Managed nodes:&lt;/strong&gt;&#160;Managed nodes are the remote hosts that Ansible manages.&lt;/li&gt;&lt;/ul&gt;Ansible uses SSH to connect to the managed nodes and execute tasks. Ansible modules are executed on the managed nodes, and they can be used to perform a wide variety of tasks, such as installing software, configuring services, and managing files.
 &lt;strong&gt;What is a module?&lt;/strong&gt;
 An Ansible module is a Python script that performs a specific task on a managed node. Modules are the building blocks of Ansible playbooks, which are scripts that automate complex tasks by executing multiple modules in sequence.
 There are hundreds of built-in Ansible modules, and many more are available from third-party sources. Modules can be used to perform a wide variety of tasks, such as:
&lt;ul&gt;&lt;li&gt;Managing packages&lt;/li&gt;&lt;li&gt;Configuring services&lt;/li&gt;&lt;li&gt;Managing files&lt;/li&gt;&lt;li&gt;Executing commands&lt;/li&gt;&lt;li&gt;Gathering information&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;What are plugins?&lt;/strong&gt;
 An Ansible plugin is a piece of code that extends Ansible’s core functionality. There are many different types of plugins, including:
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Connection plugins:&lt;/strong&gt;&#160;Connection plugins allow Ansible to connect to different types of systems, such as Linux, Windows, and macOS.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Action plugins:&lt;/strong&gt;&#160;Action plugins allow Ansible to perform additional tasks, such as restarting services and sending notifications.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Lookup plugins:&lt;/strong&gt;&#160;Lookup plugins allow Ansible to retrieve data from external sources, such as databases and APIs.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Filter plugins:&lt;/strong&gt;&#160;Filter plugins allow Ansible to manipulate data.&lt;/li&gt;&lt;/ul&gt;Plugins can be used to extend Ansible in a variety of ways, and they can make Ansible even more powerful and flexible.]]></description>
			<content:encoded><![CDATA[<p><strong>What is Ansible?</strong><br />
 Ansible is an open-source IT automation tool that automates tasks such as software provisioning, configuration management, and deployment. Ansible is agentless, meaning that it does not require any software to be installed on the remote hosts that it manages. This makes Ansible easy to set up and use, and it can be used to manage a wide variety of systems, including Linux, Windows, and macOS.<br />
 <strong>Why Ansible?</strong><br />
 There are many reasons to choose Ansible for IT automation, including:</p>
<ul>
<li><strong>Easy to use:</strong>&nbsp;Ansible is a very user-friendly tool, even for those who are new to IT automation.</li>
<li><strong>Agentless:</strong>&nbsp;Ansible does not require any software to be installed on the remote hosts that it manages.</li>
<li><strong>Powerful:</strong>&nbsp;Ansible can be used to automate a wide variety of tasks, from simple software provisioning to complex configuration management.</li>
<li><strong>Flexible:</strong>&nbsp;Ansible can be used to manage a wide variety of systems, including Linux, Windows, and macOS.</li>
<li><strong>Scalable:</strong>&nbsp;Ansible can be used to manage large numbers of systems without requiring any additional infrastructure.</li>
</ul>
<p><strong>Ansible Architecture</strong><br />
 Ansible has a simple architecture that consists of two main components:</p>
<ul>
<li><strong>Control node:</strong>&nbsp;The control node is the machine that runs Ansible and from which Ansible commands are issued.</li>
<li><strong>Managed nodes:</strong>&nbsp;Managed nodes are the remote hosts that Ansible manages.</li>
</ul>
<p>Ansible uses SSH to connect to the managed nodes and execute tasks. Ansible modules are executed on the managed nodes, and they can be used to perform a wide variety of tasks, such as installing software, configuring services, and managing files.<br />
 <strong>What is a module?</strong><br />
 An Ansible module is a Python script that performs a specific task on a managed node. Modules are the building blocks of Ansible playbooks, which are scripts that automate complex tasks by executing multiple modules in sequence.<br />
 There are hundreds of built-in Ansible modules, and many more are available from third-party sources. Modules can be used to perform a wide variety of tasks, such as:</p>
<ul>
<li>Managing packages</li>
<li>Configuring services</li>
<li>Managing files</li>
<li>Executing commands</li>
<li>Gathering information</li>
</ul>
<p><strong>What are plugins?</strong><br />
 An Ansible plugin is a piece of code that extends Ansible’s core functionality. There are many different types of plugins, including:</p>
<ul>
<li><strong>Connection plugins:</strong>&nbsp;Connection plugins allow Ansible to connect to different types of systems, such as Linux, Windows, and macOS.</li>
<li><strong>Action plugins:</strong>&nbsp;Action plugins allow Ansible to perform additional tasks, such as restarting services and sending notifications.</li>
<li><strong>Lookup plugins:</strong>&nbsp;Lookup plugins allow Ansible to retrieve data from external sources, such as databases and APIs.</li>
<li><strong>Filter plugins:</strong>&nbsp;Filter plugins allow Ansible to manipulate data.</li>
</ul>
<p>Plugins can be used to extend Ansible in a variety of ways, and they can make Ansible even more powerful and flexible.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ville Kääriä		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-947</link>

		<dc:creator><![CDATA[Ville Kääriä]]></dc:creator>
		<pubDate>Fri, 03 Nov 2023 14:50:26 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-947</guid>

					<description><![CDATA[---
- &lt;span&gt;hosts&lt;/span&gt;: &lt;span&gt;localhost&lt;/span&gt;
&#160; &lt;span&gt;become&lt;/span&gt;: &lt;span&gt;true&lt;/span&gt;
&#160; &lt;span&gt;tasks&lt;/span&gt;:
&#160; - &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;Write a Ansible Playbook to create a group called deploy&lt;/span&gt;
&#160; &#160; &lt;span&gt;group&lt;/span&gt;:
&#160; &#160; &#160; &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;deploy&lt;/span&gt;
&#160; - &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;Write a Ansible Playbook to create a user called deploy-user which is part of group called deploy and with /bin/bash shell.&lt;/span&gt;
&#160; &#160; &lt;span&gt;user&lt;/span&gt;:
&#160; &#160; &#160; &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;deploy-user&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;group&lt;/span&gt;: &lt;span&gt;deploy&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;shell&lt;/span&gt;: &lt;span&gt;/bin/bash&lt;/span&gt;
&#160; - &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;Write a Ansible Playbook to install package named apache2 in Debian/Ubuntu.&lt;/span&gt;
&#160; &#160; &lt;span&gt;package&lt;/span&gt;:
&#160; &#160; &#160; &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;apache2&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;state&lt;/span&gt;: &lt;span&gt;present&lt;/span&gt;
&#160; - &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;Write a Ansible Playbook to start and enable the service named apache2&lt;/span&gt;
&#160; &#160; &lt;span&gt;service&lt;/span&gt;:
&#160; &#160; &#160; &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;apache2&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;state&lt;/span&gt;: &lt;span&gt;started&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;enabled&lt;/span&gt;: &lt;span&gt;yes&lt;/span&gt;
&#160; - &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;Write a Ansible Playbook to create a file called index.html in /var/www/html with some dummy html contents.&lt;/span&gt;
&#160; &#160; &lt;span&gt;copy&lt;/span&gt;:
&#160; &#160; &#160; &lt;span&gt;content&lt;/span&gt;: &lt;span&gt;&#039;&#060;h1&#062;Dummy content&#060;/h1&#062;&#039;&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;dest&lt;/span&gt;: &lt;span&gt;/var/www/html/index.html&lt;/span&gt;
&#160; &lt;span&gt;# - name: Write a Ansible Playbook to reboot a self machine.&lt;/span&gt;
&#160; &lt;span&gt;# &#160; reboot:&lt;/span&gt;
&#160; - &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;Write a Ansible Playbook to install a package called git, wget.&lt;/span&gt;
&#160; &#160; &lt;span&gt;package&lt;/span&gt;:
&#160; &#160; &#160; &lt;span&gt;name&lt;/span&gt;:
&#160; &#160; &#160; &#160; - &lt;span&gt;git&lt;/span&gt;
&#160; &#160; &#160; &#160; - &lt;span&gt;wget&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;state&lt;/span&gt;: &lt;span&gt;present&lt;/span&gt;
&#160; - &lt;span&gt;name&lt;/span&gt;: &lt;span&gt;Write a Ansible Playbook to clone git repo. https://github.com/scmgalaxy/ansible-role-template&lt;/span&gt;
&#160; &#160; &lt;span&gt;git&lt;/span&gt;:
&#160; &#160; &#160; &lt;span&gt;repo&lt;/span&gt;: &lt;span&gt;&#039;https://github.com/scmgalaxy/ansible-role-template&#039;&lt;/span&gt;
&#160; &#160; &#160; &lt;span&gt;dest&lt;/span&gt;: &lt;span&gt;/tmp/ansible-role-template&lt;/span&gt;]]></description>
			<content:encoded><![CDATA[<p>&#8212;<br />
&#8211; <span>hosts</span>: <span>localhost</span><br />
&nbsp; <span>become</span>: <span>true</span><br />
&nbsp; <span>tasks</span>:<br />
&nbsp; &#8211; <span>name</span>: <span>Write a Ansible Playbook to create a group called deploy</span><br />
&nbsp; &nbsp; <span>group</span>:<br />
&nbsp; &nbsp; &nbsp; <span>name</span>: <span>deploy</span><br />
&nbsp; &#8211; <span>name</span>: <span>Write a Ansible Playbook to create a user called deploy-user which is part of group called deploy and with /bin/bash shell.</span><br />
&nbsp; &nbsp; <span>user</span>:<br />
&nbsp; &nbsp; &nbsp; <span>name</span>: <span>deploy-user</span><br />
&nbsp; &nbsp; &nbsp; <span>group</span>: <span>deploy</span><br />
&nbsp; &nbsp; &nbsp; <span>shell</span>: <span>/bin/bash</span><br />
&nbsp; &#8211; <span>name</span>: <span>Write a Ansible Playbook to install package named apache2 in Debian/Ubuntu.</span><br />
&nbsp; &nbsp; <span>package</span>:<br />
&nbsp; &nbsp; &nbsp; <span>name</span>: <span>apache2</span><br />
&nbsp; &nbsp; &nbsp; <span>state</span>: <span>present</span><br />
&nbsp; &#8211; <span>name</span>: <span>Write a Ansible Playbook to start and enable the service named apache2</span><br />
&nbsp; &nbsp; <span>service</span>:<br />
&nbsp; &nbsp; &nbsp; <span>name</span>: <span>apache2</span><br />
&nbsp; &nbsp; &nbsp; <span>state</span>: <span>started</span><br />
&nbsp; &nbsp; &nbsp; <span>enabled</span>: <span>yes</span><br />
&nbsp; &#8211; <span>name</span>: <span>Write a Ansible Playbook to create a file called index.html in /var/www/html with some dummy html contents.</span><br />
&nbsp; &nbsp; <span>copy</span>:<br />
&nbsp; &nbsp; &nbsp; <span>content</span>: <span>&#8216;&lt;h1&gt;Dummy content&lt;/h1&gt;&#8217;</span><br />
&nbsp; &nbsp; &nbsp; <span>dest</span>: <span>/var/www/html/index.html</span><br />
&nbsp; <span># &#8211; name: Write a Ansible Playbook to reboot a self machine.</span><br />
&nbsp; <span># &nbsp; reboot:</span><br />
&nbsp; &#8211; <span>name</span>: <span>Write a Ansible Playbook to install a package called git, wget.</span><br />
&nbsp; &nbsp; <span>package</span>:<br />
&nbsp; &nbsp; &nbsp; <span>name</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &#8211; <span>git</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &#8211; <span>wget</span><br />
&nbsp; &nbsp; &nbsp; <span>state</span>: <span>present</span><br />
&nbsp; &#8211; <span>name</span>: <span>Write a Ansible Playbook to clone git repo. <a href="https://github.com/scmgalaxy/ansible-role-template" rel="nofollow ugc">https://github.com/scmgalaxy/ansible-role-template</a></span><br />
&nbsp; &nbsp; <span>git</span>:<br />
&nbsp; &nbsp; &nbsp; <span>repo</span>: <span>&#8216;https://github.com/scmgalaxy/ansible-role-template&#8217;</span><br />
&nbsp; &nbsp; &nbsp; <span>dest</span>: <span>/tmp/ansible-role-template</span></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dirk Willemans		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-946</link>

		<dc:creator><![CDATA[Dirk Willemans]]></dc:creator>
		<pubDate>Fri, 03 Nov 2023 14:45:14 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-946</guid>

					<description><![CDATA[---
- hosts: localhost
&#160;gather_facts: false
&#160;tasks:
&#160;&#160;- name: &#039;1. create group&#039;
&#160;&#160;&#160;group:
&#160;&#160;&#160;&#160;name: deploy
&#160;&#160;&#160;&#160;state: present
&#160;&#160;- name: &#039;2. create user&#039;
&#160;&#160;&#160;user:
&#160;&#160;&#160;&#160;name: deploy-user
&#160;&#160;&#160;&#160;state: present
&#160;&#160;&#160;&#160;groups: deploy
&#160;&#160;&#160;&#160;shell: /bin/bash
&#160;&#160;- name: &#039;3. install package&#039;
&#160;&#160;&#160;yum:
&#160;&#160;&#160;&#160;name: httpd
&#160;&#160;&#160;&#160;state: present
&#160;&#160;- name: &#039;4. start and enable service httpd&#039;
&#160;&#160;&#160;service:
&#160;&#160;&#160;&#160;name: httpd
&#160;&#160;&#160;&#160;state: started
&#160;&#160;&#160;&#160;enabled: true
&#160;&#160;- name: &#039;5. create file&#039;
&#160;&#160;&#160;copy:
&#160;&#160;&#160;&#160;dest: /var/www/html/index.html
&#160;&#160;&#160;&#160;content: &#124;
&#160;&#160;&#160;&#160;&#160;hello world !!!
&#160;&#160;- name: &#039;7. install packages&#039;
&#160;&#160;&#160;vars:
&#160;&#160;&#160;&#160;packages:
&#160;&#160;&#160;&#160;&#160;- git
&#160;&#160;&#160;&#160;&#160;- wget
&#160;&#160;&#160;yum:
&#160;&#160;&#160;&#160;name: &quot;{{ packages }}&quot;
&#160;&#160;&#160;&#160;state: present
&#160;&#160;- name: &#039;8. git clone repo&#039;
&#160;&#160;&#160;git:
&#160;&#160;&#160;&#160;repo: https://github.com/scmgalaxy/ansible-role-template
&#160;&#160;&#160;&#160;dest: git/https://github.com/scmgalaxy/ansible-role-template
...]]></description>
			<content:encoded><![CDATA[<p>&#8212;<br />
&#8211; hosts: localhost<br />
&nbsp;gather_facts: false<br />
&nbsp;tasks:<br />
&nbsp;&nbsp;&#8211; name: &#8216;1. create group&#8217;<br />
&nbsp;&nbsp;&nbsp;group:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: deploy<br />
&nbsp;&nbsp;&nbsp;&nbsp;state: present<br />
&nbsp;&nbsp;&#8211; name: &#8216;2. create user&#8217;<br />
&nbsp;&nbsp;&nbsp;user:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: deploy-user<br />
&nbsp;&nbsp;&nbsp;&nbsp;state: present<br />
&nbsp;&nbsp;&nbsp;&nbsp;groups: deploy<br />
&nbsp;&nbsp;&nbsp;&nbsp;shell: /bin/bash<br />
&nbsp;&nbsp;&#8211; name: &#8216;3. install package&#8217;<br />
&nbsp;&nbsp;&nbsp;yum:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: httpd<br />
&nbsp;&nbsp;&nbsp;&nbsp;state: present<br />
&nbsp;&nbsp;&#8211; name: &#8216;4. start and enable service httpd&#8217;<br />
&nbsp;&nbsp;&nbsp;service:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: httpd<br />
&nbsp;&nbsp;&nbsp;&nbsp;state: started<br />
&nbsp;&nbsp;&nbsp;&nbsp;enabled: true<br />
&nbsp;&nbsp;&#8211; name: &#8216;5. create file&#8217;<br />
&nbsp;&nbsp;&nbsp;copy:<br />
&nbsp;&nbsp;&nbsp;&nbsp;dest: /var/www/html/index.html<br />
&nbsp;&nbsp;&nbsp;&nbsp;content: |<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hello world !!!<br />
&nbsp;&nbsp;&#8211; name: &#8216;7. install packages&#8217;<br />
&nbsp;&nbsp;&nbsp;vars:<br />
&nbsp;&nbsp;&nbsp;&nbsp;packages:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211; git<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211; wget<br />
&nbsp;&nbsp;&nbsp;yum:<br />
&nbsp;&nbsp;&nbsp;&nbsp;name: &#8220;{{ packages }}&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;state: present<br />
&nbsp;&nbsp;&#8211; name: &#8216;8. git clone repo&#8217;<br />
&nbsp;&nbsp;&nbsp;git:<br />
&nbsp;&nbsp;&nbsp;&nbsp;repo: <a href="https://github.com/scmgalaxy/ansible-role-template" rel="nofollow ugc">https://github.com/scmgalaxy/ansible-role-template</a><br />
&nbsp;&nbsp;&nbsp;&nbsp;dest: git/https://github.com/scmgalaxy/ansible-role-template<br />
&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Alison Silva		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-945</link>

		<dc:creator><![CDATA[Alison Silva]]></dc:creator>
		<pubDate>Fri, 03 Nov 2023 14:38:24 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-945</guid>

					<description><![CDATA[What is Ansible?
Open code IT automation tool

Why Ansible?
Open source, use yaml that is very common nowadays, agentless.

Ansible Architecture?
control nodes and managed nodes

What is module?
Its like a program that are used to execute tasks.
Code that can control system resources or execute system commands

What is Plugins?
pieces of code that augment Ansible&#039;s core functionality]]></description>
			<content:encoded><![CDATA[<p>What is Ansible?<br />
Open code IT automation tool</p>
<p>Why Ansible?<br />
Open source, use yaml that is very common nowadays, agentless.</p>
<p>Ansible Architecture?<br />
control nodes and managed nodes</p>
<p>What is module?<br />
Its like a program that are used to execute tasks.<br />
Code that can control system resources or execute system commands</p>
<p>What is Plugins?<br />
pieces of code that augment Ansible&#8217;s core functionality</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ankur Malik		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-944</link>

		<dc:creator><![CDATA[Ankur Malik]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 19:00:26 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-944</guid>

					<description><![CDATA[What is Ansible?
Ansible is configuration management tool, can say that It&#039;s enables infrastructure as code. Also Ansible is agentless, relying on temporary remote connections via SSH or Windows Remote Management which allows PowerShell execution.

Why Ansible?
Ansible can be used for a variety of purposes, but it’s most commonly used to automate the deployment and configuration of systems such as servers, virtual machines, and applications.&#160;It can be used to perform tasks such as installing software packages, configuring networking settings, and updating system configurations.

Ansible Architecture?

Ansible Architecture:-
- ACS and ARS
- Modules
- Plugins
- Inventory
- Playbooks

What is module?
Ansible works by connecting to your nodes and pushing out small programs, called “Ansible Modules” to them.&#160;These programs are written to be resource models of the desired state of the system. Ansible then executes these modules over SSH by default, and removes them when finished.

What is Plugins?

Plugins are pieces of code that augment Ansible’s core functionality. Ansible ships with a number of handy plugins, and that can be easily write.]]></description>
			<content:encoded><![CDATA[<p>What is Ansible?<br />
Ansible is configuration management tool, can say that It&#8217;s enables infrastructure as code. Also Ansible is agentless, relying on temporary remote connections via SSH or Windows Remote Management which allows PowerShell execution.</p>
<p>Why Ansible?<br />
Ansible can be used for a variety of purposes, but it’s most commonly used to automate the deployment and configuration of systems such as servers, virtual machines, and applications.&nbsp;It can be used to perform tasks such as installing software packages, configuring networking settings, and updating system configurations.</p>
<p>Ansible Architecture?</p>
<p>Ansible Architecture:-<br />
&#8211; ACS and ARS<br />
&#8211; Modules<br />
&#8211; Plugins<br />
&#8211; Inventory<br />
&#8211; Playbooks</p>
<p>What is module?<br />
Ansible works by connecting to your nodes and pushing out small programs, called “Ansible Modules” to them.&nbsp;These programs are written to be resource models of the desired state of the system. Ansible then executes these modules over SSH by default, and removes them when finished.</p>
<p>What is Plugins?</p>
<p>Plugins are pieces of code that augment Ansible’s core functionality. Ansible ships with a number of handy plugins, and that can be easily write.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Francisco Jose Montoya		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-943</link>

		<dc:creator><![CDATA[Francisco Jose Montoya]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 16:33:39 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-943</guid>

					<description><![CDATA[Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy
ansible all -i inventory -m group -a&quot;name=deploy state=present&quot; -u ubuntu --key-file=node.pem -b

How to verify?
$ more /etc/group &#124; grep deploy
ansible all -i inventory -a&quot;grep deploy /etc/group&quot; -u ubuntu --key-file=node.pem -b

Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.

ansible all -i inventory -m user -a&quot;name=deploy-user groups=deploy&quot; -u ubuntu --key-file=node.pem -b

How to verify?
$ more /etc/passwd &#124; grep deploy-user

ansible all -i inventory -a&quot;grep deploy-user /etc/passwd&quot; -u ubuntu --key-file=node.pem -b


Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.
ansible all -i inventory -m apt -a&quot;state=latest name=httpd&quot; -u ubuntu --key-file=node.pem -b

How to verify?
$ which httpd
ansible all -i inventory -a&quot;which httpd&quot; -u ubuntu --key-file=node.pem -b

Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”
ansible all -i inventory -m service -a&quot;name=httpd state=started&quot; -u ubuntu --key-file=node.pem -b

How to verify?
$ ps -eaf &#124; grep httpd
ansible localhost -m shell -a&quot;ps -fea &#124; grep httpd&quot; -u ubuntu --key-file=node.pem -b

Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.
ansible all -i inventory -m copy -a&#039;content=&quot;&#060;h1&#062; Hello World - Fran &#060;/h1&#062;&quot; dest=/var/www/html&#039; -u ubuntu --key-file=node.pem -b

How to verify?
Browse http://x.x.x.x:80

Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.
ansible all -i inventory -m copy -a&quot;src=second.html dest=/var/www/html/second.html&quot; -u ubuntu --key-file=node.pem -b

How to verify?
Browse http://x.x.x.x/second.html

Program 7 – Write a Ansible commands to install a package called “git”, “wget”.
ansible all -i inventory -m apt -a&quot;state=latest name=git,wget&quot; -u ubuntu --key-file=node.pem -b


How to verify?
$ which git
$ which wget
ansible all -i inventory -a&quot;which git&quot; -u ubuntu --key-file=node.pem -b
ansible all -i inventory -a&quot;which wget&quot; -u ubuntu --key-file=node.pem -b

Program 8 – Write a Ansible Adhoc commands to clone git repo. https://github.com/scmgalaxy/ansible-role-template.
ansible all -i inventory -m git -a&quot;repo=&#039;https://github.com/scmgalaxy/ansible-role-template&#039; dest=/home/ubuntu/ansible-role-template&quot; -u ubuntu --key-file=node.pem -b

How to verify?
$ ls
ansible all -i inventory -a&quot;ls /home/ubuntu/&quot; -u ubuntu --key-file=node.pem -b

Program 9 – Write a Ansible commands to reboot a self machine.
ansible all -i inventory -m reboot -a&quot;reboot_timeout: 3600&quot; -u ubuntu --key-file=node.pem -b


Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.
ansible all -i inventory -m copy -a&#039;content=&quot;&quot; dest=/opt/devopsschool.txt owner=root&quot;&#160;-u ubuntu --key-file=node.pem -b
ansible all -i inventory -m file -a&#039;path=/opt/devopsschool.txt state:absent&quot;&#160;-u ubuntu --key-file=node.pem -b]]></description>
			<content:encoded><![CDATA[<p>Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy<br />
ansible all -i inventory -m group -a&#8221;name=deploy state=present&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
$ more /etc/group | grep deploy<br />
ansible all -i inventory -a&#8221;grep deploy /etc/group&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.</p>
<p>ansible all -i inventory -m user -a&#8221;name=deploy-user groups=deploy&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
$ more /etc/passwd | grep deploy-user</p>
<p>ansible all -i inventory -a&#8221;grep deploy-user /etc/passwd&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.<br />
ansible all -i inventory -m apt -a&#8221;state=latest name=httpd&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
$ which httpd<br />
ansible all -i inventory -a&#8221;which httpd&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”<br />
ansible all -i inventory -m service -a&#8221;name=httpd state=started&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
$ ps -eaf | grep httpd<br />
ansible localhost -m shell -a&#8221;ps -fea | grep httpd&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.<br />
ansible all -i inventory -m copy -a&#8217;content=&#8221;&lt;h1&gt; Hello World &#8211; Fran &lt;/h1&gt;&#8221; dest=/var/www/html&#8217; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
Browse <a href="http://x.x.x.x:80" rel="nofollow ugc">http://x.x.x.x:80</a></p>
<p>Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.<br />
ansible all -i inventory -m copy -a&#8221;src=second.html dest=/var/www/html/second.html&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
Browse <a href="http://x.x.x.x/second.html" rel="nofollow ugc">http://x.x.x.x/second.html</a></p>
<p>Program 7 – Write a Ansible commands to install a package called “git”, “wget”.<br />
ansible all -i inventory -m apt -a&#8221;state=latest name=git,wget&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
$ which git<br />
$ which wget<br />
ansible all -i inventory -a&#8221;which git&#8221; -u ubuntu &#8211;key-file=node.pem -b<br />
ansible all -i inventory -a&#8221;which wget&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 8 – Write a Ansible Adhoc commands to clone git repo. <a href="https://github.com/scmgalaxy/ansible-role-template" rel="nofollow ugc">https://github.com/scmgalaxy/ansible-role-template</a>.<br />
ansible all -i inventory -m git -a&#8221;repo=&#8217;https://github.com/scmgalaxy/ansible-role-template&#8217; dest=/home/ubuntu/ansible-role-template&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>How to verify?<br />
$ ls<br />
ansible all -i inventory -a&#8221;ls /home/ubuntu/&#8221; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 9 – Write a Ansible commands to reboot a self machine.<br />
ansible all -i inventory -m reboot -a&#8221;reboot_timeout: 3600&#8243; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.<br />
ansible all -i inventory -m copy -a&#8217;content=&#8221;&#8221; dest=/opt/devopsschool.txt owner=root&#8221;&nbsp;-u ubuntu &#8211;key-file=node.pem -b<br />
ansible all -i inventory -m file -a&#8217;path=/opt/devopsschool.txt state:absent&#8221;&nbsp;-u ubuntu &#8211;key-file=node.pem -b</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adam		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-942</link>

		<dc:creator><![CDATA[Adam]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 16:24:44 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-942</guid>

					<description><![CDATA[## below become method works if the ansible user is logging in with ssh key and sudo is configured with NOPASSWD on the remote node


Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy

# ansible &#060;hostname&#062; -i &#060;inventory file&#062; -m group -a &quot;name=deploy state=present&quot; -b

How to verify?
$ more /etc/group &#124; grep deploy

Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.

# ansible &#060;hostname&#062; -i &#060;inventory file&#062; -m user -a &quot;name=deploy-user group=deploy state=present shell=/bin/bash&quot; -b

How to verify?
$ more /etc/passwd &#124; grep deploy-user

Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.

# ansible &#060;hostname&#062; -i &#060;inventory file&#062; -m dnf -a &quot;name=httpd state=latest&quot; -b

How to verify?
$ which httpd

Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”

# ansible &#060;hostname&#062; -i &#060;inventory file&#062; -m service -a &quot;name=httpd state=started enabled=true&quot; -b

How to verify?
$ ps -eaf &#124; grep httpd

Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.

# ansible &#060;hostname&#062; -i &#060;inventory_file&#062; -m copy -a &quot;dest=/var/www/html/index.html content=&#039;some dummy html contents&#039;&quot; -b

How to verify?
Browse http://x.x.x.x:80

Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.

# ansible &#060;hostname&#062; -i &#060;inventory_file&#062; -m copy -a &quot;dest=/var/www/html/second.html content=&#039;some dummy html contents&#039;&quot; -b

How to verify?
Browse http://x.x.x.x/second.html

Program 7 – Write a Ansible commands to install a package called “git”, “wget”.

# ansible &#060;hostname&#062; -i &#060;inventory_file&#062; -m dnf -a &quot;name=git,wget state=latest&quot; -b

How to verify?
$ which git
$ which wget

Program 8 – Write a Ansible Adhoc commands to clone git repo. https://github.com/scmgalaxy/ansible-role-template.

# ansible &#060;hostname&#062; -i &#060;inventory_file&#062; -m git -a &quot;name=https://github.com/scmgalaxy/ansible-role-template dest=&#060;dest_dir&#062;&quot;

How to verify?
$ ls

Program 9 – Write a Ansible commands to reboot a self machine.

# ansible &#060;hostname&#062; -i &#060;inventory_file&#062; -m reboot -b

Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.


# ansible &#060;hostname&#062; -i &#060;inventory_file&#062; -m file -a &quot;name=/opt/devopsschool.txt state=touch&quot; -b
# ansible &#060;hostname&#062; -i &#060;inventory_file&#062; -m file -a &quot;name=/opt/devopsschool.txt state=absent&quot; -b]]></description>
			<content:encoded><![CDATA[<p>## below become method works if the ansible user is logging in with ssh key and sudo is configured with NOPASSWD on the remote node</p>
<p>Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory file&gt; -m group -a &#8220;name=deploy state=present&#8221; -b</p>
<p>How to verify?<br />
$ more /etc/group | grep deploy</p>
<p>Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory file&gt; -m user -a &#8220;name=deploy-user group=deploy state=present shell=/bin/bash&#8221; -b</p>
<p>How to verify?<br />
$ more /etc/passwd | grep deploy-user</p>
<p>Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory file&gt; -m dnf -a &#8220;name=httpd state=latest&#8221; -b</p>
<p>How to verify?<br />
$ which httpd</p>
<p>Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory file&gt; -m service -a &#8220;name=httpd state=started enabled=true&#8221; -b</p>
<p>How to verify?<br />
$ ps -eaf | grep httpd</p>
<p>Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory_file&gt; -m copy -a &#8220;dest=/var/www/html/index.html content=&#8217;some dummy html contents'&#8221; -b</p>
<p>How to verify?<br />
Browse <a href="http://x.x.x.x:80" rel="nofollow ugc">http://x.x.x.x:80</a></p>
<p>Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory_file&gt; -m copy -a &#8220;dest=/var/www/html/second.html content=&#8217;some dummy html contents'&#8221; -b</p>
<p>How to verify?<br />
Browse <a href="http://x.x.x.x/second.html" rel="nofollow ugc">http://x.x.x.x/second.html</a></p>
<p>Program 7 – Write a Ansible commands to install a package called “git”, “wget”.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory_file&gt; -m dnf -a &#8220;name=git,wget state=latest&#8221; -b</p>
<p>How to verify?<br />
$ which git<br />
$ which wget</p>
<p>Program 8 – Write a Ansible Adhoc commands to clone git repo. <a href="https://github.com/scmgalaxy/ansible-role-template" rel="nofollow ugc">https://github.com/scmgalaxy/ansible-role-template</a>.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory_file&gt; -m git -a &#8220;name=https://github.com/scmgalaxy/ansible-role-template dest=&lt;dest_dir&gt;&#8221;</p>
<p>How to verify?<br />
$ ls</p>
<p>Program 9 – Write a Ansible commands to reboot a self machine.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory_file&gt; -m reboot -b</p>
<p>Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.</p>
<p># ansible &lt;hostname&gt; -i &lt;inventory_file&gt; -m file -a &#8220;name=/opt/devopsschool.txt state=touch&#8221; -b<br />
# ansible &lt;hostname&gt; -i &lt;inventory_file&gt; -m file -a &#8220;name=/opt/devopsschool.txt state=absent&#8221; -b</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Danny Rubiano		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-941</link>

		<dc:creator><![CDATA[Danny Rubiano]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 16:12:03 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-941</guid>

					<description><![CDATA[&lt;strong&gt;What is Ansible?&lt;/strong&gt;
Ansible is an open-source IT automation tool that automates tasks such as software provisioning, configuration management, and deployment. Ansible is agentless, meaning that it does not require any software to be installed on the remote hosts that it manages. This makes Ansible easy to set up and use, and it can be used to manage a wide variety of systems, including Linux, Windows, and macOS.
&lt;strong&gt;Why Ansible?&lt;/strong&gt;
There are many reasons to choose Ansible for IT automation, including:
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Easy to use:&lt;/strong&gt;&#160;Ansible is a very user-friendly tool, even for those who are new to IT automation.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Agentless:&lt;/strong&gt;&#160;Ansible does not require any software to be installed on the remote hosts that it manages.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Powerful:&lt;/strong&gt;&#160;Ansible can be used to automate a wide variety of tasks, from simple software provisioning to complex configuration management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Flexible:&lt;/strong&gt;&#160;Ansible can be used to manage a wide variety of systems, including Linux, Windows, and macOS.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Scalable:&lt;/strong&gt;&#160;Ansible can be used to manage large numbers of systems without requiring any additional infrastructure.&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Ansible Architecture&lt;/strong&gt;
Ansible has a simple architecture that consists of two main components:
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Control node:&lt;/strong&gt;&#160;The control node is the machine that runs Ansible and from which Ansible commands are issued.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Managed nodes:&lt;/strong&gt;&#160;Managed nodes are the remote hosts that Ansible manages.&lt;/li&gt;&lt;/ul&gt;Ansible uses SSH to connect to the managed nodes and execute tasks. Ansible modules are executed on the managed nodes, and they can be used to perform a wide variety of tasks, such as installing software, configuring services, and managing files.
&lt;strong&gt;What is a module?&lt;/strong&gt;
An Ansible module is a Python script that performs a specific task on a managed node. Modules are the building blocks of Ansible playbooks, which are scripts that automate complex tasks by executing multiple modules in sequence.
There are hundreds of built-in Ansible modules, and many more are available from third-party sources. Modules can be used to perform a wide variety of tasks, such as:
&lt;ul&gt;&lt;li&gt;Managing packages&lt;/li&gt;&lt;li&gt;Configuring services&lt;/li&gt;&lt;li&gt;Managing files&lt;/li&gt;&lt;li&gt;Executing commands&lt;/li&gt;&lt;li&gt;Gathering information&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;What are plugins?&lt;/strong&gt;
An Ansible plugin is a piece of code that extends Ansible&#039;s core functionality. There are many different types of plugins, including:
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Connection plugins:&lt;/strong&gt;&#160;Connection plugins allow Ansible to connect to different types of systems, such as Linux, Windows, and macOS.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Action plugins:&lt;/strong&gt;&#160;Action plugins allow Ansible to perform additional tasks, such as restarting services and sending notifications.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Lookup plugins:&lt;/strong&gt;&#160;Lookup plugins allow Ansible to retrieve data from external sources, such as databases and APIs.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Filter plugins:&lt;/strong&gt;&#160;Filter plugins allow Ansible to manipulate data.&lt;/li&gt;&lt;/ul&gt;Plugins can be used to extend Ansible in a variety of ways, and they can make Ansible even more powerful and flexible.]]></description>
			<content:encoded><![CDATA[<p><strong>What is Ansible?</strong><br />
Ansible is an open-source IT automation tool that automates tasks such as software provisioning, configuration management, and deployment. Ansible is agentless, meaning that it does not require any software to be installed on the remote hosts that it manages. This makes Ansible easy to set up and use, and it can be used to manage a wide variety of systems, including Linux, Windows, and macOS.<br />
<strong>Why Ansible?</strong><br />
There are many reasons to choose Ansible for IT automation, including:</p>
<ul>
<li><strong>Easy to use:</strong>&nbsp;Ansible is a very user-friendly tool, even for those who are new to IT automation.</li>
<li><strong>Agentless:</strong>&nbsp;Ansible does not require any software to be installed on the remote hosts that it manages.</li>
<li><strong>Powerful:</strong>&nbsp;Ansible can be used to automate a wide variety of tasks, from simple software provisioning to complex configuration management.</li>
<li><strong>Flexible:</strong>&nbsp;Ansible can be used to manage a wide variety of systems, including Linux, Windows, and macOS.</li>
<li><strong>Scalable:</strong>&nbsp;Ansible can be used to manage large numbers of systems without requiring any additional infrastructure.</li>
</ul>
<p><strong>Ansible Architecture</strong><br />
Ansible has a simple architecture that consists of two main components:</p>
<ul>
<li><strong>Control node:</strong>&nbsp;The control node is the machine that runs Ansible and from which Ansible commands are issued.</li>
<li><strong>Managed nodes:</strong>&nbsp;Managed nodes are the remote hosts that Ansible manages.</li>
</ul>
<p>Ansible uses SSH to connect to the managed nodes and execute tasks. Ansible modules are executed on the managed nodes, and they can be used to perform a wide variety of tasks, such as installing software, configuring services, and managing files.<br />
<strong>What is a module?</strong><br />
An Ansible module is a Python script that performs a specific task on a managed node. Modules are the building blocks of Ansible playbooks, which are scripts that automate complex tasks by executing multiple modules in sequence.<br />
There are hundreds of built-in Ansible modules, and many more are available from third-party sources. Modules can be used to perform a wide variety of tasks, such as:</p>
<ul>
<li>Managing packages</li>
<li>Configuring services</li>
<li>Managing files</li>
<li>Executing commands</li>
<li>Gathering information</li>
</ul>
<p><strong>What are plugins?</strong><br />
An Ansible plugin is a piece of code that extends Ansible&#8217;s core functionality. There are many different types of plugins, including:</p>
<ul>
<li><strong>Connection plugins:</strong>&nbsp;Connection plugins allow Ansible to connect to different types of systems, such as Linux, Windows, and macOS.</li>
<li><strong>Action plugins:</strong>&nbsp;Action plugins allow Ansible to perform additional tasks, such as restarting services and sending notifications.</li>
<li><strong>Lookup plugins:</strong>&nbsp;Lookup plugins allow Ansible to retrieve data from external sources, such as databases and APIs.</li>
<li><strong>Filter plugins:</strong>&nbsp;Filter plugins allow Ansible to manipulate data.</li>
</ul>
<p>Plugins can be used to extend Ansible in a variety of ways, and they can make Ansible even more powerful and flexible.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Bert Smets		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-940</link>

		<dc:creator><![CDATA[Bert Smets]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 16:10:29 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-940</guid>

					<description><![CDATA[What is Ansible?
A configuration management tools for servers.

Why Ansible?
To have a tools that uses 1 &quot;language&quot; for all platforms, easy to learn and manage.

Ansible Architecture?
Ansible has an architecture that consists of two types of nodes: a control node and one or more managed nodes. The control node is where Ansible is installed and run, and the managed nodes are the devices or systems that are configured and managed by Ansible.

What is module?
A piece of code, usually (but not mandatory) written in Python that can be used to execute certain action on the ARS (Ansible remote server). The module itself is located on the ACS (ansible controller server).

What is Plugins?
A piece of code that resides in the ACS and runs on the ACS. Plugins are pieces of code that augment Ansible’s core functionality.

Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy
ansible web,db -i inventory -m group -a&quot;name=deploy&quot; -u ubuntu -k -b

Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.
ansible web,db -i inventory -m user -a&quot;name=deploy-user group=deploy shell=/bin/bash&quot; -u ubuntu --key node.pem -b

Program 3 – Write a Ansible Adhoc commands install package named “apache2” in Ubuntu.
ansible web -i inventory -m apt -a&quot;state=latest name=apache2&quot; -u ubuntu --key-file=node.pem -b

Program 4 – Write a Ansible Adhoc commands to start and enable the service named “apache2”
ansible localhost -m service -a&quot;name=apache2 state=started&quot;&#160;

Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.
ansible localhost -m file -a&quot;path=&quot;/var/www/html/index.html&quot; state=touch&quot;

Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.
ansible localhost -m copy -a&quot;src=&quot;second.html&quot; dest=&quot;/var/www/html/second.html&quot;

Program 7 – Write a Ansible commands to install a package called “git”, “wget”.
ansible localhost -m apt -a&quot;state=latest name=git,wget&quot;

Program 8 – Write a Ansible Adhoc commands to clone git repo. https://github.com/scmgalaxy/ansible-role-template.
ansible localhost -m git -a&quot;clone=true dest=/home/ubuntu/bert/repo repo=https://github.com/scmgalaxy/ansible-role-template&quot;

Program 9 – Write a Ansible commands to reboot a self machine.
ansible localhost -m reboot -a &quot;msg=&#039;Reboot triggered by Ansible&#039;&quot;

Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.
ansible localhost -m file -a&quot;path=&quot;/opt/devopsschool.txt&quot; state=touch&quot;
ansible localhost -m file -a&quot;path=&quot;/opt/devopsschool.txt&quot; state=absent&quot;]]></description>
			<content:encoded><![CDATA[<p>What is Ansible?<br />
A configuration management tools for servers.</p>
<p>Why Ansible?<br />
To have a tools that uses 1 &#8220;language&#8221; for all platforms, easy to learn and manage.</p>
<p>Ansible Architecture?<br />
Ansible has an architecture that consists of two types of nodes: a control node and one or more managed nodes. The control node is where Ansible is installed and run, and the managed nodes are the devices or systems that are configured and managed by Ansible.</p>
<p>What is module?<br />
A piece of code, usually (but not mandatory) written in Python that can be used to execute certain action on the ARS (Ansible remote server). The module itself is located on the ACS (ansible controller server).</p>
<p>What is Plugins?<br />
A piece of code that resides in the ACS and runs on the ACS. Plugins are pieces of code that augment Ansible’s core functionality.</p>
<p>Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy<br />
ansible web,db -i inventory -m group -a&#8221;name=deploy&#8221; -u ubuntu -k -b</p>
<p>Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.<br />
ansible web,db -i inventory -m user -a&#8221;name=deploy-user group=deploy shell=/bin/bash&#8221; -u ubuntu &#8211;key node.pem -b</p>
<p>Program 3 – Write a Ansible Adhoc commands install package named “apache2” in Ubuntu.<br />
ansible web -i inventory -m apt -a&#8221;state=latest name=apache2&#8243; -u ubuntu &#8211;key-file=node.pem -b</p>
<p>Program 4 – Write a Ansible Adhoc commands to start and enable the service named “apache2”<br />
ansible localhost -m service -a&#8221;name=apache2 state=started&#8221;&nbsp;</p>
<p>Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.<br />
ansible localhost -m file -a&#8221;path=&#8221;/var/www/html/index.html&#8221; state=touch&#8221;</p>
<p>Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.<br />
ansible localhost -m copy -a&#8221;src=&#8221;second.html&#8221; dest=&#8221;/var/www/html/second.html&#8221;</p>
<p>Program 7 – Write a Ansible commands to install a package called “git”, “wget”.<br />
ansible localhost -m apt -a&#8221;state=latest name=git,wget&#8221;</p>
<p>Program 8 – Write a Ansible Adhoc commands to clone git repo. <a href="https://github.com/scmgalaxy/ansible-role-template" rel="nofollow ugc">https://github.com/scmgalaxy/ansible-role-template</a>.<br />
ansible localhost -m git -a&#8221;clone=true dest=/home/ubuntu/bert/repo repo=https://github.com/scmgalaxy/ansible-role-template&#8221;</p>
<p>Program 9 – Write a Ansible commands to reboot a self machine.<br />
ansible localhost -m reboot -a &#8220;msg=&#8217;Reboot triggered by Ansible'&#8221;</p>
<p>Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.<br />
ansible localhost -m file -a&#8221;path=&#8221;/opt/devopsschool.txt&#8221; state=touch&#8221;<br />
ansible localhost -m file -a&#8221;path=&#8221;/opt/devopsschool.txt&#8221; state=absent&#8221;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dirk Willemans		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-939</link>

		<dc:creator><![CDATA[Dirk Willemans]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 15:52:19 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-939</guid>

					<description><![CDATA[&lt;strong&gt;Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy&quot;&lt;/strong&gt;
ansible localhost -m group -a&quot;state=present name=deploy&quot;
&lt;strong&gt;Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.&lt;/strong&gt;
ansible localhost -m user -a&quot;state=present name=deploy-user group=deploy shell=/bin/bash&quot;
&lt;strong&gt;Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.&lt;/strong&gt;
ansible localhost -m yum -a&quot;state=present name=httpd&quot;
&lt;strong&gt;Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”&lt;/strong&gt;
ansible localhost -m service -a&quot;state=started enabled=true name=httpd&quot;
&lt;strong&gt;Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.&lt;/strong&gt;
ansible localhost -m copy -a&quot;dest=/var/www/html/index.html content=&#039;hello world&#039;&quot;
&lt;strong&gt;Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.&lt;/strong&gt;
ansible localhost -m copy -a&quot;src=second.html dest=/var/www/html/second.html&quot;
&lt;strong&gt;Program 7 – Write a Ansible commands to install a package called “git”, “wget”.&lt;/strong&gt;
ansible localhost -m yum -a&quot;state=present name=git,wget&quot;
&lt;strong&gt;Program 8 – Write a Ansible Adhoc commands to clone git repo. https://github.com/scmgalaxy/ansible-role-template.&lt;/strong&gt;
ansible localhost -m git -a&quot;repo=https://github.com/scmgalaxy/ansible-role-template dest=git/ansible-role-template&quot;
&lt;strong&gt;Program 9 – Write a Ansible commands to reboot a self machine.&lt;/strong&gt;
ansible localhost -m reboot
&lt;strong&gt;Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.&lt;/strong&gt;
ansible localhost -m file -a&#039;state=touch path=/opt/dw.testfile&#039;
ansible localhost -m file -a&#039;state=absent path=/opt/dw.testfile&#039;]]></description>
			<content:encoded><![CDATA[<p><strong>Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy&#8221;</strong><br />
ansible localhost -m group -a&#8221;state=present name=deploy&#8221;<br />
<strong>Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.</strong><br />
ansible localhost -m user -a&#8221;state=present name=deploy-user group=deploy shell=/bin/bash&#8221;<br />
<strong>Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.</strong><br />
ansible localhost -m yum -a&#8221;state=present name=httpd&#8221;<br />
<strong>Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”</strong><br />
ansible localhost -m service -a&#8221;state=started enabled=true name=httpd&#8221;<br />
<strong>Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.</strong><br />
ansible localhost -m copy -a&#8221;dest=/var/www/html/index.html content=&#8217;hello world'&#8221;<br />
<strong>Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.</strong><br />
ansible localhost -m copy -a&#8221;src=second.html dest=/var/www/html/second.html&#8221;<br />
<strong>Program 7 – Write a Ansible commands to install a package called “git”, “wget”.</strong><br />
ansible localhost -m yum -a&#8221;state=present name=git,wget&#8221;<br />
<strong>Program 8 – Write a Ansible Adhoc commands to clone git repo. <a href="https://github.com/scmgalaxy/ansible-role-template" rel="nofollow ugc">https://github.com/scmgalaxy/ansible-role-template</a>.</strong><br />
ansible localhost -m git -a&#8221;repo=https://github.com/scmgalaxy/ansible-role-template dest=git/ansible-role-template&#8221;<br />
<strong>Program 9 – Write a Ansible commands to reboot a self machine.</strong><br />
ansible localhost -m reboot<br />
<strong>Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.</strong><br />
ansible localhost -m file -a&#8217;state=touch path=/opt/dw.testfile&#8217;<br />
ansible localhost -m file -a&#8217;state=absent path=/opt/dw.testfile&#8217;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ville Kääriä		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-938</link>

		<dc:creator><![CDATA[Ville Kääriä]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 15:40:37 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-938</guid>

					<description><![CDATA[Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy
ansible localhost -b -m group -a &quot;name=deploy&quot;


Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.
ansible localhost -b -m user -a &quot;name=deploy-user group=deploy shell=/bin/bash&quot;


Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.
ansible localhost -b -m apt -a &quot;name=apache2&quot;


Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”
ansible localhost -b -m service -a &quot;name=apache2 state=started enabled=yes&quot;


Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.
ansible localhost -b -m copy -a &quot;dest=/var/www/html/index.html content=&#039;Dummy content&#039;&quot;


Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.
ansible localhost -b -m copy -a &quot;src=second.html dest=/var/www/html/second.html&quot;


Program 7 – Write a Ansible commands to install a package called “git”, “wget”.
ansible localhost -b -m apt -a &quot;name=git,wget&quot;


Program 8 – Write a Ansible Adhoc commands to clone git repo. https://github.com/scmgalaxy/ansible-role-template.
ansible localhost -b -m git&#160;-a &quot;repo=https://github.com/scmgalaxy/ansible-role-template dest=/tmp/ansible-role-template&quot;


Program 9 – Write a Ansible commands to reboot a self machine.
ansible localhost -b -m reboot


Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.
ansible localhost -b -m file -a &quot;state=touch path=/opt/devopsschool.txt&quot;
ansible localhost -b -m file -a &quot;state=absent path=/opt/devopsschool.txt&quot;]]></description>
			<content:encoded><![CDATA[<p>Program 1 – Write a Ansible Adhoc Commands to create a group called “deploy<br />
ansible localhost -b -m group -a &#8220;name=deploy&#8221;</p>
<p>Program 2 – Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.<br />
ansible localhost -b -m user -a &#8220;name=deploy-user group=deploy shell=/bin/bash&#8221;</p>
<p>Program 3 – Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos.<br />
ansible localhost -b -m apt -a &#8220;name=apache2&#8221;</p>
<p>Program 4 – Write a Ansible Adhoc commands to start and enable the service named “httpd”<br />
ansible localhost -b -m service -a &#8220;name=apache2 state=started enabled=yes&#8221;</p>
<p>Program 5 – Write a Ansible commands to create a file called “index.html” in /var/www/html with some dummy html contents.<br />
ansible localhost -b -m copy -a &#8220;dest=/var/www/html/index.html content=&#8217;Dummy content'&#8221;</p>
<p>Program 6 – Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.<br />
ansible localhost -b -m copy -a &#8220;src=second.html dest=/var/www/html/second.html&#8221;</p>
<p>Program 7 – Write a Ansible commands to install a package called “git”, “wget”.<br />
ansible localhost -b -m apt -a &#8220;name=git,wget&#8221;</p>
<p>Program 8 – Write a Ansible Adhoc commands to clone git repo. <a href="https://github.com/scmgalaxy/ansible-role-template" rel="nofollow ugc">https://github.com/scmgalaxy/ansible-role-template</a>.<br />
ansible localhost -b -m git&nbsp;-a &#8220;repo=https://github.com/scmgalaxy/ansible-role-template dest=/tmp/ansible-role-template&#8221;</p>
<p>Program 9 – Write a Ansible commands to reboot a self machine.<br />
ansible localhost -b -m reboot</p>
<p>Program 10 – Write a Ansible commands to touch a file called “devopsschool.txt” in /opt/ and delete after using ansible adhoc command.<br />
ansible localhost -b -m file -a &#8220;state=touch path=/opt/devopsschool.txt&#8221;<br />
ansible localhost -b -m file -a &#8220;state=absent path=/opt/devopsschool.txt&#8221;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Linus Shen		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-937</link>

		<dc:creator><![CDATA[Linus Shen]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 15:29:04 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-937</guid>

					<description><![CDATA[&lt;strong&gt;What is Ansible?&lt;/strong&gt;	A: A tool  to do automation  and manage your automation job
&lt;strong&gt;Why Ansible?&lt;/strong&gt;	A: Just a tool, maybe you can choose  argocd or jenkins 
&lt;strong&gt;Ansible Architecture?&lt;/strong&gt;	A: app with postgresql
&lt;strong&gt;What is module?&lt;/strong&gt;	A: you can coding  some functions to use , in ansible that call module
&lt;strong&gt;What is Plugins?&lt;/strong&gt;	A:   Plungins extend Ansible’s core functionality. Most plugin types execute on the control node within the&#160;/usr/bin/ansible]]></description>
			<content:encoded><![CDATA[<p><strong>What is Ansible?</strong>	A: A tool  to do automation  and manage your automation job<br />
<strong>Why Ansible?</strong>	A: Just a tool, maybe you can choose  argocd or jenkins<br />
<strong>Ansible Architecture?</strong>	A: app with postgresql<br />
<strong>What is module?</strong>	A: you can coding  some functions to use , in ansible that call module<br />
<strong>What is Plugins?</strong>	A:   Plungins extend Ansible’s core functionality. Most plugin types execute on the control node within the&nbsp;/usr/bin/ansible</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sammi		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-936</link>

		<dc:creator><![CDATA[Sammi]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 14:43:55 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-936</guid>

					<description><![CDATA[#What is Ansible?
It&#039;s config management tool, which we can use automate operations tasks.
Provided by redhat.

#Why Ansible?
Use one way to implement automation across different environment.
Easy to create, update, run, manage the automation script and verify result through web UI.

#Ansible Architecture?
Ansible consists of following components:
1. Control Node: Ansible platform control center. Containes all component files.
2. Inventory: Contains managed nodes settings. Ansible use SSH/WinRM tp communicated with nodes.
3. Playbook: Yaml files to define actions or commands of tasks.
4. Modules: Program or scripts which can be executed on specify nodes.
5. Plugins: To integrate with other systems.


#What is module?
It can be a program or script which can be executed on specify nodes to perform the tasks we need.

#What is Plugins?
Provide functions to integrate with other systems. such as email, logging, alert system.]]></description>
			<content:encoded><![CDATA[<p>#What is Ansible?<br />
It&#8217;s config management tool, which we can use automate operations tasks.<br />
Provided by redhat.</p>
<p>#Why Ansible?<br />
Use one way to implement automation across different environment.<br />
Easy to create, update, run, manage the automation script and verify result through web UI.</p>
<p>#Ansible Architecture?<br />
Ansible consists of following components:<br />
1. Control Node: Ansible platform control center. Containes all component files.<br />
2. Inventory: Contains managed nodes settings. Ansible use SSH/WinRM tp communicated with nodes.<br />
3. Playbook: Yaml files to define actions or commands of tasks.<br />
4. Modules: Program or scripts which can be executed on specify nodes.<br />
5. Plugins: To integrate with other systems.</p>
<p>#What is module?<br />
It can be a program or script which can be executed on specify nodes to perform the tasks we need.</p>
<p>#What is Plugins?<br />
Provide functions to integrate with other systems. such as email, logging, alert system.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel F Hernandez		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-935</link>

		<dc:creator><![CDATA[Daniel F Hernandez]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 14:36:37 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-935</guid>

					<description><![CDATA[&lt;strong&gt;# What is Ansible?&lt;/strong&gt;
Is a cross-platform automation tool.

&lt;strong&gt;# Why Ansible?&lt;/strong&gt;
You can reach multiple nodes with different platforms at once. Wherever they are on-premise enviroment or in cloud environment.&#160;And automate several tasks.

&lt;strong&gt;# Ansible Architecture?&lt;/strong&gt;
Users
Ansible Configuration Host
Ansible Remote Hosts

&lt;strong&gt;# What is module?&lt;/strong&gt;
Is a logical container for ansible playbooks

&lt;strong&gt;# What is Plugins?&lt;/strong&gt;
Are pieces of code that handles arguments or parameters for its functionality]]></description>
			<content:encoded><![CDATA[<p><strong># What is Ansible?</strong><br />
Is a cross-platform automation tool.</p>
<p><strong># Why Ansible?</strong><br />
You can reach multiple nodes with different platforms at once. Wherever they are on-premise enviroment or in cloud environment.&nbsp;And automate several tasks.</p>
<p><strong># Ansible Architecture?</strong><br />
Users<br />
Ansible Configuration Host<br />
Ansible Remote Hosts</p>
<p><strong># What is module?</strong><br />
Is a logical container for ansible playbooks</p>
<p><strong># What is Plugins?</strong><br />
Are pieces of code that handles arguments or parameters for its functionality</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vijay Pathania		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-934</link>

		<dc:creator><![CDATA[Vijay Pathania]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 14:33:26 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-934</guid>

					<description><![CDATA[What is Ansible?
Ansible is configuration management tool.
It provides automation for cross-platform.
Why Ansible?
It is agentless and its simplicity because&#160;the code can be written in yml which is easier for humans to read and understand than other difficult coding languages.
There are lots of modules in ansible which makes job easier.

Ansible Architecture?

We have Ansible controller node and we have server and we have nodes.
Modules
Plugins
Inventory
PLaybooks
Config file
What is module?
It is something which reside in ACS and runs on ARS.
It is a code which can control system resources or execute system commands.

What is Plugins?
It is something which reside in ACS and runs in ACS
It offers options and extensions for the core features of ansible like
transforming data, logging output, connecting to inventory etc.]]></description>
			<content:encoded><![CDATA[<p>What is Ansible?<br />
Ansible is configuration management tool.<br />
It provides automation for cross-platform.<br />
Why Ansible?<br />
It is agentless and its simplicity because&nbsp;the code can be written in yml which is easier for humans to read and understand than other difficult coding languages.<br />
There are lots of modules in ansible which makes job easier.</p>
<p>Ansible Architecture?</p>
<p>We have Ansible controller node and we have server and we have nodes.<br />
Modules<br />
Plugins<br />
Inventory<br />
PLaybooks<br />
Config file<br />
What is module?<br />
It is something which reside in ACS and runs on ARS.<br />
It is a code which can control system resources or execute system commands.</p>
<p>What is Plugins?<br />
It is something which reside in ACS and runs in ACS<br />
It offers options and extensions for the core features of ansible like<br />
transforming data, logging output, connecting to inventory etc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adam		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-933</link>

		<dc:creator><![CDATA[Adam]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 14:32:14 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-933</guid>

					<description><![CDATA[# What is Ansible?
Configuration management tool using idempotetnt configuration files / scripts in yaml where the desired status is defined.

# Why Ansible?
One of the major IT companies is behind it, RedHat, which helps it to be popular and improved.
Otherwise the playbooks have simple and easily readable syntax, you get lots of modules for popular OSes ( and other software ), but for example not for AIX.

# Ansible Architecture?
The engine runs on the controller node from which you push the playbook to the clients where its been interpreted by python.

# What is module?
Modules are small programs that implements a feature for example handling packages for package management. These are then interpreted on the clients into actions.

# What is Plugins?
Plugins are extenstions for the ansible engine which implements additional features, like the become plugin which helps privilege elevation.]]></description>
			<content:encoded><![CDATA[<p># What is Ansible?<br />
Configuration management tool using idempotetnt configuration files / scripts in yaml where the desired status is defined.</p>
<p># Why Ansible?<br />
One of the major IT companies is behind it, RedHat, which helps it to be popular and improved.<br />
Otherwise the playbooks have simple and easily readable syntax, you get lots of modules for popular OSes ( and other software ), but for example not for AIX.</p>
<p># Ansible Architecture?<br />
The engine runs on the controller node from which you push the playbook to the clients where its been interpreted by python.</p>
<p># What is module?<br />
Modules are small programs that implements a feature for example handling packages for package management. These are then interpreted on the clients into actions.</p>
<p># What is Plugins?<br />
Plugins are extenstions for the ansible engine which implements additional features, like the become plugin which helps privilege elevation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Arturo Alvarado Esparza		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-932</link>

		<dc:creator><![CDATA[Arturo Alvarado Esparza]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 14:28:43 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-932</guid>

					<description><![CDATA[What is Ansible?
Ansible is a configuration management tool that automates storage, servers and networking. Is an open source, command line IT automation software written in python

Why Ansible?
Because it helps for automation, configuration and management of IT infraestructure. It works in Windows and Linux SO. It was designed to increase automation accesibility to reduce repetitive task. It&#039;s easy to learn and self-documenting

Ansible Architecture?
Ansible follows a client-server arquitecture, where the server (ACS Ansible control server) communicates with multiple clients (ansible remote servers- managed nides) to execute task. Annsible control acts as the central point of control an can be installed on any Linux

What is module?
Ansible modules are units of code that can control system resources or execute system commands. Ansible works by connecting to servers and execute these modules. Modules accepts parameters.

What is Plugins?
Ansible are pieces of code that argument Ansibles core funcionality]]></description>
			<content:encoded><![CDATA[<p>What is Ansible?<br />
Ansible is a configuration management tool that automates storage, servers and networking. Is an open source, command line IT automation software written in python</p>
<p>Why Ansible?<br />
Because it helps for automation, configuration and management of IT infraestructure. It works in Windows and Linux SO. It was designed to increase automation accesibility to reduce repetitive task. It&#8217;s easy to learn and self-documenting</p>
<p>Ansible Architecture?<br />
Ansible follows a client-server arquitecture, where the server (ACS Ansible control server) communicates with multiple clients (ansible remote servers- managed nides) to execute task. Annsible control acts as the central point of control an can be installed on any Linux</p>
<p>What is module?<br />
Ansible modules are units of code that can control system resources or execute system commands. Ansible works by connecting to servers and execute these modules. Modules accepts parameters.</p>
<p>What is Plugins?<br />
Ansible are pieces of code that argument Ansibles core funcionality</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Francisco Jose Montoya		</title>
		<link>https://www.bestdevops.com/ansible-tutorials-and-notes-nov-2023/#comment-931</link>

		<dc:creator><![CDATA[Francisco Jose Montoya]]></dc:creator>
		<pubDate>Thu, 02 Nov 2023 14:28:35 +0000</pubDate>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=29527#comment-931</guid>

					<description><![CDATA[What is Ansible?

Ansible is a configuration tool that help us to manage multiple servers with different OS using a common lenguage and it&#039;s supported by a very large community

Why Ansible?
Because use a common &quot;programing&quot; lenguage to work with multiple servers, its idempotent so your changes will only be apply if the are something to be done, if not, it will not do anything
and with the community help there are more functionalities added for our benefit

Ansible Architecture?
Ansible uses a Control-remotes architecture, so you should only be writing you changes in one place and be distributed to the remotes using different lenguages according to their requirements.

What is module?

A module is a code write in the control server that runs in the remote servers and it&#039;s used to used to do some activities on the remote hosts

What is Plugins?
It&#039;s a code write in the control servers that runs in the same control server and help us to expand the Ansible capabilities]]></description>
			<content:encoded><![CDATA[<p>What is Ansible?</p>
<p>Ansible is a configuration tool that help us to manage multiple servers with different OS using a common lenguage and it&#8217;s supported by a very large community</p>
<p>Why Ansible?<br />
Because use a common &#8220;programing&#8221; lenguage to work with multiple servers, its idempotent so your changes will only be apply if the are something to be done, if not, it will not do anything<br />
and with the community help there are more functionalities added for our benefit</p>
<p>Ansible Architecture?<br />
Ansible uses a Control-remotes architecture, so you should only be writing you changes in one place and be distributed to the remotes using different lenguages according to their requirements.</p>
<p>What is module?</p>
<p>A module is a code write in the control server that runs in the remote servers and it&#8217;s used to used to do some activities on the remote hosts</p>
<p>What is Plugins?<br />
It&#8217;s a code write in the control servers that runs in the same control server and help us to expand the Ansible capabilities</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
