From 62766cf1fd721d278e95821e05e6b41f7888eed5 Mon Sep 17 00:00:00 2001 From: boom2 Date: Tue, 21 Nov 2023 14:11:56 -0500 Subject: initial commit --- ansible-practice/10-playbook-shutdown.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ansible-practice/10-playbook-shutdown.yml (limited to 'ansible-practice/10-playbook-shutdown.yml') 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 -- cgit v1.2.3-54-g00ecf