1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Adjust booleans in system modules (#5153) (#5178)

* 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>
(cherry picked from commit be2de15c66)
This commit is contained in:
Felix Fontein 2022-08-24 20:46:48 +02:00 committed by GitHub
parent 1b2fbd72de
commit 5657889b28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 162 additions and 146 deletions

View file

@ -30,12 +30,12 @@ options:
description: description:
- Forces action. - Forces action.
type: bool type: bool
default: no default: false
recursive: recursive:
description: description:
- Removes or defines a device and children devices. - Removes or defines a device and children devices.
type: bool type: bool
default: no default: false
state: state:
description: description:
- Controls the device state. - Controls the device state.
@ -87,13 +87,13 @@ EXAMPLES = r'''
- name: Put vscsi1 and children devices in Defined state. - name: Put vscsi1 and children devices in Defined state.
community.general.aix_devices: community.general.aix_devices:
device: vscsi1 device: vscsi1
recursive: yes recursive: true
state: defined state: defined
- name: Removes vscsi1 and children devices. - name: Removes vscsi1 and children devices.
community.general.aix_devices: community.general.aix_devices:
device: vscsi1 device: vscsi1
recursive: yes recursive: true
state: removed state: removed
- name: Changes en1 mtu to 9000 and disables arp. - name: Changes en1 mtu to 9000 and disables arp.

View file

@ -24,18 +24,20 @@ options:
description: description:
- Specifies whether the file system is to be processed by the accounting subsystem. - Specifies whether the file system is to be processed by the accounting subsystem.
type: bool type: bool
default: no default: false
attributes: attributes:
description: description:
- Specifies attributes for files system separated by comma. - Specifies attributes for files system separated by comma.
type: list type: list
elements: str elements: str
default: agblksize='4096',isnapshot='no' default:
- agblksize='4096'
- isnapshot='no'
auto_mount: auto_mount:
description: description:
- File system is automatically mounted at system restart. - File system is automatically mounted at system restart.
type: bool type: bool
default: yes default: true
device: device:
description: description:
- Logical volume (LV) device name or remote export device to create a NFS file system. - Logical volume (LV) device name or remote export device to create a NFS file system.
@ -70,7 +72,7 @@ options:
description: description:
- Removes the mount point directory when used with state C(absent). - Removes the mount point directory when used with state C(absent).
type: bool type: bool
default: no default: false
size: size:
description: description:
- Specifies the file system size. - Specifies the file system size.
@ -149,13 +151,13 @@ EXAMPLES = r'''
- name: Remove NFS filesystem /home/ftp. - name: Remove NFS filesystem /home/ftp.
community.general.aix_filesystem: community.general.aix_filesystem:
filesystem: /home/ftp filesystem: /home/ftp
rm_mount_point: yes rm_mount_point: true
state: absent state: absent
- name: Remove /newfs. - name: Remove /newfs.
community.general.aix_filesystem: community.general.aix_filesystem:
filesystem: /newfs filesystem: /newfs
rm_mount_point: yes rm_mount_point: true
state: absent state: absent
''' '''

View file

@ -21,13 +21,13 @@ options:
description: description:
- Name of the inittab entry. - Name of the inittab entry.
type: str type: str
required: yes required: true
aliases: [ service ] aliases: [ service ]
runlevel: runlevel:
description: description:
- Runlevel of the entry. - Runlevel of the entry.
type: str type: str
required: yes required: true
action: action:
description: description:
- Action what the init has to do with this entry. - Action what the init has to do with this entry.
@ -49,7 +49,7 @@ options:
description: description:
- What command has to run. - What command has to run.
type: str type: str
required: yes required: true
insertafter: insertafter:
description: description:
- After which inittabline should the new entry inserted. - After which inittabline should the new entry inserted.
@ -78,7 +78,7 @@ EXAMPLES = '''
command: echo hello command: echo hello
insertafter: existingservice insertafter: existingservice
state: present state: present
become: yes become: true
# Change inittab entry startmyservice to runlevel "2" and processaction "wait". # Change inittab entry startmyservice to runlevel "2" and processaction "wait".
- name: Change startmyservice to inittab - name: Change startmyservice to inittab
@ -88,7 +88,7 @@ EXAMPLES = '''
action: wait action: wait
command: echo hello command: echo hello
state: present state: present
become: yes become: true
- name: Remove startmyservice from inittab - name: Remove startmyservice from inittab
community.general.aix_inittab: community.general.aix_inittab:
@ -97,7 +97,7 @@ EXAMPLES = '''
action: wait action: wait
command: echo hello command: echo hello
state: absent state: absent
become: yes become: true
''' '''
RETURN = ''' RETURN = '''

View file

@ -21,7 +21,7 @@ options:
description: description:
- Force volume group creation. - Force volume group creation.
type: bool type: bool
default: no default: false
pp_size: pp_size:
description: description:
- The size of the physical partition in megabytes. - The size of the physical partition in megabytes.

View file

@ -35,7 +35,7 @@ options:
- Activate the new firewall rules. - Activate the new firewall rules.
- Can be run with other steps or on its own. - Can be run with other steps or on its own.
type: bool type: bool
default: no default: false
''' '''
EXAMPLES = r''' EXAMPLES = r'''
@ -50,11 +50,11 @@ EXAMPLES = r'''
- foo - foo
- bar - bar
state: disabled state: disabled
activate: no activate: false
- name: Activate currently enabled firewall rules - name: Activate currently enabled firewall rules
community.general.awall: community.general.awall:
activate: yes activate: true
''' '''
RETURN = ''' # ''' RETURN = ''' # '''

View file

@ -19,13 +19,13 @@ options:
description: description:
- Specifies the path to the file to be managed. - Specifies the path to the file to be managed.
type: str type: str
required: yes required: true
aliases: [ key ] aliases: [ key ]
capability: capability:
description: description:
- Desired capability to set (with operator and flags, if state is C(present)) or remove (if state is C(absent)) - Desired capability to set (with operator and flags, if state is C(present)) or remove (if state is C(absent))
type: str type: str
required: yes required: true
aliases: [ cap ] aliases: [ cap ]
state: state:
description: description:

View file

@ -29,7 +29,7 @@ options:
description: description:
- Name of the crontab variable. - Name of the crontab variable.
type: str type: str
required: yes required: true
value: value:
description: description:
- The value to set this variable to. - The value to set this variable to.
@ -67,7 +67,7 @@ options:
- If set, create a backup of the crontab before it is modified. - If set, create a backup of the crontab before it is modified.
The location of the backup is returned in the C(backup) variable by this module. The location of the backup is returned in the C(backup) variable by this module.
type: bool type: bool
default: no default: false
requirements: requirements:
- cron - cron
author: author:

View file

@ -21,7 +21,7 @@ options:
optionally prefixed with C(/dev/mapper/), as it appears in the filesystem. I(/dev/mapper/) optionally prefixed with C(/dev/mapper/), as it appears in the filesystem. I(/dev/mapper/)
will be stripped from I(name). will be stripped from I(name).
type: str type: str
required: yes required: true
state: state:
description: description:
- Use I(present) to add a line to C(/etc/crypttab) or update its definition - Use I(present) to add a line to C(/etc/crypttab) or update its definition
@ -31,7 +31,7 @@ options:
different values will be updated. different values will be updated.
- Use I(opts_absent) to remove options from the existing set. - Use I(opts_absent) to remove options from the existing set.
type: str type: str
required: yes required: true
choices: [ absent, opts_absent, opts_present, present ] choices: [ absent, opts_absent, opts_present, present ]
backing_device: backing_device:
description: description:

View file

@ -70,7 +70,7 @@ options:
exists (this lock being a dpkg-divert feature, and bypassing it being exists (this lock being a dpkg-divert feature, and bypassing it being
a module feature). a module feature).
type: bool type: bool
default: no default: false
force: force:
description: description:
- When I(rename=true) and I(force=true), renaming is performed even if - When I(rename=true) and I(force=true), renaming is performed even if
@ -78,7 +78,7 @@ options:
file at this location will be lost. file at this location will be lost.
- This parameter is ignored when I(rename=false). - This parameter is ignored when I(rename=false).
type: bool type: bool
default: no default: false
notes: notes:
- This module supports I(check_mode) and I(diff). - This module supports I(check_mode) and I(diff).
requirements: requirements:
@ -99,14 +99,14 @@ EXAMPLES = r'''
community.general.dpkg_divert: community.general.dpkg_divert:
path: /usr/bin/busybox path: /usr/bin/busybox
divert: /usr/bin/busybox.dpkg-divert divert: /usr/bin/busybox.dpkg-divert
rename: yes rename: true
- name: Remove the busybox diversion and move the diverted file back - name: Remove the busybox diversion and move the diverted file back
community.general.dpkg_divert: community.general.dpkg_divert:
path: /usr/bin/busybox path: /usr/bin/busybox
state: absent state: absent
rename: yes rename: true
force: yes force: true
''' '''
RETURN = r''' RETURN = r'''

View file

@ -50,16 +50,16 @@ options:
a regular file as their target I(dev). a regular file as their target I(dev).
- Support for character devices on FreeBSD has been added in community.general 3.4.0. - Support for character devices on FreeBSD has been added in community.general 3.4.0.
type: path type: path
required: yes required: true
aliases: [device] aliases: [device]
force: force:
description: description:
- If C(yes), allows to create new filesystem on devices that already has filesystem. - If C(true), allows to create new filesystem on devices that already has filesystem.
type: bool type: bool
default: 'no' default: false
resizefs: resizefs:
description: description:
- If C(yes), if the block device and filesystem size differ, grow the filesystem into the space. - If C(true), if the block device and filesystem size differ, grow the filesystem into the space.
- Supported for C(btrfs), C(ext2), C(ext3), C(ext4), C(ext4dev), C(f2fs), C(lvm), C(xfs), C(ufs) and C(vfat) filesystems. - Supported for C(btrfs), C(ext2), C(ext3), C(ext4), C(ext4dev), C(f2fs), C(lvm), C(xfs), C(ufs) and C(vfat) filesystems.
Attempts to resize other filesystem types will fail. Attempts to resize other filesystem types will fail.
- XFS Will only grow if mounted. Currently, the module is based on commands - XFS Will only grow if mounted. Currently, the module is based on commands
@ -67,7 +67,7 @@ options:
not supported on FreeBSD systems. not supported on FreeBSD systems.
- vFAT will likely fail if fatresize < 1.04. - vFAT will likely fail if fatresize < 1.04.
type: bool type: bool
default: 'no' default: false
opts: opts:
description: description:
- List of options to be passed to mkfs command. - List of options to be passed to mkfs command.
@ -82,7 +82,7 @@ notes:
- Potential filesystems on I(dev) are checked using C(blkid). In case C(blkid) - Potential filesystems on I(dev) are checked using C(blkid). In case C(blkid)
is unable to detect a filesystem (and in case C(fstyp) on FreeBSD is also is unable to detect a filesystem (and in case C(fstyp) on FreeBSD is also
unable to detect a filesystem), this filesystem is overwritten even if unable to detect a filesystem), this filesystem is overwritten even if
I(force) is C(no). I(force) is C(false).
- On FreeBSD systems, both C(e2fsprogs) and C(util-linux) packages provide - On FreeBSD systems, both C(e2fsprogs) and C(util-linux) packages provide
a C(blkid) command that is compatible with this module. However, these a C(blkid) command that is compatible with this module. However, these
packages conflict with each other, and only the C(util-linux) package packages conflict with each other, and only the C(util-linux) package
@ -581,7 +581,7 @@ def main():
module.exit_json(changed=True, msg=out) module.exit_json(changed=True, msg=out)
elif fs and not force: elif fs and not force:
module.fail_json(msg="'%s' is already used as %s, use force=yes to overwrite" % (dev, fs), rc=rc, err=err) module.fail_json(msg="'%s' is already used as %s, use force=true to overwrite" % (dev, fs), rc=rc, err=err)
# create fs # create fs
filesystem.create(mkfs_opts, dev) filesystem.create(mkfs_opts, dev)

View file

@ -23,7 +23,7 @@ options:
description: description:
- A GConf preference key is an element in the GConf repository - A GConf preference key is an element in the GConf repository
that corresponds to an application preference. See man gconftool-2(1) that corresponds to an application preference. See man gconftool-2(1)
required: yes required: true
value: value:
type: str type: str
description: description:
@ -39,7 +39,7 @@ options:
type: str type: str
description: description:
- The action to take upon the key/value. - The action to take upon the key/value.
required: yes required: true
choices: [ absent, get, present ] choices: [ absent, get, present ]
config_source: config_source:
type: str type: str
@ -52,7 +52,7 @@ options:
specified then the config_source must be specified as well. specified then the config_source must be specified as well.
See man gconftool-2(1) See man gconftool-2(1)
type: bool type: bool
default: 'no' default: false
''' '''
EXAMPLES = """ EXAMPLES = """
@ -187,11 +187,11 @@ def main():
% str(state)) % str(state))
if direct and config_source is None: if direct and config_source is None:
module.fail_json(msg='If "direct" is "yes" then the ' + module.fail_json(msg='If "direct" is "true" then the ' +
'"config_source" must be specified') '"config_source" must be specified')
elif not direct and config_source is not None: elif not direct and config_source is not None:
module.fail_json(msg='If the "config_source" is specified ' + module.fail_json(msg='If the "config_source" is specified ' +
'then "direct" must be "yes"') 'then "direct" must be "true"')
# Create a gconf2 preference # Create a gconf2 preference
gconf_pref = GConf2Preference(module, key, value_type, gconf_pref = GConf2Preference(module, key, value_type,

View file

@ -196,7 +196,7 @@ EXAMPLES = '''
password: myreallysecurepassword1! password: myreallysecurepassword1!
state: present state: present
disksize: 10G disksize: 10G
resize: yes resize: true
- name: Remove an existing user 'janet' - name: Remove an existing user 'janet'
community.general.homectl: community.general.homectl:

View file

@ -48,7 +48,7 @@ options:
- Create a backup file including the timestamp information so you can get - Create a backup file including the timestamp information so you can get
the original file back if you somehow clobbered it incorrectly. the original file back if you somehow clobbered it incorrectly.
type: bool type: bool
default: 'no' default: false
state: state:
type: str type: str
description: description:
@ -136,7 +136,7 @@ EXAMPLES = '''
iface: eth1 iface: eth1
option: mtu option: mtu
value: 8000 value: 8000
backup: yes backup: true
state: present state: present
register: eth1_cfg register: eth1_cfg
''' '''

View file

@ -71,14 +71,14 @@ options:
- The file the iptables state should be saved to. - The file the iptables state should be saved to.
- The file the iptables state should be restored from. - The file the iptables state should be restored from.
type: path type: path
required: yes required: true
state: state:
description: description:
- Whether the firewall state should be saved (into a file) or restored - Whether the firewall state should be saved (into a file) or restored
(from a file). (from a file).
type: str type: str
choices: [ saved, restored ] choices: [ saved, restored ]
required: yes required: true
table: table:
description: description:
- When I(state=restored), restore only the named table even if the input - When I(state=restored), restore only the named table even if the input
@ -133,7 +133,7 @@ EXAMPLES = r'''
community.general.iptables_state: community.general.iptables_state:
state: saved state: saved
path: /tmp/iptables path: /tmp/iptables
check_mode: yes check_mode: true
changed_when: false changed_when: false
register: iptables_state register: iptables_state

View file

@ -119,7 +119,7 @@ EXAMPLES = r'''
cert_path: /opt/certs/rootca.crt cert_path: /opt/certs/rootca.crt
keystore_path: /tmp/cacerts keystore_path: /tmp/cacerts
keystore_pass: changeit keystore_pass: changeit
keystore_create: yes keystore_create: true
state: present state: present
cert_alias: LE_RootCA cert_alias: LE_RootCA
trust_cacert: True trust_cacert: True
@ -129,7 +129,7 @@ EXAMPLES = r'''
cert_url: google.com cert_url: google.com
keystore_path: /tmp/cacerts keystore_path: /tmp/cacerts
keystore_pass: changeit keystore_pass: changeit
keystore_create: yes keystore_create: true
state: present state: present
- name: Import a pkcs12 keystore with a specified alias, create it if it doesn't exist - name: Import a pkcs12 keystore with a specified alias, create it if it doesn't exist
@ -138,7 +138,7 @@ EXAMPLES = r'''
cert_alias: default cert_alias: default
keystore_path: /opt/wildfly/standalone/configuration/defaultkeystore.jks keystore_path: /opt/wildfly/standalone/configuration/defaultkeystore.jks
keystore_pass: changeit keystore_pass: changeit
keystore_create: yes keystore_create: true
state: present state: present
- name: Import SSL certificate to JCEKS keystore - name: Import SSL certificate to JCEKS keystore
@ -150,7 +150,7 @@ EXAMPLES = r'''
keystore_path: /opt/someapp/security/keystore.jceks keystore_path: /opt/someapp/security/keystore.jceks
keystore_type: "JCEKS" keystore_type: "JCEKS"
keystore_pass: changeit keystore_pass: changeit
keystore_create: yes keystore_create: true
state: present state: present
''' '''

View file

@ -76,7 +76,7 @@ options:
description: description:
- Keystore is created even if it already exists. - Keystore is created even if it already exists.
type: bool type: bool
default: 'no' default: false
owner: owner:
description: description:
- Name of the user that should own jks file. - Name of the user that should own jks file.

View file

@ -47,9 +47,9 @@ options:
- Whether the service should not be restarted automatically by launchd. - Whether the service should not be restarted automatically by launchd.
- Services might have the 'KeepAlive' attribute set to true in a launchd configuration. - Services might have the 'KeepAlive' attribute set to true in a launchd configuration.
In case this is set to true, stopping a service will cause that launchd starts the service again. In case this is set to true, stopping a service will cause that launchd starts the service again.
- Set this option to C(yes) to let this module change the 'KeepAlive' attribute to false. - Set this option to C(true) to let this module change the 'KeepAlive' attribute to false.
type: bool type: bool
default: no default: false
notes: notes:
- A user must privileged to manage services using this module. - A user must privileged to manage services using this module.
requirements: requirements:
@ -82,7 +82,7 @@ EXAMPLES = r'''
community.general.launchd: community.general.launchd:
name: org.memcached name: org.memcached
state: stopped state: stopped
force_stop: yes force_stop: true
- name: Restart memcached - name: Restart memcached
community.general.launchd: community.general.launchd:

View file

@ -71,7 +71,7 @@ EXAMPLES = r'''
- name: Gather facts on all ports and override which command to use - name: Gather facts on all ports and override which command to use
community.general.listen_ports_facts: community.general.listen_ports_facts:
command: 'netstat' command: 'netstat'
include_non_listening: 'yes' include_non_listening: true
''' '''
RETURN = r''' RETURN = r'''

View file

@ -44,7 +44,7 @@ options:
type: str type: str
pvresize: pvresize:
description: description:
- If C(yes), resize the physical volume to the maximum available size. - If C(true), resize the physical volume to the maximum available size.
type: bool type: bool
default: false default: false
version_added: '0.2.0' version_added: '0.2.0'
@ -60,9 +60,9 @@ options:
default: present default: present
force: force:
description: description:
- If C(yes), allows to remove volume group with logical volumes. - If C(true), allows to remove volume group with logical volumes.
type: bool type: bool
default: no default: false
seealso: seealso:
- module: community.general.filesystem - module: community.general.filesystem
- module: community.general.lvol - module: community.general.lvol
@ -102,7 +102,7 @@ EXAMPLES = r'''
community.general.lvg: community.general.lvg:
vg: resizableVG vg: resizableVG
pvs: /dev/sda3 pvs: /dev/sda3
pvresize: yes pvresize: true
''' '''
import itertools import itertools
@ -258,7 +258,7 @@ def main():
else: else:
module.fail_json(msg="Failed to remove volume group %s" % (vg), rc=rc, err=err) module.fail_json(msg="Failed to remove volume group %s" % (vg), rc=rc, err=err)
else: else:
module.fail_json(msg="Refuse to remove non-empty volume group %s without force=yes" % (vg)) module.fail_json(msg="Refuse to remove non-empty volume group %s without force=true" % (vg))
# resize VG # resize VG
current_devs = [os.path.realpath(pv['name']) for pv in pvs if pv['vg_name'] == vg] current_devs = [os.path.realpath(pv['name']) for pv in pvs if pv['vg_name'] == vg]

View file

@ -52,13 +52,13 @@ options:
description: description:
- Whether the volume is active and visible to the host. - Whether the volume is active and visible to the host.
type: bool type: bool
default: 'yes' default: true
force: force:
description: description:
- Shrink or remove operations of volumes requires this switch. Ensures that - Shrink or remove operations of volumes requires this switch. Ensures that
that filesystems get never corrupted/destroyed by mistake. that filesystems get never corrupted/destroyed by mistake.
type: bool type: bool
default: 'no' default: false
opts: opts:
type: str type: str
description: description:
@ -79,14 +79,14 @@ options:
description: description:
- Shrink if current size is higher than size requested. - Shrink if current size is higher than size requested.
type: bool type: bool
default: 'yes' default: true
resizefs: resizefs:
description: description:
- Resize the underlying filesystem together with the logical volume. - Resize the underlying filesystem together with the logical volume.
- Supported for C(ext2), C(ext3), C(ext4), C(reiserfs) and C(XFS) filesystems. - Supported for C(ext2), C(ext3), C(ext4), C(reiserfs) and C(XFS) filesystems.
Attempts to resize other filesystem types will fail. Attempts to resize other filesystem types will fail.
type: bool type: bool
default: 'no' default: false
notes: notes:
- You must specify lv (when managing the state of logical volumes) or thinpool (when managing a thin provisioned volume). - You must specify lv (when managing the state of logical volumes) or thinpool (when managing a thin provisioned volume).
''' '''
@ -161,35 +161,35 @@ EXAMPLES = '''
vg: firefly vg: firefly
lv: test lv: test
size: 80%VG size: 80%VG
force: yes force: true
- name: Reduce the logical volume to 512m - name: Reduce the logical volume to 512m
community.general.lvol: community.general.lvol:
vg: firefly vg: firefly
lv: test lv: test
size: 512 size: 512
force: yes force: true
- name: Reduce the logical volume by given space - name: Reduce the logical volume by given space
community.general.lvol: community.general.lvol:
vg: firefly vg: firefly
lv: test lv: test
size: -512M size: -512M
force: yes force: true
- name: Set the logical volume to 512m and do not try to shrink if size is lower than current one - name: Set the logical volume to 512m and do not try to shrink if size is lower than current one
community.general.lvol: community.general.lvol:
vg: firefly vg: firefly
lv: test lv: test
size: 512 size: 512
shrink: no shrink: false
- name: Remove the logical volume. - name: Remove the logical volume.
community.general.lvol: community.general.lvol:
vg: firefly vg: firefly
lv: test lv: test
state: absent state: absent
force: yes force: true
- name: Create a snapshot volume of the test logical volume. - name: Create a snapshot volume of the test logical volume.
community.general.lvol: community.general.lvol:
@ -487,7 +487,7 @@ def main():
if state == 'absent': if state == 'absent':
# remove LV # remove LV
if not force: if not force:
module.fail_json(msg="Sorry, no removal of logical volume %s without force=yes." % (this_lv['name'])) module.fail_json(msg="Sorry, no removal of logical volume %s without force=true." % (this_lv['name']))
lvremove_cmd = module.get_bin_path("lvremove", required=True) lvremove_cmd = module.get_bin_path("lvremove", required=True)
rc, dummy, err = module.run_command("%s %s --force %s/%s" % (lvremove_cmd, test_opt, vg, this_lv['name'])) rc, dummy, err = module.run_command("%s %s --force %s/%s" % (lvremove_cmd, test_opt, vg, this_lv['name']))
if rc == 0: if rc == 0:
@ -527,7 +527,7 @@ def main():
if size_requested < 1: if size_requested < 1:
module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name'])) module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name']))
elif not force: elif not force:
module.fail_json(msg="Sorry, no shrinking of %s without force=yes" % (this_lv['name'])) module.fail_json(msg="Sorry, no shrinking of %s without force=true" % (this_lv['name']))
else: else:
tool = module.get_bin_path("lvreduce", required=True) tool = module.get_bin_path("lvreduce", required=True)
tool = '%s %s' % (tool, '--force') tool = '%s %s' % (tool, '--force')
@ -561,7 +561,7 @@ def main():
if float(size) == 0: if float(size) == 0:
module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name'])) module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name']))
if not force: if not force:
module.fail_json(msg="Sorry, no shrinking of %s without force=yes." % (this_lv['name'])) module.fail_json(msg="Sorry, no shrinking of %s without force=true." % (this_lv['name']))
else: else:
tool = module.get_bin_path("lvreduce", required=True) tool = module.get_bin_path("lvreduce", required=True)
tool = '%s %s' % (tool, '--force') tool = '%s %s' % (tool, '--force')

