Ansible Q&A
1) How to create an empty file with Ansible? To create an empty file, Ansible uses a file module. For this, we need to set up two parameters. Path - This place represents the location where the file gets created, either the relative or an absolute path. Also, the name of the file includes here. State - For creating a new file, this parameter should be set to touch. 2) How will you set the environment variable or any path for a task or entire playbook? To set the environment variables, we use the environment keyword. We'll use it at the task or other levels in the play: environment: PATH: "{{ ansible_env.PATH }}:/thingy/bin" SOME: value 3) How do you access Shell Environment Variables? Accessing the value of Home environment variable on the management machine: local_home:”{{lookup(‘env’,’HOME’)}}” 4) Is it possible to increase the Ansible reboot module to more than 600 seconds? Yes, it is possible to increase the Ansible reboot module to specific values using the bel...