ansible ad hoc file module 1

ansible ad hoc file module

ansible you_hosts -m file -a "path=/home/my_file.txt state=absent"

Here is what the above code is Doing:
1. ansible is the command to run ansible
2. you_hosts is the inventory file that contains the list of hosts to run the command on
3. -m file is the module to run
4. -a “path=/home/my_file.txt state=absent” is the arguments to pass to the module

Similar Posts