mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
freebsd: shutdown -p ... on freebsd to power off machine (#7102)
* freebsd: shutdown -p ... on freebsd to power off machine * Use shutdown -p ... on FreeBSD such that the machine is halted and powered off (-p) otherwise the machine is halted (-h) but remains on. * Update changelogs/fragments/7102-freebsd-shutdown-p.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
bf728aadfb
commit
55cfd27be9
3 changed files with 5 additions and 3 deletions
2
changelogs/fragments/7102-freebsd-shutdown-p.yml
Normal file
2
changelogs/fragments/7102-freebsd-shutdown-p.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- shutdown - use ``shutdown -p ...`` with FreeBSD to halt and power off machine (https://github.com/ansible-collections/community.general/pull/7102).
|
|
@ -45,7 +45,7 @@ class ActionModule(ActionBase):
|
|||
SHUTDOWN_COMMAND_ARGS = {
|
||||
'alpine': '',
|
||||
'void': '-h +{delay_min} "{message}"',
|
||||
'freebsd': '-h +{delay_sec}s "{message}"',
|
||||
'freebsd': '-p +{delay_sec}s "{message}"',
|
||||
'linux': DEFAULT_SHUTDOWN_COMMAND_ARGS,
|
||||
'macosx': '-h +{delay_min} "{message}"',
|
||||
'openbsd': '-h +{delay_min} "{message}"',
|
||||
|
|
|
@ -77,8 +77,8 @@
|
|||
- name: Verify shutdown delay is present in seconds in FreeBSD
|
||||
assert:
|
||||
that:
|
||||
- '"-h +100s" in shutdown_result["shutdown_command"]'
|
||||
- '"-h +0s" in shutdown_result_minus["shutdown_command"]'
|
||||
- '"-p +100s" in shutdown_result["shutdown_command"]'
|
||||
- '"-p +0s" in shutdown_result_minus["shutdown_command"]'
|
||||
when: ansible_system == 'FreeBSD'
|
||||
|
||||
- name: Verify shutdown delay is present in seconds in Solaris, SunOS
|
||||
|
|
Loading…
Reference in a new issue