View file

@ -59,7 +59,7 @@ EXAMPLES = r'''
community.general.make: community.general.make:
chdir: /home/ubuntu/cool-project chdir: /home/ubuntu/cool-project
target: install target: install
become: yes become: true
- name: Build 'all' target with extra arguments - name: Build 'all' target with extra arguments
community.general.make: community.general.make:

View file

@ -22,32 +22,32 @@ options:
description: description:
- Backup encrypted files. - Backup encrypted files.
type: bool type: bool
default: "yes" default: true
backup_dmapi_fs: backup_dmapi_fs:
description: description:
- Back up DMAPI filesystem files. - Back up DMAPI filesystem files.
type: bool type: bool
default: "yes" default: true
create_map_files: create_map_files:
description: description:
- Creates a new MAP files. - Creates a new MAP files.
type: bool type: bool
default: "no" default: false
exclude_files: exclude_files:
description: description:
- Excludes files using C(/etc/rootvg.exclude). - Excludes files using C(/etc/rootvg.exclude).
type: bool type: bool
default: "no" default: false
exclude_wpar_files: exclude_wpar_files:
description: description:
- Excludes WPAR files. - Excludes WPAR files.
type: bool type: bool
default: "no" default: false
extended_attrs: extended_attrs:
description: description:
- Backup extended attributes. - Backup extended attributes.
type: bool type: bool
default: "yes" default: true
name: name:
type: str type: str
description: description:
@ -57,13 +57,13 @@ options:
description: description:
- Creates a new file data. - Creates a new file data.
type: bool type: bool
default: "yes" default: true
software_packing: software_packing:
description: description:
- Exclude files from packing option listed in - Exclude files from packing option listed in
C(/etc/exclude_packing.rootvg). C(/etc/exclude_packing.rootvg).
type: bool type: bool
default: "no" default: false
storage_path: storage_path:
type: str type: str
description: description:
@ -73,7 +73,7 @@ options:
description: description:
- Creates backup using snapshots. - Creates backup using snapshots.
type: bool type: bool
default: "no" default: false
''' '''
EXAMPLES = ''' EXAMPLES = '''
@ -81,8 +81,8 @@ EXAMPLES = '''
community.general.mksysb: community.general.mksysb:
name: myserver name: myserver
storage_path: /repository/images storage_path: /repository/images
exclude_files: yes exclude_files: true
exclude_wpar_files: yes exclude_wpar_files: true
''' '''
RETURN = ''' RETURN = '''

