Ansible Ad-Hoc Commands || Ansible Modules || Ansible Ad-hoc Commands with Examples | ansible-doc -l

Описание к видео Ansible Ad-Hoc Commands || Ansible Modules || Ansible Ad-hoc Commands with Examples | ansible-doc -l

In this video we discussed about ansible ad-hoc commands
to list of all modules
ansible-doc -l
down arrow
ansible-doc -l | grep copy
ansible-doc copy

To list down all the ansible modules command
ansible-doc -l

To find specific module use the grep command
ansible-doc -l | grep copy

To view the document of specific module
ansible-doc copy

ansible target[0] -m ping -i inventory.txt
to check list of files
ansible target -a "ls -ltr" -i inventory.txt

to copy file command

ansible target -m copy -a "src=/home/ansadmin/devops.txt dest=/home/ansadmin"
ansible target -m fetch -a "src=/home/ansadmin/first.java dest=/etc/ansible/ flat=yes"
ansible target -m yum -a "name=httpd state=latest" --become

ansible target -m lineinfile -a "path='/etc/httpd/conf/httpd.conf' regexp='^Listen ' insertafter='^#Listen ' line='Listen 8080' state=present" --become

ansible target -m service -a "name=httpd enabled=yes state=started" --become

ansible target -m yum -a "name=httpd state=removed" --become

Комментарии

Информация по комментариям в разработке