community.general.shutdown module – Shut down a machine
Note
This module is part of the community.general collection (version 10.7.5).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.shutdown.
New in community.general 1.1.0
Synopsis
- Shut downs a machine. 
Note
This module has a corresponding action plugin.
Parameters
| Parameter | Comments | 
|---|---|
| Seconds to wait before shutdown. Passed as a parameter to the shutdown command. On Linux, macOS and OpenBSD, this is converted to minutes and rounded down. If less than 60, it is set to 0. On Solaris and FreeBSD, this represents seconds. Default:  | |
| Message to display to users before shutdown. Default:  | |
| Paths to search on the remote machine for the  Only these paths are searched for the  Default:  | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller. | |
| Support: full | Supports being used with the  | |
| Support: full | Can run in  | |
| Support: none | Will return details on what has changed (or possibly needs changing in  | 
Notes
Note
- PATHis ignored on the remote node when searching for the- shutdowncommand. Use- search_pathsto specify locations to search if the default paths do not work.
- The - msgand- delayoptions are not supported when a shutdown command is not found in- search_paths, instead the module attempts to shutdown the system by calling- systemctl shutdown.
See Also
See also
- ansible.builtin.reboot
- Reboot a machine. 
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 | Description | 
|---|---|
| 
 Returned: always Sample:  | 
