summaryrefslogtreecommitdiff
path: root/ansible-practice/10-playbook-shutdown.yml
diff options
context:
space:
mode:
authorboom2 <blizzack@blizzack.com>2023-11-21 14:11:56 -0500
committerboom2 <blizzack@blizzack.com>2023-11-21 14:11:56 -0500
commit62766cf1fd721d278e95821e05e6b41f7888eed5 (patch)
tree35c0866b9dbc09cdc695435a3aa6aa1424cac1a4 /ansible-practice/10-playbook-shutdown.yml
initial commit
Diffstat (limited to 'ansible-practice/10-playbook-shutdown.yml')
-rw-r--r--ansible-practice/10-playbook-shutdown.yml17
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