View file

@ -51,7 +51,7 @@ options:
effect prior to I(state=reset). effect prior to I(state=reset).
user: user:
required: false required: false
default: 'no' default: false
type: bool type: bool
description: description:
- Run system-control talking to the calling user's service manager, rather than - Run system-control talking to the calling user's service manager, rather than
@ -64,10 +64,14 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: Start dnscache if not running - 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 - 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 - name: Restart unbound or start it if not already running
community.general.nosh: community.general.nosh:
@ -80,26 +84,36 @@ EXAMPLES = '''
state: reloaded state: reloaded
- name: Disable nsd - 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 - 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 - 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 - name: Using conditionals with the module facts
tasks: tasks:
- name: Obtain information on tinydns service - name: Obtain information on tinydns service
community.general.nosh: name=tinydns community.general.nosh:
name: tinydns
register: result register: result
- name: Fail if service not loaded - 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 when: not result.status
- name: Fail if service is running - 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" when: result.status and result.status['DaemontoolsEncoreState'] == "running"
''' '''

View file

@ -78,7 +78,7 @@ options:
- Whether the list of target nodes on the portal should be - Whether the list of target nodes on the portal should be
(re)discovered and added to the persistent iSCSI database. (re)discovered and added to the persistent iSCSI database.
- Keep in mind that C(iscsiadm) discovery resets configuration, like C(node.startup) - Keep in mind that C(iscsiadm) discovery resets configuration, like C(node.startup)
to manual, hence combined with C(auto_node_startup=yes) will always return to manual, hence combined with C(auto_node_startup=true) will always return
a changed state. a changed state.
type: bool type: bool
default: false default: false
@ -100,31 +100,31 @@ options:
EXAMPLES = r''' EXAMPLES = r'''
- name: Perform a discovery on sun.com and show available target nodes - name: Perform a discovery on sun.com and show available target nodes
community.general.open_iscsi: community.general.open_iscsi:
show_nodes: yes show_nodes: true
discover: yes discover: true
portal: sun.com portal: sun.com
- name: Perform a discovery on 10.1.2.3 and show available target nodes - name: Perform a discovery on 10.1.2.3 and show available target nodes
community.general.open_iscsi: community.general.open_iscsi:
show_nodes: yes show_nodes: true
discover: yes discover: true
ip: 10.1.2.3 ip: 10.1.2.3
# NOTE: Only works if exactly one target is exported to the initiator # NOTE: Only works if exactly one target is exported to the initiator
- name: Discover targets on portal and login to the one available - name: Discover targets on portal and login to the one available
community.general.open_iscsi: community.general.open_iscsi:
portal: '{{ iscsi_target }}' portal: '{{ iscsi_target }}'
login: yes login: true
discover: yes discover: true
- name: Connect to the named target, after updating the local persistent database (cache) - name: Connect to the named target, after updating the local persistent database (cache)
community.general.open_iscsi: community.general.open_iscsi:
login: yes login: true
target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d
- name: Disconnect from the cached named target - name: Disconnect from the cached named target
community.general.open_iscsi: community.general.open_iscsi:
login: no login: false
target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d
- name: Override and disable automatic portal login on specific portal - name: Override and disable automatic portal login on specific portal

View file

@ -64,7 +64,7 @@ EXAMPLES = '''
- name: Enable service httpd - name: Enable service httpd
community.general.openwrt_init: community.general.openwrt_init:
name: httpd name: httpd
enabled: yes enabled: true
''' '''
RETURN = ''' RETURN = '''

View file

@ -47,7 +47,7 @@ options:
description: description:
- Add new elements to the array for a key which has an array as its value. - Add new elements to the array for a key which has an array as its value.
type: bool type: bool
default: no default: false
value: value:
description: description:
- The value to write. - The value to write.
@ -92,7 +92,7 @@ EXAMPLES = r'''
key: AutomaticCheckEnabled key: AutomaticCheckEnabled
type: int type: int
value: 1 value: 1
become: yes become: true
- community.general.osx_defaults: - community.general.osx_defaults:
domain: com.apple.screensaver domain: com.apple.screensaver

View file

@ -69,23 +69,23 @@ options:
the original file back if you somehow clobbered it incorrectly. the original file back if you somehow clobbered it incorrectly.
required: false required: false
type: bool type: bool
default: "no" default: false
use_min: use_min:
description: description:
- If set to C(yes), the minimal value will be used or conserved. - If set to C(true), the minimal value will be used or conserved.
- If the specified value is inferior to the value in the file, - If the specified value is inferior to the value in the file,
file content is replaced with the new value, else content is not modified. file content is replaced with the new value, else content is not modified.
required: false required: false
type: bool type: bool
default: "no" default: false
use_max: use_max:
description: description:
- If set to C(yes), the maximal value will be used or conserved. - If set to C(true), the maximal value will be used or conserved.
- If the specified value is superior to the value in the file, - If the specified value is superior to the value in the file,
file content is replaced with the new value, else content is not modified. file content is replaced with the new value, else content is not modified.
required: false required: false
type: bool type: bool
default: "no" default: false
dest: dest:
type: str type: str
description: description:
@ -116,7 +116,7 @@ EXAMPLES = r'''
limit_type: hard limit_type: hard
limit_item: fsize limit_item: fsize
value: 1000000 value: 1000000
use_max: yes use_max: true
- name: Add or modify memlock, both soft and hard, limit for the user james with a comment - name: Add or modify memlock, both soft and hard, limit for the user james with a comment
community.general.pam_limits: community.general.pam_limits:

