{"id":74297,"date":"2020-02-21T11:12:28","date_gmt":"2020-02-21T11:12:28","guid":{"rendered":"https:\/\/www.whizlabs.com\/blog\/?p=74297"},"modified":"2021-01-21T06:39:50","modified_gmt":"2021-01-21T06:39:50","slug":"maximize-your-ansible-skills","status":"publish","type":"post","link":"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/","title":{"rendered":"How-to&#8217;s to Maximize Your Ansible Skills?"},"content":{"rendered":"<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Automation is the buzzword of the existing business environment. Almost every business process gains simplification and assurance of improved ROI with automation. Therefore, the demands for open-source automation tools are increasing considerably. So, you could easily find a wide-ranging demand for <\/span><span class=\"s2\">ansible skills<\/span><span class=\"s1\">\u00a0in the present IT labor market. Why ansible? The most evident answer to this question clearly lies in the role of ansible as a <a href=\"https:\/\/www.whizlabs.com\/blog\/top-devops-tools\/\" target=\"_blank\" rel=\"noopener noreferrer\">DevOps tool<\/a>. If you want to\u00a0<\/span><span class=\"s2\">enhance ansible skills<\/span><span class=\"s1\">, then you must aspire for high-payout jobs.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The following discussion aims at presenting different recommendations on ways to improve your skills in ansible. The discussion would include insights regarding the importance of Ansible in the existing job market. However, the highlight aspect of this discussion refers to the practices for improving your A<\/span><span class=\"s2\">nsible skills<\/span><span class=\"s1\">. Note that to improve your Ansible skills, you need to understand its comparison with other DevOps tools such as <a href=\"https:\/\/www.whizlabs.com\/blog\/ansible-vs-terraform\/\" target=\"_blank\" rel=\"noopener\">Terraform vs Ansible<\/a>, <a href=\"https:\/\/www.whizlabs.com\/blog\/chef-vs-puppet-vs-ansible\/\" target=\"_blank\" rel=\"noopener\">Chef vs Puppet vs Ansible<\/a>, etc.<\/span><\/p>\n<p><a href=\"https:\/\/www.whizlabs.com\/ansible-basics\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-73314 size-full td-animation-stack-type0-2\" src=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2019\/10\/ansible_basics_video_course.png\" sizes=\"(max-width: 728px) 100vw, 728px\" srcset=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2019\/10\/ansible_basics_video_course.png 728w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2019\/10\/ansible_basics_video_course-300x37.png 300w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2019\/10\/ansible_basics_video_course-640x79.png 640w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2019\/10\/ansible_basics_video_course-681x84.png 681w\" alt=\"Ansible Basics Video Course\" width=\"728\" height=\"90\" \/><\/a><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The first concern that comes to the mind of IT professionals aspiring to\u00a0<\/span><span class=\"s2\">enhance ansible skills<\/span><span class=\"s1\">\u00a0is the necessity. DevOps roles are currently one of the high-paying jobs in the tech industry. DevOps job positions earn the highest salaries presently, and <a href=\"https:\/\/www.whizlabs.com\/blog\/ansible-introduction\/\" target=\"_blank\" rel=\"noopener noreferrer\">Ansible<\/a> is one of the DevOps skills in high demand.<\/span><\/p>\n<blockquote>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">As per <a href=\"https:\/\/www.ziprecruiter.com\/Salaries\/Ansible-Salary\" target=\"_blank\" rel=\"noopener noreferrer\">ZipRecruiter<\/a>, the average salary of an Ansible professional in United States is $124,581 USD.<\/span><\/p>\n<\/blockquote>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The staggering salary estimate may be sufficient reason to focus your attention on improving skills in Ansible.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">IT organizations need to improve their flexibility and collaboration with each other to ensure their survival. Ansible is an open-source tool or platform that helps in automation, configuration management, and IT orchestration. The major applications of <\/span><span class=\"s2\">ansible open-source<\/span><span class=\"s1\">\u00a0tools are evident in the configuration of servers and the installation of software. Ansible follows a one-to-many agentless mechanism in which all instructions run from a control machine. The control machine communicates with remote clients through the supported protocols, especially SSH.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s2\">Ansible skills<\/span><span class=\"s1\"> are important because of the wide range of functionalities Ansible provides. Ansible performs diverse tasks, thereby implying the variety of skills required for using Ansible. It can integrate effectively with core modules for managing system configuration, cloud resource creation, and network management. <\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">In addition, ansible also offers the flexibility for writing custom <a href=\"https:\/\/www.whizlabs.com\/blog\/ansible-modules\/\" target=\"_blank\" rel=\"noopener noreferrer\">modules for Ansible<\/a>, thereby improving its functionality. Users could also leverage Ansible for installation, customization, and running games. The ability of Ansible for provisioning, controlling, configuring, and deploying applications to multiple servers from a single machine is also another prominent reason to consider learning skills in Ansible.\u00a0<\/span><\/p>\n<blockquote><p>Also Read:\u00a0<a href=\"https:\/\/www.whizlabs.com\/blog\/how-ansible-works\/\" target=\"_blank\" rel=\"noopener noreferrer follow\" data-wpel-link=\"internal\">Ansible Tutorial \u2013 How Ansible Works<\/a>?<\/p><\/blockquote>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ea7e02;color:#ea7e02\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ea7e02;color:#ea7e02\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/#Components_of_Ansible\" >Components of Ansible<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/#How-to_Tasks_that_can_Enhance_Your_Ansible_Skills\" >How-to Tasks that can Enhance Your Ansible Skills<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/#1_How_to_use_Ansible_for_patching_systems_and_installing_applications\" >1. How to use Ansible for patching systems and installing applications?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/#2_How_to_use_Ansible_for_simplifying_repetitive_tasks\" >2. How to use Ansible for simplifying repetitive tasks?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/#3_How_to_manage_users_on_Ansible\" >3. How to manage users on Ansible?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/#4_How_to_install_packages_in_Ansible\" >4. How to install packages in Ansible<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.whizlabs.com\/blog\/maximize-your-ansible-skills\/#5_How_to_provision_a_virtual_machine\" >5. How to provision a virtual machine<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h3 class=\"p1\" style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Components_of_Ansible\"><\/span><span class=\"s1\">Components of Ansible<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Before we move further in the discussion on earning\u00a0<\/span><span class=\"s2\">top ansible skills<\/span><span class=\"s1\">, let us find out the components of Ansible. The notable components in Ansible are Tasks, Plays, Playbooks, Roles, and the Ansible Galaxy.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The task is the smallest unit of work in Ansible, such as installing a database or installing a server.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Plays are the collection of different tasks. For example, a play for preparing a database would involve different tasks like installing a database package, setting a password for database administration, and the creation of the database.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The Playbook is a collection of different plays. For example, the playbook for preparing a website with database backend would include the plays for setting up a database server and setting up the webserver.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Roles in Ansible are essential elements for saving and organizing playbooks alongside ensuring the sharing and reuse of playbooks.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Finally, the most important element in the structure of the\u00a0<\/span><span class=\"s2\">Ansible open-source<\/span><span class=\"s1\">\u00a0tool is Ansible Galaxy. Ansible Galaxy is the online repository for uploading roles and sharing them with others. Ansible Galaxy integrates effectively with GitHub for the reliable organization of roles into Git repositories and flexible sharing through Ansible Galaxy.\u00a0<\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Here is an image that depicts the relationship between all components in Ansible.<\/span><\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-74466 aligncenter\" src=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Ansible-components.png\" alt=\"Ansible components\" width=\"690\" height=\"208\" srcset=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Ansible-components.png 690w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Ansible-components-300x90.png 300w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Ansible-components-640x193.png 640w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Ansible-components-681x205.png 681w\" sizes=\"(max-width: 690px) 100vw, 690px\" \/><\/p>\n<h2 class=\"p2\"><span class=\"ez-toc-section\" id=\"How-to_Tasks_that_can_Enhance_Your_Ansible_Skills\"><\/span><span class=\"s1\">How-to Tasks that can E<\/span><span class=\"s2\">nhance Your Ansible Skills<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span class=\"s1\">Now, we know that Ansible has a lot to offer, and learning\u00a0<\/span><span class=\"s2\">Ansible skills<\/span><span class=\"s1\">\u00a0is a reasonable option for aspiring IT professionals. The facility of different courses to learn Ansible effectively can be the perfect option for candidates to improve their skills. However, you can grab expertise in\u00a0<\/span><span class=\"s2\">top ansible skills<\/span><span class=\"s1\"> only through practical experience. Understanding and practicing some of the real-world tasks with Ansible are proven approaches for learning the skills to use Ansible. So, let&#8217;s get ahead without any further due!<\/span><\/p>\n<h3 class=\"p1\" style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"1_How_to_use_Ansible_for_patching_systems_and_installing_applications\"><\/span><span class=\"s1\">1. How to use Ansible for patching systems and installing applications?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The first how-to for improving your ansible skills involves the process of using Ansible for patching systems and installing applications. Ansible runs packaging modules for patching systems. Ansible can help in installation, updates, or removal or installation from another location. Here is an example of an Ansible task for updating the system in the yum module.\u00a0<\/span><\/p>\n<pre class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">- name: update the system<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0yum:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0name: \"*\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0state: latest<\/span><\/pre>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The first line shows the task \u2018name\u2019, thereby ensuring certainty about what Ansible is trying to achieve. The use of practical how-to tasks to\u00a0<\/span><span class=\"s2\">enhance your Ansible skills<\/span><span class=\"s1\">\u00a0can help in learning about the intricacies of each process. The next line in the above example involves the \u2018yum module\u2019 updating the CentOS virtual machine. The name: \u201c*\u201d provides information to yum for updating everything. The final line \u2018state: latest\u2019 ensures updating back to the latest RPM.\u00a0<\/span><\/p>\n<h3 class=\"p1\" style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"2_How_to_use_Ansible_for_simplifying_repetitive_tasks\"><\/span><span class=\"s1\">2. How to use Ansible for simplifying repetitive tasks?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The next important how-to for improving your\u00a0<\/span><span class=\"s2\">Ansible skills<\/span><span class=\"s1\">\u00a0involves different methods for simplifying tasks using Ansible. Actually, this segment would cover the use of Ansible for automating repetitive tasks for users. The different tasks include the management of users, package installation, and provisioning a system.\u00a0<\/span><\/p>\n<blockquote><p>Ansible and Terraform are the two names that are prominent in the DevOps landscape now. Let&#8217;s understand the <a href=\"https:\/\/www.whizlabs.com\/blog\/ansible-vs-terraform\/\" target=\"_blank\" rel=\"noopener noreferrer\">Ansible vs Terraform<\/a> battle!<\/p><\/blockquote>\n<h3 class=\"p1\" style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"3_How_to_manage_users_on_Ansible\"><\/span><span class=\"s1\">3. How to manage users on Ansible?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">One of the basic\u00a0<\/span><span class=\"s2\">Ansible skills<\/span><span class=\"s1\">\u00a0is comprehensive knowledge of managing users on Ansible. Loops on Ansible are the best alternative when it comes to creating a large list of users and groups where the users are in different groups. You can create a group by following the example mentioned below.<\/span><\/p>\n<pre class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">- name: create user groups<\/span>\r\n\r\n<span class=\"s1\">\u00a0group:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0name: \"{{ item }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0loop:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- postgresql<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- nginx-test<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- admin<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- dbadmin<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- Hadoop<\/span><\/pre>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Then, you can\u00a0<\/span><span class=\"s2\">maximize your ansible skills<\/span><span class=\"s1\">\u00a0by creating users with specific parameters like in the following example.\u00a0<\/span><\/p>\n<pre class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">- name: all users in the department<\/span>\r\n\r\n<span class=\"s1\">\u00a0user:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0name: \"{{ item.name }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0group: \"{{ item.group }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0groups: \"{{ item.groups }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0uid: \"{{ item.uid }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0state: \"{{ item.state }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0loop:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- { name: 'admin1', group: 'admin', groups: 'nginx', uid: '1234', state: 'present' }<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- { name: 'dbadmin1', group: 'dbadmin', groups: 'postgres', uid: '4321', state: 'present' }<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- { name: 'user1', group: 'hadoop', groups: 'wheel', uid: '1067', state: 'present' }<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- { name: 'jose', group: 'admin', groups: 'wheel', uid: '9000', state: 'absent' }<\/span><\/pre>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Referring to the user \u2018jose\u2019, you can clearly find that the \u201cstate: \u2018absent\u2019\u201d implies deleting the account. So, why include all the parameters when you have to remove the user? The primary reason for the same is ensuring documentation of significant changes for the purpose of security compliance and audits. One of the important\u00a0<\/span><span class=\"s2\">Ansible skills<\/span><span class=\"s1\"> that you learn here is the ability for monitoring the history of changes. In addition, you can also gain the skill for the deployment of SSH keys for some users. A similar looping like in the previous example is applicable in this case too.<\/span><\/p>\n<pre class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">- name: copy admin1 and dbadmin ssh keys<\/span>\r\n\r\n<span class=\"s1\">\u00a0authorized_key:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0user: \"{{ item.user }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0key: \"{{ item.key }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0state: \"{{ item.state }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0comment: \"{{ item.comment }}\"<\/span>\r\n\r\n<span class=\"s1\">\u00a0loop:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- { user: 'admin1', key: \"{{ lookup('file', '\/data\/test_temp_key.pub'), state: 'present', comment: 'admin1 key' }<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0- { user: 'dbadmin', key: \"{{ lookup('file', '\/data\/vm_temp_key.pub'), state: 'absent', comment: 'dbadmin key' }<\/span><\/pre>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">In the case of this example, you can find the specification of \u2018user\u2019. In addition, the \u2018lookup\u2019 and \u2018state\u2019 provide insights into approaches for finding the key. Furthermore, the \u2018comment\u2019 attribute helps in defining the purpose of a key.\u00a0<\/span><\/p>\n<blockquote><p>Thinking to adopt Ansible as a configuration management tool? Let\u2019s understand the <a href=\"https:\/\/www.whizlabs.com\/blog\/ansible-advantages-and-disadvantages\/\" target=\"_blank\" rel=\"noopener noreferrer\">advantages and disadvantages of Ansible<\/a>.<\/p><\/blockquote>\n<h3 class=\"p1\" style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"4_How_to_install_packages_in_Ansible\"><\/span><span class=\"s1\">4. How to install packages in Ansible<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Package installation is also another notable task that can help you\u00a0<\/span><span class=\"s2\">maximize your ansible skills<\/span><span class=\"s1\">. Ansible Facts could help in finding out the ideal module for a specific task. The generic module known as \u2018package\u2019 on Ansible using \u2018ansible_pkg_mgr\u2019 calls the appropriate package manager for the system. For instance, if you use Fedora, then the package module will call the DNF package manager. Here is an example that shows the use of a package module.<\/span><\/p>\n<pre class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">- name: install a package<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0package:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0name: nginx<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0state: installed<\/span><\/pre>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The following example can show how a yum module installs NGINX, skips the broken packages, disables \u2018gpg_check\u2019 from the repo, and ignores the repository certificates.<\/span><\/p>\n<pre class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">- name: install a package<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0yum:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0name: nginx<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0state: installed<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0disable_gpg_check: yes<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0validate_certs: no<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0skip_broken: yes<\/span><\/pre>\n<blockquote><p>Here&#8217;s\u00a0<a href=\"https:\/\/www.whizlabs.com\/blog\/how-to-install-ansible\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Install and Configure Ansible<\/a>?<\/p><\/blockquote>\n<h3 class=\"p1\" style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"5_How_to_provision_a_virtual_machine\"><\/span><span class=\"s1\">5. How to provision a virtual machine<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Provisioning a system using Ansible with the OpenStack cloud solution is another important how-to for improving your\u00a0<\/span><span class=\"s2\">Ansible skills<\/span><span class=\"s1\">. Here is an example of provisioning a virtual machine (VM).<\/span><\/p>\n<pre class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">- name: create a VM in openstack<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0osp_server:<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0name: cloudera-namenode<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0state: present<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0cloud: openstack<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0region_name: andromeda<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0image: 923569a-c777-4g52-t3y9-cxvhl86zx345<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0flavor_ram: 20146<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0flavor: big<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0auto_ip: yes<\/span>\r\n\r\n<span class=\"s1\">\u00a0 \u00a0 \u00a0volumes: cloudera-namenode<\/span><\/pre>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">The above configuration leverages the osp-server module that helps in adding or removing an instance. The osp-server module contains information such as the name of the VM, cloud options, its state, and authentication to the API. You can delete the virtual machine by changing the \u201cstate:\u201d to \u2018absent.\u2019\u00a0<\/span><\/p>\n<blockquote><p>Preparing for an Ansible interview? Go through these <a href=\"https:\/\/www.whizlabs.com\/blog\/ansible-interview-questions\/\" target=\"_blank\" rel=\"noopener noreferrer follow\" data-wpel-link=\"internal\">top Ansible interview questions<\/a> and get ready to crack the Ansible interview.<\/p><\/blockquote>\n<h4 class=\"p1\" style=\"text-align: justify;\"><span class=\"s1\">Final Words<\/span><\/h4>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">On a concluding note, you can find that learning Ansible is easier through how-to tasks. The best thing about how-to tasks is that they offer insights into the recommended approaches for using Ansible for specific purposes. The increasing dominance of DevOps and the popularity of Ansible as a DevOps tool strengthen the motivations to pursue\u00a0<\/span><span class=\"s2\">Ansible skills<\/span><span class=\"s1\">. <\/span><\/p>\n<p class=\"p2\" style=\"text-align: justify;\"><span class=\"s1\">Apart from these information materials, you can also opt for online training courses. We at Whizlabs offer <a href=\"https:\/\/www.whizlabs.com\/ansible-basics\/\" target=\"_blank\" rel=\"noopener noreferrer\">Ansible Basics online course<\/a> for aspiring IT professionals. You need to brush up your basic knowledge of Ansible with hands-on tasks. Whizlabs offers promising guidance and support for all its learners. So, you should start your Ansible learning journey right away!\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automation is the buzzword of the existing business environment. Almost every business process gains simplification and assurance of improved ROI with automation. Therefore, the demands for open-source automation tools are increasing considerably. So, you could easily find a wide-ranging demand for ansible skills\u00a0in the present IT labor market. Why ansible? The most evident answer to this question clearly lies in the role of ansible as a DevOps tool. If you want to\u00a0enhance ansible skills, then you must aspire for high-payout jobs.\u00a0 The following discussion aims at presenting different recommendations on ways to improve your skills in ansible. The discussion would [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":74460,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1862],"tags":[3026,3024,3028,3027,3025],"class_list":["post-74297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-ansible-open-source","tag-enhance-ansible-skills","tag-enhance-your-ansible-skills","tag-maximize-your-ansible-skills","tag-top-ansible-skills"],"uagb_featured_image_src":{"full":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",600,315,false],"thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills-150x150.png",150,150,true],"medium":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills-300x158.png",300,158,true],"medium_large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",600,315,false],"large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",600,315,false],"1536x1536":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",600,315,false],"2048x2048":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",600,315,false],"profile_24":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",24,13,false],"profile_48":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",48,25,false],"profile_96":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",96,50,false],"profile_150":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",150,79,false],"profile_300":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",300,158,false],"tptn_thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills-250x250.png",250,250,true],"web-stories-poster-portrait":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",600,315,false],"web-stories-publisher-logo":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",96,50,false],"web-stories-thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/01\/Enhance_Your_Ansible_Skills.png",150,79,false]},"uagb_author_info":{"display_name":"Dharmalingam N","author_link":"https:\/\/www.whizlabs.com\/blog\/author\/dharmalingam\/"},"uagb_comment_info":0,"uagb_excerpt":"Automation is the buzzword of the existing business environment. Almost every business process gains simplification and assurance of improved ROI with automation. Therefore, the demands for open-source automation tools are increasing considerably. So, you could easily find a wide-ranging demand for ansible skills\u00a0in the present IT labor market. Why ansible? The most evident answer to&hellip;","_links":{"self":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/74297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/comments?post=74297"}],"version-history":[{"count":11,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/74297\/revisions"}],"predecessor-version":[{"id":77093,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/74297\/revisions\/77093"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media\/74460"}],"wp:attachment":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media?parent=74297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/categories?post=74297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/tags?post=74297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}