AdHoc command allows execute a single Ansible task in a programmatic and simple way. This lesson dives in this Ansible feature.
In order to understand this lesson properly, a set of steps have been designed to be implemented in the following section.
ENJOY !!!
- Execute different Ansible Ad-Hoc Commands in order to achieve the following objectives:
- Print "It is working" message on localhost
- Print instance settings on localhost
- Create a new user "yourname" on localhost using become (root)
- Include the new user "yourname" on wheel group on localhost using become (root)
- Copy sudo file /etc/passwd on localhost using become "yourname" and setting permissions 440 and owner root in /tmp/newfile
For more information, please visit:
- https://docs.ansible.com/ansible/latest/cli/ansible.html
- https://docs.ansible.com/ansible/latest/modules/modules_by_category.html
BSD
Asier Cidon - Cloud Consultant