community.general.shutdown – Shut down a machine¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.shutdown
.
New in version 1.1.0: of community.general
Parameters¶
Notes¶
Note
PATH
is ignored on the remote node when searching for theshutdown
command. Use search_paths to specify locations to search if the default paths do not work.
See Also¶
See also
- ansible.builtin.reboot
The official documentation on the ansible.builtin.reboot module.
Examples¶
- name: Unconditionally shut down the machine with all defaults
community.general.shutdown:
- name: Delay shutting down the remote node
community.general.shutdown:
delay: 60
- name: Shut down a machine with shutdown command in unusual place
community.general.shutdown:
search_paths:
- '/lib/molly-guard'
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
shutdown
boolean
|
always |
true if the machine has been shut down.Sample:
True
|
Authors¶
Matt Davis (@nitzmahone)
Sam Doran (@samdoran)
Amin Vakil (@aminvakil)