From be2de15c66428f614e9f403961bb736d758e6a36 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 24 Aug 2022 19:59:01 +0200 Subject: [PATCH] Adjust booleans in system modules (#5153) * Adjust booleans in system modules. * Fix some IP addresses Co-authored-by: Sandra McCann Co-authored-by: Sandra McCann --- plugins/modules/system/aix_devices.py | 8 ++--- plugins/modules/system/aix_filesystem.py | 14 +++++---- plugins/modules/system/aix_inittab.py | 12 ++++---- plugins/modules/system/aix_lvg.py | 2 +- plugins/modules/system/awall.py | 6 ++-- plugins/modules/system/capabilities.py | 4 +-- plugins/modules/system/cronvar.py | 4 +-- plugins/modules/system/crypttab.py | 4 +-- plugins/modules/system/dpkg_divert.py | 10 +++--- plugins/modules/system/filesystem.py | 14 ++++----- plugins/modules/system/gconftool2.py | 10 +++--- plugins/modules/system/homectl.py | 2 +- plugins/modules/system/interfaces_file.py | 4 +-- plugins/modules/system/iptables_state.py | 6 ++-- plugins/modules/system/java_cert.py | 8 ++--- plugins/modules/system/java_keystore.py | 2 +- plugins/modules/system/launchd.py | 6 ++-- plugins/modules/system/listen_ports_facts.py | 2 +- plugins/modules/system/lvg.py | 10 +++--- plugins/modules/system/lvol.py | 24 +++++++-------- plugins/modules/system/make.py | 2 +- plugins/modules/system/mksysb.py | 22 +++++++------- plugins/modules/system/nosh.py | 32 ++++++++++++++------ plugins/modules/system/open_iscsi.py | 18 +++++------ plugins/modules/system/openwrt_init.py | 2 +- plugins/modules/system/osx_defaults.py | 4 +-- plugins/modules/system/pam_limits.py | 12 ++++---- plugins/modules/system/pamd.py | 2 +- plugins/modules/system/puppet.py | 6 ++-- plugins/modules/system/runit.py | 2 +- plugins/modules/system/sefcontext.py | 8 ++--- plugins/modules/system/selinux_permissive.py | 4 +-- plugins/modules/system/selogin.py | 2 +- plugins/modules/system/seport.py | 4 +-- plugins/modules/system/solaris_zone.py | 2 +- plugins/modules/system/sysupgrade.py | 14 ++++----- plugins/modules/system/ufw.py | 12 ++++---- plugins/modules/system/vdo.py | 6 ++-- plugins/modules/system/xfconf.py | 2 +- 39 files changed, 162 insertions(+), 146 deletions(-) diff --git a/plugins/modules/system/aix_devices.py b/plugins/modules/system/aix_devices.py index b338f94379..be23937baa 100644 --- a/plugins/modules/system/aix_devices.py +++ b/plugins/modules/system/aix_devices.py @@ -30,12 +30,12 @@ options: description: - Forces action. type: bool - default: no + default: false recursive: description: - Removes or defines a device and children devices. type: bool - default: no + default: false state: description: - Controls the device state. @@ -87,13 +87,13 @@ EXAMPLES = r''' - name: Put vscsi1 and children devices in Defined state. community.general.aix_devices: device: vscsi1 - recursive: yes + recursive: true state: defined - name: Removes vscsi1 and children devices. community.general.aix_devices: device: vscsi1 - recursive: yes + recursive: true state: removed - name: Changes en1 mtu to 9000 and disables arp. diff --git a/plugins/modules/system/aix_filesystem.py b/plugins/modules/system/aix_filesystem.py index de682ca333..77d065a59a 100644 --- a/plugins/modules/system/aix_filesystem.py +++ b/plugins/modules/system/aix_filesystem.py @@ -24,18 +24,20 @@ options: description: - Specifies whether the file system is to be processed by the accounting subsystem. type: bool - default: no + default: false attributes: description: - Specifies attributes for files system separated by comma. type: list elements: str - default: agblksize='4096',isnapshot='no' + default: + - agblksize='4096' + - isnapshot='no' auto_mount: description: - File system is automatically mounted at system restart. type: bool - default: yes + default: true device: description: - Logical volume (LV) device name or remote export device to create a NFS file system. @@ -70,7 +72,7 @@ options: description: - Removes the mount point directory when used with state C(absent). type: bool - default: no + default: false size: description: - Specifies the file system size. @@ -149,13 +151,13 @@ EXAMPLES = r''' - name: Remove NFS filesystem /home/ftp. community.general.aix_filesystem: filesystem: /home/ftp - rm_mount_point: yes + rm_mount_point: true state: absent - name: Remove /newfs. community.general.aix_filesystem: filesystem: /newfs - rm_mount_point: yes + rm_mount_point: true state: absent ''' diff --git a/plugins/modules/system/aix_inittab.py b/plugins/modules/system/aix_inittab.py index d0d712483e..57ef4758cb 100644 --- a/plugins/modules/system/aix_inittab.py +++ b/plugins/modules/system/aix_inittab.py @@ -21,13 +21,13 @@ options: description: - Name of the inittab entry. type: str - required: yes + required: true aliases: [ service ] runlevel: description: - Runlevel of the entry. type: str - required: yes + required: true action: description: - Action what the init has to do with this entry. @@ -49,7 +49,7 @@ options: description: - What command has to run. type: str - required: yes + required: true insertafter: description: - After which inittabline should the new entry inserted. @@ -78,7 +78,7 @@ EXAMPLES = ''' command: echo hello insertafter: existingservice state: present - become: yes + become: true # Change inittab entry startmyservice to runlevel "2" and processaction "wait". - name: Change startmyservice to inittab @@ -88,7 +88,7 @@ EXAMPLES = ''' action: wait command: echo hello state: present - become: yes + become: true - name: Remove startmyservice from inittab community.general.aix_inittab: @@ -97,7 +97,7 @@ EXAMPLES = ''' action: wait command: echo hello state: absent - become: yes + become: true ''' RETURN = ''' diff --git a/plugins/modules/system/aix_lvg.py b/plugins/modules/system/aix_lvg.py index 4fbf45060b..44ad631236 100644 --- a/plugins/modules/system/aix_lvg.py +++ b/plugins/modules/system/aix_lvg.py @@ -21,7 +21,7 @@ options: description: - Force volume group creation. type: bool - default: no + default: false pp_size: description: - The size of the physical partition in megabytes. diff --git a/plugins/modules/system/awall.py b/plugins/modules/system/awall.py index 279bc1bf67..dc13d46789 100644 --- a/plugins/modules/system/awall.py +++ b/plugins/modules/system/awall.py @@ -35,7 +35,7 @@ options: - Activate the new firewall rules. - Can be run with other steps or on its own. type: bool - default: no + default: false ''' EXAMPLES = r''' @@ -50,11 +50,11 @@ EXAMPLES = r''' - foo - bar state: disabled - activate: no + activate: false - name: Activate currently enabled firewall rules community.general.awall: - activate: yes + activate: true ''' RETURN = ''' # ''' diff --git a/plugins/modules/system/capabilities.py b/plugins/modules/system/capabilities.py index 2e329649af..9309958eca 100644 --- a/plugins/modules/system/capabilities.py +++ b/plugins/modules/system/capabilities.py @@ -19,13 +19,13 @@ options: description: - Specifies the path to the file to be managed. type: str - required: yes + required: true aliases: [ key ] capability: description: - Desired capability to set (with operator and flags, if state is C(present)) or remove (if state is C(absent)) type: str - required: yes + required: true aliases: [ cap ] state: description: diff --git a/plugins/modules/system/cronvar.py b/plugins/modules/system/cronvar.py index 2883f9558c..fd539c1d1f 100644 --- a/plugins/modules/system/cronvar.py +++ b/plugins/modules/system/cronvar.py @@ -29,7 +29,7 @@ options: description: - Name of the crontab variable. type: str - required: yes + required: true value: description: - The value to set this variable to. @@ -67,7 +67,7 @@ options: - 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. type: bool - default: no + default: false requirements: - cron author: diff --git a/plugins/modules/system/crypttab.py b/plugins/modules/system/crypttab.py index 6cbfe933d3..a334e8ab3f 100644 --- a/plugins/modules/system/crypttab.py +++ b/plugins/modules/system/crypttab.py @@ -21,7 +21,7 @@ options: optionally prefixed with C(/dev/mapper/), as it appears in the filesystem. I(/dev/mapper/) will be stripped from I(name). type: str - required: yes + required: true state: description: - 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. - Use I(opts_absent) to remove options from the existing set. type: str - required: yes + required: true choices: [ absent, opts_absent, opts_present, present ] backing_device: description: diff --git a/plugins/modules/system/dpkg_divert.py b/plugins/modules/system/dpkg_divert.py index c346fdfac6..52e6c33d0d 100644 --- a/plugins/modules/system/dpkg_divert.py +++ b/plugins/modules/system/dpkg_divert.py @@ -70,7 +70,7 @@ options: exists (this lock being a dpkg-divert feature, and bypassing it being a module feature). type: bool - default: no + default: false force: description: - 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. - This parameter is ignored when I(rename=false). type: bool - default: no + default: false notes: - This module supports I(check_mode) and I(diff). requirements: @@ -99,14 +99,14 @@ EXAMPLES = r''' community.general.dpkg_divert: path: /usr/bin/busybox divert: /usr/bin/busybox.dpkg-divert - rename: yes + rename: true - name: Remove the busybox diversion and move the diverted file back community.general.dpkg_divert: path: /usr/bin/busybox state: absent - rename: yes - force: yes + rename: true + force: true ''' RETURN = r''' diff --git a/plugins/modules/system/filesystem.py b/plugins/modules/system/filesystem.py index ee382cf51f..d88f104a4a 100644 --- a/plugins/modules/system/filesystem.py +++ b/plugins/modules/system/filesystem.py @@ -50,16 +50,16 @@ options: a regular file as their target I(dev). - Support for character devices on FreeBSD has been added in community.general 3.4.0. type: path - required: yes + required: true aliases: [device] force: 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 - default: 'no' + default: false resizefs: 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. Attempts to resize other filesystem types will fail. - XFS Will only grow if mounted. Currently, the module is based on commands @@ -67,7 +67,7 @@ options: not supported on FreeBSD systems. - vFAT will likely fail if fatresize < 1.04. type: bool - default: 'no' + default: false opts: description: - 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) 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 - I(force) is C(no). + I(force) is C(false). - On FreeBSD systems, both C(e2fsprogs) and C(util-linux) packages provide a C(blkid) command that is compatible with this module. However, these 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) 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 filesystem.create(mkfs_opts, dev) diff --git a/plugins/modules/system/gconftool2.py b/plugins/modules/system/gconftool2.py index c53480aa09..931b43d76c 100644 --- a/plugins/modules/system/gconftool2.py +++ b/plugins/modules/system/gconftool2.py @@ -23,7 +23,7 @@ options: description: - A GConf preference key is an element in the GConf repository that corresponds to an application preference. See man gconftool-2(1). - required: yes + required: true value: type: str description: @@ -40,7 +40,7 @@ options: description: - The action to take upon the key/value. - State C(get) is deprecated and will be removed in community.general 8.0.0. Please use the module M(community.general.gconftool2_info) instead. - required: yes + required: true choices: [ absent, get, present ] config_source: type: str @@ -53,7 +53,7 @@ options: specified then the config_source must be specified as well. See man gconftool-2(1). type: bool - default: 'no' + default: false ''' EXAMPLES = """ @@ -192,11 +192,11 @@ def main(): % str(state)) 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') elif not direct and config_source is not None: module.fail_json(msg='If the "config_source" is specified ' + - 'then "direct" must be "yes"') + 'then "direct" must be "true"') # Create a gconf2 preference gconf_pref = GConf2Preference(module, key, value_type, diff --git a/plugins/modules/system/homectl.py b/plugins/modules/system/homectl.py index 2fc5313cff..c14dc4af9a 100644 --- a/plugins/modules/system/homectl.py +++ b/plugins/modules/system/homectl.py @@ -196,7 +196,7 @@ EXAMPLES = ''' password: myreallysecurepassword1! state: present disksize: 10G - resize: yes + resize: true - name: Remove an existing user 'janet' community.general.homectl: diff --git a/plugins/modules/system/interfaces_file.py b/plugins/modules/system/interfaces_file.py index e9efe37c37..fe4223a12f 100644 --- a/plugins/modules/system/interfaces_file.py +++ b/plugins/modules/system/interfaces_file.py @@ -48,7 +48,7 @@ options: - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. type: bool - default: 'no' + default: false state: type: str description: @@ -136,7 +136,7 @@ EXAMPLES = ''' iface: eth1 option: mtu value: 8000 - backup: yes + backup: true state: present register: eth1_cfg ''' diff --git a/plugins/modules/system/iptables_state.py b/plugins/modules/system/iptables_state.py index 38eb1c2eeb..1e94631c7f 100644 --- a/plugins/modules/system/iptables_state.py +++ b/plugins/modules/system/iptables_state.py @@ -71,14 +71,14 @@ options: - The file the iptables state should be saved to. - The file the iptables state should be restored from. type: path - required: yes + required: true state: description: - Whether the firewall state should be saved (into a file) or restored (from a file). type: str choices: [ saved, restored ] - required: yes + required: true table: description: - When I(state=restored), restore only the named table even if the input @@ -133,7 +133,7 @@ EXAMPLES = r''' community.general.iptables_state: state: saved path: /tmp/iptables - check_mode: yes + check_mode: true changed_when: false register: iptables_state diff --git a/plugins/modules/system/java_cert.py b/plugins/modules/system/java_cert.py index b9e80afa73..6d1df19093 100644 --- a/plugins/modules/system/java_cert.py +++ b/plugins/modules/system/java_cert.py @@ -119,7 +119,7 @@ EXAMPLES = r''' cert_path: /opt/certs/rootca.crt keystore_path: /tmp/cacerts keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present cert_alias: LE_RootCA trust_cacert: True @@ -129,7 +129,7 @@ EXAMPLES = r''' cert_url: google.com keystore_path: /tmp/cacerts keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present - 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 keystore_path: /opt/wildfly/standalone/configuration/defaultkeystore.jks keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present - name: Import SSL certificate to JCEKS keystore @@ -150,7 +150,7 @@ EXAMPLES = r''' keystore_path: /opt/someapp/security/keystore.jceks keystore_type: "JCEKS" keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present ''' diff --git a/plugins/modules/system/java_keystore.py b/plugins/modules/system/java_keystore.py index 33fb048611..2383c8cc48 100644 --- a/plugins/modules/system/java_keystore.py +++ b/plugins/modules/system/java_keystore.py @@ -76,7 +76,7 @@ options: description: - Keystore is created even if it already exists. type: bool - default: 'no' + default: false owner: description: - Name of the user that should own jks file. diff --git a/plugins/modules/system/launchd.py b/plugins/modules/system/launchd.py index 61d3554007..6e14e4c10c 100644 --- a/plugins/modules/system/launchd.py +++ b/plugins/modules/system/launchd.py @@ -47,9 +47,9 @@ options: - Whether the service should not be restarted automatically by launchd. - 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. - - 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 - default: no + default: false notes: - A user must privileged to manage services using this module. requirements: @@ -82,7 +82,7 @@ EXAMPLES = r''' community.general.launchd: name: org.memcached state: stopped - force_stop: yes + force_stop: true - name: Restart memcached community.general.launchd: diff --git a/plugins/modules/system/listen_ports_facts.py b/plugins/modules/system/listen_ports_facts.py index 7c20992507..c137a33e42 100644 --- a/plugins/modules/system/listen_ports_facts.py +++ b/plugins/modules/system/listen_ports_facts.py @@ -71,7 +71,7 @@ EXAMPLES = r''' - name: Gather facts on all ports and override which command to use community.general.listen_ports_facts: command: 'netstat' - include_non_listening: 'yes' + include_non_listening: true ''' RETURN = r''' diff --git a/plugins/modules/system/lvg.py b/plugins/modules/system/lvg.py index 4fc5a14084..0bb91583fa 100644 --- a/plugins/modules/system/lvg.py +++ b/plugins/modules/system/lvg.py @@ -44,7 +44,7 @@ options: type: str pvresize: 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 default: false version_added: '0.2.0' @@ -60,9 +60,9 @@ options: default: present force: 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 - default: no + default: false seealso: - module: community.general.filesystem - module: community.general.lvol @@ -102,7 +102,7 @@ EXAMPLES = r''' community.general.lvg: vg: resizableVG pvs: /dev/sda3 - pvresize: yes + pvresize: true ''' import itertools @@ -258,7 +258,7 @@ def main(): else: module.fail_json(msg="Failed to remove volume group %s" % (vg), rc=rc, err=err) 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 current_devs = [os.path.realpath(pv['name']) for pv in pvs if pv['vg_name'] == vg] diff --git a/plugins/modules/system/lvol.py b/plugins/modules/system/lvol.py index 882e21846a..4489258da5 100644 --- a/plugins/modules/system/lvol.py +++ b/plugins/modules/system/lvol.py @@ -52,13 +52,13 @@ options: description: - Whether the volume is active and visible to the host. type: bool - default: 'yes' + default: true force: description: - Shrink or remove operations of volumes requires this switch. Ensures that that filesystems get never corrupted/destroyed by mistake. type: bool - default: 'no' + default: false opts: type: str description: @@ -79,14 +79,14 @@ options: description: - Shrink if current size is higher than size requested. type: bool - default: 'yes' + default: true resizefs: description: - Resize the underlying filesystem together with the logical volume. - Supported for C(ext2), C(ext3), C(ext4), C(reiserfs) and C(XFS) filesystems. Attempts to resize other filesystem types will fail. type: bool - default: 'no' + default: false notes: - 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 lv: test size: 80%VG - force: yes + force: true - name: Reduce the logical volume to 512m community.general.lvol: vg: firefly lv: test size: 512 - force: yes + force: true - name: Reduce the logical volume by given space community.general.lvol: vg: firefly lv: test 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 community.general.lvol: vg: firefly lv: test size: 512 - shrink: no + shrink: false - name: Remove the logical volume. community.general.lvol: vg: firefly lv: test state: absent - force: yes + force: true - name: Create a snapshot volume of the test logical volume. community.general.lvol: @@ -487,7 +487,7 @@ def main(): if state == 'absent': # remove LV 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) rc, dummy, err = module.run_command("%s %s --force %s/%s" % (lvremove_cmd, test_opt, vg, this_lv['name'])) if rc == 0: @@ -527,7 +527,7 @@ def main(): if size_requested < 1: module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name'])) 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: tool = module.get_bin_path("lvreduce", required=True) tool = '%s %s' % (tool, '--force') @@ -561,7 +561,7 @@ def main(): if float(size) == 0: module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name'])) 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: tool = module.get_bin_path("lvreduce", required=True) tool = '%s %s' % (tool, '--force') diff --git a/plugins/modules/system/make.py b/plugins/modules/system/make.py index e87569389e..31da07c579 100644 --- a/plugins/modules/system/make.py +++ b/plugins/modules/system/make.py @@ -59,7 +59,7 @@ EXAMPLES = r''' community.general.make: chdir: /home/ubuntu/cool-project target: install - become: yes + become: true - name: Build 'all' target with extra arguments community.general.make: diff --git a/plugins/modules/system/mksysb.py b/plugins/modules/system/mksysb.py index f25d88e6a3..a2e3f4e6c8 100644 --- a/plugins/modules/system/mksysb.py +++ b/plugins/modules/system/mksysb.py @@ -22,32 +22,32 @@ options: description: - Backup encrypted files. type: bool - default: "yes" + default: true backup_dmapi_fs: description: - Back up DMAPI filesystem files. type: bool - default: "yes" + default: true create_map_files: description: - Creates a new MAP files. type: bool - default: "no" + default: false exclude_files: description: - Excludes files using C(/etc/rootvg.exclude). type: bool - default: "no" + default: false exclude_wpar_files: description: - Excludes WPAR files. type: bool - default: "no" + default: false extended_attrs: description: - Backup extended attributes. type: bool - default: "yes" + default: true name: type: str description: @@ -57,13 +57,13 @@ options: description: - Creates a new file data. type: bool - default: "yes" + default: true software_packing: description: - Exclude files from packing option listed in C(/etc/exclude_packing.rootvg). type: bool - default: "no" + default: false storage_path: type: str description: @@ -73,7 +73,7 @@ options: description: - Creates backup using snapshots. type: bool - default: "no" + default: false ''' EXAMPLES = ''' @@ -81,8 +81,8 @@ EXAMPLES = ''' community.general.mksysb: name: myserver storage_path: /repository/images - exclude_files: yes - exclude_wpar_files: yes + exclude_files: true + exclude_wpar_files: true ''' RETURN = ''' diff --git a/plugins/modules/system/nosh.py b/plugins/modules/system/nosh.py index 31c6b854b0..190a26a55b 100644 --- a/plugins/modules/system/nosh.py +++ b/plugins/modules/system/nosh.py @@ -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" ''' diff --git a/plugins/modules/system/open_iscsi.py b/plugins/modules/system/open_iscsi.py index e729e8017d..23157df874 100644 --- a/plugins/modules/system/open_iscsi.py +++ b/plugins/modules/system/open_iscsi.py @@ -78,7 +78,7 @@ options: - Whether the list of target nodes on the portal should be (re)discovered and added to the persistent iSCSI database. - 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. type: bool default: false @@ -100,31 +100,31 @@ options: EXAMPLES = r''' - name: Perform a discovery on sun.com and show available target nodes community.general.open_iscsi: - show_nodes: yes - discover: yes + show_nodes: true + discover: true portal: sun.com - name: Perform a discovery on 10.1.2.3 and show available target nodes community.general.open_iscsi: - show_nodes: yes - discover: yes + show_nodes: true + discover: true ip: 10.1.2.3 # NOTE: Only works if exactly one target is exported to the initiator - name: Discover targets on portal and login to the one available community.general.open_iscsi: portal: '{{ iscsi_target }}' - login: yes - discover: yes + login: true + discover: true - name: Connect to the named target, after updating the local persistent database (cache) community.general.open_iscsi: - login: yes + login: true target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d - name: Disconnect from the cached named target community.general.open_iscsi: - login: no + login: false target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d - name: Override and disable automatic portal login on specific portal diff --git a/plugins/modules/system/openwrt_init.py b/plugins/modules/system/openwrt_init.py index 0bd20a03bf..be7031791e 100644 --- a/plugins/modules/system/openwrt_init.py +++ b/plugins/modules/system/openwrt_init.py @@ -64,7 +64,7 @@ EXAMPLES = ''' - name: Enable service httpd community.general.openwrt_init: name: httpd - enabled: yes + enabled: true ''' RETURN = ''' diff --git a/plugins/modules/system/osx_defaults.py b/plugins/modules/system/osx_defaults.py index 32906682ea..8f7c2a8cf3 100644 --- a/plugins/modules/system/osx_defaults.py +++ b/plugins/modules/system/osx_defaults.py @@ -47,7 +47,7 @@ options: description: - Add new elements to the array for a key which has an array as its value. type: bool - default: no + default: false value: description: - The value to write. @@ -92,7 +92,7 @@ EXAMPLES = r''' key: AutomaticCheckEnabled type: int value: 1 - become: yes + become: true - community.general.osx_defaults: domain: com.apple.screensaver diff --git a/plugins/modules/system/pam_limits.py b/plugins/modules/system/pam_limits.py index fb019e05c9..d80ba5ffbf 100644 --- a/plugins/modules/system/pam_limits.py +++ b/plugins/modules/system/pam_limits.py @@ -69,23 +69,23 @@ options: the original file back if you somehow clobbered it incorrectly. required: false type: bool - default: "no" + default: false use_min: 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, file content is replaced with the new value, else content is not modified. required: false type: bool - default: "no" + default: false use_max: 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, file content is replaced with the new value, else content is not modified. required: false type: bool - default: "no" + default: false dest: type: str description: @@ -116,7 +116,7 @@ EXAMPLES = r''' limit_type: hard limit_item: fsize 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 community.general.pam_limits: diff --git a/plugins/modules/system/pamd.py b/plugins/modules/system/pamd.py index 8e1882a41b..9b7ac77857 100644 --- a/plugins/modules/system/pamd.py +++ b/plugins/modules/system/pamd.py @@ -95,7 +95,7 @@ options: - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. type: bool - default: no + default: false ''' EXAMPLES = r''' diff --git a/plugins/modules/system/puppet.py b/plugins/modules/system/puppet.py index 25d4f0fc75..c787a7f00c 100644 --- a/plugins/modules/system/puppet.py +++ b/plugins/modules/system/puppet.py @@ -35,8 +35,8 @@ options: noop: description: - Override puppet.conf noop mode. - - When C(yes), run Puppet agent with C(--noop) switch set. - - When C(no), run Puppet agent with C(--no-noop) switch set. + - When C(true), run Puppet agent with C(--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. type: bool facts: @@ -139,7 +139,7 @@ EXAMPLES = r''' - name: Run puppet agent in noop mode community.general.puppet: - noop: yes + noop: true - name: Run a manifest with debug, log to both syslog and console, specify module path community.general.puppet: diff --git a/plugins/modules/system/runit.py b/plugins/modules/system/runit.py index ecd682648b..7b60215300 100644 --- a/plugins/modules/system/runit.py +++ b/plugins/modules/system/runit.py @@ -21,7 +21,7 @@ options: description: - Name of the service to manage. type: str - required: yes + required: true state: description: - C(started)/C(stopped) are idempotent actions that will not run diff --git a/plugins/modules/system/sefcontext.py b/plugins/modules/system/sefcontext.py index d9b93b636c..8183ed7d71 100644 --- a/plugins/modules/system/sefcontext.py +++ b/plugins/modules/system/sefcontext.py @@ -20,7 +20,7 @@ options: description: - Target path (expression). type: str - required: yes + required: true aliases: [ path ] ftype: description: @@ -41,7 +41,7 @@ options: description: - SELinux type for the specified target. type: str - required: yes + required: true seuser: description: - SELinux user for the specified target. @@ -62,12 +62,12 @@ options: - Reload SELinux policy after commit. - Note that this does not apply SELinux file contexts to existing files. type: bool - default: yes + default: true ignore_selinux_state: description: - Useful for scenarios (chrooted environment) that you can't get the real SELinux state. type: bool - default: no + default: false notes: - The changes are persistent across reboots. - The M(community.general.sefcontext) module does not modify existing files to the new diff --git a/plugins/modules/system/selinux_permissive.py b/plugins/modules/system/selinux_permissive.py index 30952e0aa7..2578519909 100644 --- a/plugins/modules/system/selinux_permissive.py +++ b/plugins/modules/system/selinux_permissive.py @@ -30,10 +30,10 @@ options: no_reload: description: - 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." type: bool - default: no + default: false store: description: - Name of the SELinux policy store to use. diff --git a/plugins/modules/system/selogin.py b/plugins/modules/system/selogin.py index 5d90961ab4..59222e073a 100644 --- a/plugins/modules/system/selogin.py +++ b/plugins/modules/system/selogin.py @@ -40,7 +40,7 @@ options: description: - Reload SELinux policy after commit. type: bool - default: yes + default: true ignore_selinux_state: description: - Run independent of selinux runtime state diff --git a/plugins/modules/system/seport.py b/plugins/modules/system/seport.py index 5420ce0fd7..65cf09e22d 100644 --- a/plugins/modules/system/seport.py +++ b/plugins/modules/system/seport.py @@ -43,12 +43,12 @@ options: description: - Reload SELinux policy after commit. type: bool - default: yes + default: true ignore_selinux_state: description: - Run independent of selinux runtime state type: bool - default: no + default: false notes: - The changes are persistent across reboots. - Not tested on any debian based system. diff --git a/plugins/modules/system/solaris_zone.py b/plugins/modules/system/solaris_zone.py index 502107e279..972d9cf2db 100644 --- a/plugins/modules/system/solaris_zone.py +++ b/plugins/modules/system/solaris_zone.py @@ -53,7 +53,7 @@ options: description: - Whether to create a sparse (C(true)) or whole root (C(false)) zone. type: bool - default: no + default: false root_password: description: - The password hash for the root account. If not specified, the zone's root account diff --git a/plugins/modules/system/sysupgrade.py b/plugins/modules/system/sysupgrade.py index bed9bad784..e597db975b 100644 --- a/plugins/modules/system/sysupgrade.py +++ b/plugins/modules/system/sysupgrade.py @@ -20,24 +20,24 @@ options: description: - Apply the latest snapshot. - Otherwise release will be applied. - default: no + default: false type: bool force: description: - Force upgrade (for snapshots only). - default: no + default: false type: bool keep_files: description: - Keep the files under /home/_sysupgrade. - By default, the files will be deleted after the upgrade. - default: no + default: false type: bool fetch_only: description: - 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. - default: yes + default: true type: bool installurl: description: @@ -55,7 +55,7 @@ EXAMPLES = r''' - name: Upgrade to latest snapshot community.general.sysupgrade: - snapshot: yes + snapshot: true installurl: https://cloudflare.cdn.openbsd.org/pub/OpenBSD register: sysupgrade @@ -68,8 +68,8 @@ EXAMPLES = r''' - name: Have sysupgrade automatically reboot community.general.sysupgrade: - fetch_only: no - ignore_errors: yes + fetch_only: false + ignore_errors: true ''' RETURN = r''' diff --git a/plugins/modules/system/ufw.py b/plugins/modules/system/ufw.py index c3b0fcd0fa..6d18f3f781 100644 --- a/plugins/modules/system/ufw.py +++ b/plugins/modules/system/ufw.py @@ -179,7 +179,7 @@ EXAMPLES = r''' - community.general.ufw: rule: reject port: auth - log: yes + log: true # ufw supports connection rate limiting, which is useful for protecting # against brute-force login attacks. ufw will deny connections if an IP @@ -192,7 +192,7 @@ EXAMPLES = r''' proto: tcp # 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) - community.general.ufw: rule: allow @@ -202,7 +202,7 @@ EXAMPLES = r''' community.general.ufw: rule: allow name: OpenSSH - delete: yes + delete: true - name: Deny all access to port 53 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 community.general.ufw: rule: deny - route: yes - src: 1.2.3.0/24 - dest: 4.5.6.0/24 + route: true + src: 192.0.2.0/24 + dest: 198.51.100.0/24 ''' import re diff --git a/plugins/modules/system/vdo.py b/plugins/modules/system/vdo.py index 8a51af385c..21e8a96100 100644 --- a/plugins/modules/system/vdo.py +++ b/plugins/modules/system/vdo.py @@ -48,7 +48,7 @@ options: activated: description: - 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 creation, a VDO volume with "activated" set to "off" will be running, until stopped. This is the default @@ -270,7 +270,7 @@ options: checks it is important to make sure that all parameters provided are accurate and intentional." type: bool - default: no + default: false version_added: 2.4.0 notes: - 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 # 'vdo start' command, by design. To accurately track changed # 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' # will have the activated status prior to the activate_vdo() # call. diff --git a/plugins/modules/system/xfconf.py b/plugins/modules/system/xfconf.py index 7a400d0797..aaf80d4db2 100644 --- a/plugins/modules/system/xfconf.py +++ b/plugins/modules/system/xfconf.py @@ -72,7 +72,7 @@ options: description: - Force array even if only one element type: bool - default: 'no' + default: false aliases: ['array'] version_added: 1.0.0 disable_facts: