Adjust booleans in system modules (#5153)

* Adjust booleans in system modules.

* Fix some IP addresses

Co-authored-by: Sandra McCann <samccann@redhat.com>

Co-authored-by: Sandra McCann <samccann@redhat.com>
This commit is contained in:
Felix Fontein 2022-08-24 19:59:01 +02:00 committed by GitHub
parent bcecf2dcdc
commit be2de15c66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 162 additions and 146 deletions

View file

@ -51,7 +51,7 @@ options:
effect prior to I(state=reset).
user:
required: false
default: 'no'
default: false
type: bool
description:
- Run system-control talking to the calling user's service manager, rather than
@ -64,10 +64,14 @@ notes:
EXAMPLES = '''
- name: Start dnscache if not running
community.general.nosh: name=dnscache state=started
community.general.nosh:
name: dnscache
state: started
- name: Stop mpd, if running
community.general.nosh: name=mpd state=stopped
community.general.nosh:
name: mpd
state: stopped
- name: Restart unbound or start it if not already running
community.general.nosh:
@ -80,26 +84,36 @@ EXAMPLES = '''
state: reloaded
- name: Disable nsd
community.general.nosh: name=nsd enabled=no
community.general.nosh:
name: nsd
enabled: false
- name: For package installers, set nginx running state according to local enable settings, preset and reset
community.general.nosh: name=nginx preset=True state=reset
community.general.nosh:
name: nginx
preset: true
state: reset
- name: Reboot the host if nosh is the system manager, would need a "wait_for*" task at least, not recommended as-is
community.general.nosh: name=reboot state=started
community.general.nosh:
name: reboot
state: started
- name: Using conditionals with the module facts
tasks:
- name: Obtain information on tinydns service
community.general.nosh: name=tinydns
community.general.nosh:
name: tinydns
register: result
- name: Fail if service not loaded
ansible.builtin.fail: msg="The {{ result.name }} service is not loaded"
ansible.builtin.fail:
msg: "The {{ result.name }} service is not loaded"
when: not result.status
- name: Fail if service is running
ansible.builtin.fail: msg="The {{ result.name }} service is running"
ansible.builtin.fail:
msg: "The {{ result.name }} service is running"
when: result.status and result.status['DaemontoolsEncoreState'] == "running"
'''