mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
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:
parent
bcecf2dcdc
commit
be2de15c66
39 changed files with 162 additions and 146 deletions
|
@ -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"
|
||||
'''
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue