From f30709d7dbe88d82c4df66c476db36cb5c0ce903 Mon Sep 17 00:00:00 2001 From: boom2 Date: Thu, 14 Dec 2023 17:24:25 -0500 Subject: - add "new_host" role for system setup - no longer use "all" to mention all hosts in playbooks - update of hosts file to now use localhost as "test" --- ansible-practice/10-playbook-shutdown.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ansible-practice/10-playbook-shutdown.yml') diff --git a/ansible-practice/10-playbook-shutdown.yml b/ansible-practice/10-playbook-shutdown.yml index 5b568b3..1cf92b5 100644 --- a/ansible-practice/10-playbook-shutdown.yml +++ b/ansible-practice/10-playbook-shutdown.yml @@ -1,5 +1,7 @@ # shutdown a host # https://docs.ansible.com/ansible/latest/collections/community/general/shutdown_module.html +# https://docs.ansible.com/ansible/latest/plugins/become.html +# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html # # had to run the command like so: # @@ -12,10 +14,15 @@ # -or- # # ansible-playbook 10-playbook-shutdown.yml --become -K +# +# -or- +# +# ansible-playbook 10-playbook-shutdown.yml -b -K +# --- - name: "10 - Playing with Ansible - shutdown a host" - hosts: all + hosts: dev tasks: - name: shutdown a host community.general.shutdown: -- cgit v1.2.3-54-g00ecf