diff options
Diffstat (limited to 'ansible-practice/10-playbook-shutdown.yml')
| -rw-r--r-- | ansible-practice/10-playbook-shutdown.yml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ansible-practice/10-playbook-shutdown.yml b/ansible-practice/10-playbook-shutdown.yml new file mode 100644 index 0000000..198bc90 --- /dev/null +++ b/ansible-practice/10-playbook-shutdown.yml @@ -0,0 +1,17 @@ +# shutdown a host +# https://docs.ansible.com/ansible/latest/collections/community/general/shutdown_module.html +# +# had to run the command like so: +# +# ansible-playbook 10-playboot-shutdown.yml --ask-become-pass + +--- +- name: "10 - Playing with Ansible - shutdown a host" + hosts: all + tasks: + - name: shutdown a host + community.general.shutdown: + msg: "shutdown initiated by ansible" + delay: 5 + become: yes +...
\ No newline at end of file |