View file

@ -95,7 +95,7 @@ options:
- Create a backup file including the timestamp information so you can - Create a backup file including the timestamp information so you can
get the original file back if you somehow clobbered it incorrectly. get the original file back if you somehow clobbered it incorrectly.
type: bool type: bool
default: no default: false
''' '''
EXAMPLES = r''' EXAMPLES = r'''

View file

@ -35,8 +35,8 @@ options:
noop: noop:
description: description:
- Override puppet.conf noop mode. - Override puppet.conf noop mode.
- When C(yes), run Puppet agent with C(--noop) switch set. - When C(true), run Puppet agent with C(--noop) switch set.
- When C(no), run Puppet agent with C(--no-noop) switch set. - When C(false), run Puppet agent with C(--no-noop) switch set.
- When unset (default), use default or puppet.conf value if defined. - When unset (default), use default or puppet.conf value if defined.
type: bool type: bool
facts: facts:
@ -139,7 +139,7 @@ EXAMPLES = r'''
- name: Run puppet agent in noop mode - name: Run puppet agent in noop mode
community.general.puppet: community.general.puppet:
noop: yes noop: true
- name: Run a manifest with debug, log to both syslog and console, specify module path - name: Run a manifest with debug, log to both syslog and console, specify module path
community.general.puppet: community.general.puppet:

View file

@ -21,7 +21,7 @@ options:
description: description:
- Name of the service to manage. - Name of the service to manage.
type: str type: str
required: yes required: true
state: state:
description: description:
- C(started)/C(stopped) are idempotent actions that will not run - C(started)/C(stopped) are idempotent actions that will not run

View file

@ -20,7 +20,7 @@ options:
description: description:
- Target path (expression). - Target path (expression).
type: str type: str
required: yes required: true
aliases: [ path ] aliases: [ path ]
ftype: ftype:
description: description:
@ -41,7 +41,7 @@ options:
description: description:
- SELinux type for the specified target. - SELinux type for the specified target.
type: str type: str
required: yes required: true
seuser: seuser:
description: description:
- SELinux user for the specified target. - SELinux user for the specified target.
@ -62,12 +62,12 @@ options:
- Reload SELinux policy after commit. - Reload SELinux policy after commit.
- Note that this does not apply SELinux file contexts to existing files. - Note that this does not apply SELinux file contexts to existing files.
type: bool type: bool
default: yes default: true
ignore_selinux_state: ignore_selinux_state:
description: description:
- Useful for scenarios (chrooted environment) that you can't get the real SELinux state. - Useful for scenarios (chrooted environment) that you can't get the real SELinux state.
type: bool type: bool
default: no default: false
notes: notes:
- The changes are persistent across reboots. - The changes are persistent across reboots.
- The M(community.general.sefcontext) module does not modify existing files to the new - The M(community.general.sefcontext) module does not modify existing files to the new

View file

@ -30,10 +30,10 @@ options:
no_reload: no_reload:
description: description:
- Disable reloading of the SELinux policy after making change to a domain's permissive setting. - Disable reloading of the SELinux policy after making change to a domain's permissive setting.
- The default is C(no), which causes policy to be reloaded when a domain changes state. - The default is C(false), which causes policy to be reloaded when a domain changes state.
- Reloading the policy does not work on older versions of the C(policycoreutils-python) library, for example in EL 6." - Reloading the policy does not work on older versions of the C(policycoreutils-python) library, for example in EL 6."
type: bool type: bool
default: no default: false
store: store:
description: description:
- Name of the SELinux policy store to use. - Name of the SELinux policy store to use.

View file

@ -40,7 +40,7 @@ options:
description: description:
- Reload SELinux policy after commit. - Reload SELinux policy after commit.
type: bool type: bool
default: yes default: true
ignore_selinux_state: ignore_selinux_state:
description: description:
- Run independent of selinux runtime state - Run independent of selinux runtime state

View file

@ -43,12 +43,12 @@ options:
description: description:
- Reload SELinux policy after commit. - Reload SELinux policy after commit.
type: bool type: bool
default: yes default: true
ignore_selinux_state: ignore_selinux_state:
description: description:
- Run independent of selinux runtime state - Run independent of selinux runtime state
type: bool type: bool
default: no default: false
notes: notes:
- The changes are persistent across reboots. - The changes are persistent across reboots.
- Not tested on any debian based system. - Not tested on any debian based system.

View file

@ -53,7 +53,7 @@ options:
description: description:
- Whether to create a sparse (C(true)) or whole root (C(false)) zone. - Whether to create a sparse (C(true)) or whole root (C(false)) zone.
type: bool type: bool
default: no default: false
root_password: root_password:
description: description:
- The password hash for the root account. If not specified, the zone's root account - The password hash for the root account. If not specified, the zone's root account

View file

@ -20,24 +20,24 @@ options:
description: description:
- Apply the latest snapshot. - Apply the latest snapshot.
- Otherwise release will be applied. - Otherwise release will be applied.
default: no default: false
type: bool type: bool
force: force:
description: description:
- Force upgrade (for snapshots only). - Force upgrade (for snapshots only).
default: no default: false
type: bool type: bool
keep_files: keep_files:
description: description:
- Keep the files under /home/_sysupgrade. - Keep the files under /home/_sysupgrade.
- By default, the files will be deleted after the upgrade. - By default, the files will be deleted after the upgrade.
default: no default: false
type: bool type: bool
fetch_only: fetch_only:
description: description:
- Fetch and verify files and create /bsd.upgrade but do not reboot. - Fetch and verify files and create /bsd.upgrade but do not reboot.
- Set to C(false) if you want sysupgrade to reboot. This will cause Ansible to error, as it expects the module to exit gracefully. See the examples. - Set to C(false) if you want sysupgrade to reboot. This will cause Ansible to error, as it expects the module to exit gracefully. See the examples.
default: yes default: true
type: bool type: bool
installurl: installurl:
description: description:
@ -55,7 +55,7 @@ EXAMPLES = r'''
- name: Upgrade to latest snapshot - name: Upgrade to latest snapshot
community.general.sysupgrade: community.general.sysupgrade:
snapshot: yes snapshot: true
installurl: https://cloudflare.cdn.openbsd.org/pub/OpenBSD installurl: https://cloudflare.cdn.openbsd.org/pub/OpenBSD
register: sysupgrade register: sysupgrade
@ -68,8 +68,8 @@ EXAMPLES = r'''
- name: Have sysupgrade automatically reboot - name: Have sysupgrade automatically reboot
community.general.sysupgrade: community.general.sysupgrade:
fetch_only: no fetch_only: false
ignore_errors: yes ignore_errors: true
''' '''
RETURN = r''' RETURN = r'''

View file

@ -179,7 +179,7 @@ EXAMPLES = r'''
- community.general.ufw: - community.general.ufw:
rule: reject rule: reject
port: auth port: auth
log: yes log: true
# ufw supports connection rate limiting, which is useful for protecting # ufw supports connection rate limiting, which is useful for protecting
# against brute-force login attacks. ufw will deny connections if an IP # against brute-force login attacks. ufw will deny connections if an IP
@ -192,7 +192,7 @@ EXAMPLES = r'''
proto: tcp proto: tcp
# Allow OpenSSH. (Note that as ufw manages its own state, simply removing # Allow OpenSSH. (Note that as ufw manages its own state, simply removing
# a rule=allow task can leave those ports exposed. Either use delete=yes # a rule=allow task can leave those ports exposed. Either use delete=true
# or a separate state=reset task) # or a separate state=reset task)
- community.general.ufw: - community.general.ufw:
rule: allow rule: allow
@ -202,7 +202,7 @@ EXAMPLES = r'''
community.general.ufw: community.general.ufw:
rule: allow rule: allow
name: OpenSSH name: OpenSSH
delete: yes delete: true
- name: Deny all access to port 53 - name: Deny all access to port 53
community.general.ufw: community.general.ufw:
@ -285,9 +285,9 @@ EXAMPLES = r'''
- name: Deny forwarded/routed traffic from subnet 1.2.3.0/24 to subnet 4.5.6.0/24 - name: Deny forwarded/routed traffic from subnet 1.2.3.0/24 to subnet 4.5.6.0/24
community.general.ufw: community.general.ufw:
rule: deny rule: deny
route: yes route: true
src: 1.2.3.0/24 src: 192.0.2.0/24
dest: 4.5.6.0/24 dest: 198.51.100.0/24
''' '''
import re import re

View file

@ -48,7 +48,7 @@ options:
activated: activated:
description: description:
- The "activate" status for a VDO volume. If this is set - The "activate" status for a VDO volume. If this is set
to "no", the VDO volume cannot be started, and it will to C(false), the VDO volume cannot be started, and it will
not start on system startup. However, on initial not start on system startup. However, on initial
creation, a VDO volume with "activated" set to "off" creation, a VDO volume with "activated" set to "off"
will be running, until stopped. This is the default will be running, until stopped. This is the default
@ -270,7 +270,7 @@ options:
checks it is important to make sure that all parameters checks it is important to make sure that all parameters
provided are accurate and intentional." provided are accurate and intentional."
type: bool type: bool
default: no default: false
version_added: 2.4.0 version_added: 2.4.0
notes: notes:
- In general, the default thread configuration should be used. - In general, the default thread configuration should be used.
@ -725,7 +725,7 @@ def run_module():
# Note that a disabled VDO volume cannot be started by the # Note that a disabled VDO volume cannot be started by the
# 'vdo start' command, by design. To accurately track changed # 'vdo start' command, by design. To accurately track changed
# status, don't try to start a disabled VDO volume. # status, don't try to start a disabled VDO volume.
# If the playbook contains 'activated: yes', assume that # If the playbook contains 'activated: true', assume that
# the activate_vdo() operation succeeded, as 'vdoactivatestatus' # the activate_vdo() operation succeeded, as 'vdoactivatestatus'
# will have the activated status prior to the activate_vdo() # will have the activated status prior to the activate_vdo()
# call. # call.

View file

@ -72,7 +72,7 @@ options:
description: description:
- Force array even if only one element - Force array even if only one element
type: bool type: bool
default: 'no' default: false
aliases: ['array'] aliases: ['array']
version_added: 1.0.0 version_added: 1.0.0
disable_facts: disable_facts: