srivardan05 / https-ashwikatech.blogspot.com-

Aws and Devops interview prepartion
0 stars 0 forks source link

what are the different types of ansible modules? issue19 # vijay #19

Open srivardan05 opened 3 years ago

Naresh03N commented 3 years ago

Ping Module Ping is used when we want to check whether the connection with our hosts defined in the inventory file is established or not. ansible test-servers -m ping -u ec2-user

Setup Module The setup module is used when we want to see the information of all the hosts, their configuration, and detailed information. ansible test-servers -m setup -u ec2-user

Copy Module The copy module is often used in writing playbooks when we want to copy a file from a remote server to destination nodes. For example, suppose we want to copy a file from a remote server to all destination machines. ansible test-servers -m copy -a 'src=/home/knoldus/Personal/blogs/blog3.txt dest=/tmp' -u ec2-user

Yum Module We use the Yum module to install a service. ansible test-servers -m yum -a 'name=httpd state=present' -become -u ec2-user

Shell Module Service Module When we want to ensure the state of a service that is service is running we use the service module. ansible test-servers -m service -a 'name=httpd state=started' -become -u ec2-user

Debug Module Template Module