From 247da9890b7f5d7a377b2176dacaef09a9e611bb Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2020 12:29:14 +0100 Subject: [PATCH] Fix boolean defaults. (#1343) (#1358) (cherry picked from commit a96f90ff94d5f633f2deb47390d1c58e90048f61) Co-authored-by: Felix Fontein --- plugins/doc_fragments/influxdb.py | 2 ++ plugins/doc_fragments/ovirt_facts.py | 1 + plugins/modules/cloud/docker/docker_volume.py | 1 - plugins/modules/cloud/google/gc_storage.py | 1 + plugins/modules/cloud/google/gce.py | 1 - plugins/modules/cloud/google/gce_pd.py | 2 -- plugins/modules/cloud/memset/memset_zone_record.py | 1 + plugins/modules/cloud/ovirt/ovirt_vm_facts.py | 1 + plugins/modules/cloud/rackspace/rax_clb.py | 2 +- plugins/modules/cloud/rackspace/rax_files.py | 2 ++ plugins/modules/cloud/rackspace/rax_mon_alarm.py | 1 + plugins/modules/cloud/rackspace/rax_mon_check.py | 1 + plugins/modules/clustering/consul/consul_kv.py | 1 - .../modules/database/influxdb/influxdb_retention_policy.py | 1 + plugins/modules/database/postgresql/postgresql_set.py | 2 +- plugins/modules/identity/ipa/ipa_host.py | 2 -- plugins/modules/net_tools/haproxy.py | 1 + plugins/modules/packaging/os/pkgutil.py | 1 + plugins/modules/packaging/os/redhat_subscription.py | 1 - plugins/modules/packaging/os/svr4pkg.py | 1 + plugins/modules/packaging/os/swupd.py | 2 ++ plugins/modules/storage/glusterfs/gluster_peer.py | 4 ++-- plugins/modules/storage/glusterfs/gluster_volume.py | 1 + plugins/modules/storage/netapp/na_cdot_license.py | 2 ++ plugins/modules/system/java_cert.py | 1 + plugins/modules/system/open_iscsi.py | 2 ++ plugins/modules/system/puppet.py | 3 +++ plugins/modules/system/svc.py | 1 - plugins/modules/system/ufw.py | 3 +++ plugins/modules/system/vdo.py | 1 + plugins/modules/web_infrastructure/django_manage.py | 2 +- 31 files changed, 34 insertions(+), 14 deletions(-) diff --git a/plugins/doc_fragments/influxdb.py b/plugins/doc_fragments/influxdb.py index 3ed208f3cb..a31c84cbb1 100644 --- a/plugins/doc_fragments/influxdb.py +++ b/plugins/doc_fragments/influxdb.py @@ -53,6 +53,7 @@ options: description: - Use https instead of http to connect to InfluxDB server. type: bool + default: false timeout: description: - Number of seconds Requests will wait for client to establish a connection. @@ -68,6 +69,7 @@ options: description: - Use UDP to connect to InfluxDB server. type: bool + default: false udp_port: description: - UDP port to connect to InfluxDB server. diff --git a/plugins/doc_fragments/ovirt_facts.py b/plugins/doc_fragments/ovirt_facts.py index 99d79d9db1..43b9b37b0c 100644 --- a/plugins/doc_fragments/ovirt_facts.py +++ b/plugins/doc_fragments/ovirt_facts.py @@ -19,6 +19,7 @@ options: Only the attributes of the current entity. User can configure to fetch other attributes of the nested entities by specifying C(nested_attributes). type: bool + default: false nested_attributes: description: - Specifies list of the attributes which should be fetched from the API. diff --git a/plugins/modules/cloud/docker/docker_volume.py b/plugins/modules/cloud/docker/docker_volume.py index 60af4b997c..dca92df527 100644 --- a/plugins/modules/cloud/docker/docker_volume.py +++ b/plugins/modules/cloud/docker/docker_volume.py @@ -48,7 +48,6 @@ options: - Deprecated. Will be removed in community.general 2.0.0. Set I(recreate) to C(options-changed) instead for the same behavior of setting I(force) to C(yes). type: bool - default: no recreate: description: diff --git a/plugins/modules/cloud/google/gc_storage.py b/plugins/modules/cloud/google/gc_storage.py index 5098ca224d..52ca18fae7 100644 --- a/plugins/modules/cloud/google/gc_storage.py +++ b/plugins/modules/cloud/google/gc_storage.py @@ -86,6 +86,7 @@ options: description: - Whether versioning is enabled or disabled (note that once versioning is enabled, it can only be suspended) type: bool + default: false requirements: - "python >= 2.6" diff --git a/plugins/modules/cloud/google/gce.py b/plugins/modules/cloud/google/gce.py index acc2f13953..7e65878612 100644 --- a/plugins/modules/cloud/google/gce.py +++ b/plugins/modules/cloud/google/gce.py @@ -148,7 +148,6 @@ options: - if set to C(yes), instances will be preemptible and time-limited. (requires libcloud >= 0.20.0) type: bool - default: 'no' disk_size: type: int description: diff --git a/plugins/modules/cloud/google/gce_pd.py b/plugins/modules/cloud/google/gce_pd.py index bd04eb1f5b..7e60285f5d 100644 --- a/plugins/modules/cloud/google/gce_pd.py +++ b/plugins/modules/cloud/google/gce_pd.py @@ -21,7 +21,6 @@ options: description: - do not destroy the disk, merely detach it from an instance type: bool - default: 'no' instance_name: type: str description: @@ -87,7 +86,6 @@ options: description: - If C(yes), deletes the volume when instance is terminated type: bool - default: 'no' image_family: type: str description: diff --git a/plugins/modules/cloud/memset/memset_zone_record.py b/plugins/modules/cloud/memset/memset_zone_record.py index f7800f0634..981d2ac47c 100644 --- a/plugins/modules/cloud/memset/memset_zone_record.py +++ b/plugins/modules/cloud/memset/memset_zone_record.py @@ -56,6 +56,7 @@ options: type: str relative: type: bool + default: false description: - If set then the current domain is added onto the address field for C(CNAME), C(MX), C(NS) and C(SRV)record types. diff --git a/plugins/modules/cloud/ovirt/ovirt_vm_facts.py b/plugins/modules/cloud/ovirt/ovirt_vm_facts.py index 96f1483a62..a5182755e0 100644 --- a/plugins/modules/cloud/ovirt/ovirt_vm_facts.py +++ b/plugins/modules/cloud/ovirt/ovirt_vm_facts.py @@ -48,6 +48,7 @@ options: - "If I(true) all the attributes of the virtual machines should be included in the response." type: bool + default: false case_sensitive: description: - "If I(true) performed search will take case into account." diff --git a/plugins/modules/cloud/rackspace/rax_clb.py b/plugins/modules/cloud/rackspace/rax_clb.py index 60c7af3a31..5ff1e3140f 100644 --- a/plugins/modules/cloud/rackspace/rax_clb.py +++ b/plugins/modules/cloud/rackspace/rax_clb.py @@ -276,7 +276,7 @@ def main(): timeout=dict(type='int', default=30), type=dict(choices=['PUBLIC', 'SERVICENET'], default='PUBLIC'), vip_id=dict(), - wait=dict(type='bool'), + wait=dict(type='bool', default=False), wait_timeout=dict(type='int', default=300), ) ) diff --git a/plugins/modules/cloud/rackspace/rax_files.py b/plugins/modules/cloud/rackspace/rax_files.py index cbdc941798..7080cc2f84 100644 --- a/plugins/modules/cloud/rackspace/rax_files.py +++ b/plugins/modules/cloud/rackspace/rax_files.py @@ -34,10 +34,12 @@ options: Private containers, if previously made public, can have live objects available until the TTL on cached objects expires type: bool + default: false public: description: - Used to set a container as public, available via the Cloud Files CDN type: bool + default: false region: type: str description: diff --git a/plugins/modules/cloud/rackspace/rax_mon_alarm.py b/plugins/modules/cloud/rackspace/rax_mon_alarm.py index 7575e69183..8de26609db 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_alarm.py +++ b/plugins/modules/cloud/rackspace/rax_mon_alarm.py @@ -61,6 +61,7 @@ options: - If yes, create this alarm, but leave it in an inactive state. Defaults to no. type: bool + default: false metadata: type: dict description: diff --git a/plugins/modules/cloud/rackspace/rax_mon_check.py b/plugins/modules/cloud/rackspace/rax_mon_check.py index fa3aa74819..e04dfc7444 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_check.py +++ b/plugins/modules/cloud/rackspace/rax_mon_check.py @@ -93,6 +93,7 @@ options: description: - If "yes", ensure the check is created, but don't actually use it yet. type: bool + default: false metadata: type: dict description: diff --git a/plugins/modules/clustering/consul/consul_kv.py b/plugins/modules/clustering/consul/consul_kv.py index a11ccaf7b7..8d8d0b9a8a 100644 --- a/plugins/modules/clustering/consul/consul_kv.py +++ b/plugins/modules/clustering/consul/consul_kv.py @@ -55,7 +55,6 @@ options: - If the key represents a prefix, each entry with the prefix can be retrieved by setting this to C(yes). type: bool - default: 'no' retrieve: description: - If the I(state) is C(present) and I(value) is set, perform a diff --git a/plugins/modules/database/influxdb/influxdb_retention_policy.py b/plugins/modules/database/influxdb/influxdb_retention_policy.py index 355e4262da..0774915f3a 100644 --- a/plugins/modules/database/influxdb/influxdb_retention_policy.py +++ b/plugins/modules/database/influxdb/influxdb_retention_policy.py @@ -42,6 +42,7 @@ options: description: - Sets the retention policy as default retention policy. type: bool + default: false extends_documentation_fragment: - community.general.influxdb diff --git a/plugins/modules/database/postgresql/postgresql_set.py b/plugins/modules/database/postgresql/postgresql_set.py index f04ba7ed6f..737bded56e 100644 --- a/plugins/modules/database/postgresql/postgresql_set.py +++ b/plugins/modules/database/postgresql/postgresql_set.py @@ -289,7 +289,7 @@ def main(): name=dict(type='str', required=True), db=dict(type='str', aliases=['login_db']), value=dict(type='str'), - reset=dict(type='bool'), + reset=dict(type='bool', default=False), session_role=dict(type='str'), trust_input=dict(type='bool', default=True), ) diff --git a/plugins/modules/identity/ipa/ipa_host.py b/plugins/modules/identity/ipa/ipa_host.py index 8e2957d115..80892c01c0 100644 --- a/plugins/modules/identity/ipa/ipa_host.py +++ b/plugins/modules/identity/ipa/ipa_host.py @@ -76,11 +76,9 @@ options: description: - If set C("True") with state as C("absent"), then removes DNS records of the host managed by FreeIPA DNS. - This option has no effect for states other than "absent". - default: false type: bool random_password: description: Generate a random password to be used in bulk enrollment. - default: False type: bool extends_documentation_fragment: - community.general.ipa.documentation diff --git a/plugins/modules/net_tools/haproxy.py b/plugins/modules/net_tools/haproxy.py index 1ed8c9843f..848cc1faeb 100644 --- a/plugins/modules/net_tools/haproxy.py +++ b/plugins/modules/net_tools/haproxy.py @@ -35,6 +35,7 @@ options: - Continue only after the status changes to 'MAINT'. - This overrides the shutdown_sessions option. type: bool + default: false host: description: - Name of the backend host to change. diff --git a/plugins/modules/packaging/os/pkgutil.py b/plugins/modules/packaging/os/pkgutil.py index 7e8e9a5de2..9ec0ebaad6 100644 --- a/plugins/modules/packaging/os/pkgutil.py +++ b/plugins/modules/packaging/os/pkgutil.py @@ -54,6 +54,7 @@ options: - To allow the update process to downgrade packages to match what is present in the repository, set this to C(yes). - This is useful for rolling back to stable from testing, or similar operations. type: bool + default: false version_added: 1.2.0 notes: - In order to check the availability of packages, the catalog cache under C(/var/opt/csw/pkgutil) may be refreshed even in check mode. diff --git a/plugins/modules/packaging/os/redhat_subscription.py b/plugins/modules/packaging/os/redhat_subscription.py index 12832ad093..009eec4544 100644 --- a/plugins/modules/packaging/os/redhat_subscription.py +++ b/plugins/modules/packaging/os/redhat_subscription.py @@ -75,7 +75,6 @@ options: - Upon successful registration, auto-consume available subscriptions - Added in favor of deprecated autosubscribe in 2.5. type: bool - default: no aliases: [autosubscribe] activationkey: description: diff --git a/plugins/modules/packaging/os/svr4pkg.py b/plugins/modules/packaging/os/svr4pkg.py index adbebc8e7e..21d17f4de2 100644 --- a/plugins/modules/packaging/os/svr4pkg.py +++ b/plugins/modules/packaging/os/svr4pkg.py @@ -64,6 +64,7 @@ options: - Install/Remove category instead of a single package. required: false type: bool + default: false ''' EXAMPLES = ''' diff --git a/plugins/modules/packaging/os/swupd.py b/plugins/modules/packaging/os/swupd.py index ae61ebc193..4dac01be64 100644 --- a/plugins/modules/packaging/os/swupd.py +++ b/plugins/modules/packaging/os/swupd.py @@ -50,6 +50,7 @@ options: description: - Updates the OS to the latest version. type: bool + default: false url: description: - Overrides both I(contenturl) and I(versionurl). @@ -58,6 +59,7 @@ options: description: - Verify content for OS version. type: bool + default: false versionurl: description: - URL for version string download. diff --git a/plugins/modules/storage/glusterfs/gluster_peer.py b/plugins/modules/storage/glusterfs/gluster_peer.py index 23e24a0c92..b30b605021 100644 --- a/plugins/modules/storage/glusterfs/gluster_peer.py +++ b/plugins/modules/storage/glusterfs/gluster_peer.py @@ -35,7 +35,7 @@ options: required: true force: type: bool - default: "false" + default: false description: - Applicable only while removing the nodes from the pool. gluster will refuse to detach a node from the pool if any one of the node @@ -141,7 +141,7 @@ class Peer(object): def main(): module = AnsibleModule( argument_spec=dict( - force=dict(type='bool', required=False), + force=dict(type='bool', required=False, default=False), nodes=dict(type='list', required=True), state=dict(type='str', choices=['absent', 'present'], default='present'), diff --git a/plugins/modules/storage/glusterfs/gluster_volume.py b/plugins/modules/storage/glusterfs/gluster_volume.py index 56126a1ab6..d6444ef573 100644 --- a/plugins/modules/storage/glusterfs/gluster_volume.py +++ b/plugins/modules/storage/glusterfs/gluster_volume.py @@ -78,6 +78,7 @@ options: - If brick is being created in the root partition, module will fail. Set force to true to override this behaviour. type: bool + default: false notes: - Requires cli tools for GlusterFS on servers. - Will add new bricks, but not remove them. diff --git a/plugins/modules/storage/netapp/na_cdot_license.py b/plugins/modules/storage/netapp/na_cdot_license.py index bc70ff7c3f..36c5416a3b 100644 --- a/plugins/modules/storage/netapp/na_cdot_license.py +++ b/plugins/modules/storage/netapp/na_cdot_license.py @@ -31,11 +31,13 @@ options: description: - Remove licenses that have no controller affiliation in the cluster. type: bool + default: false remove_expired: description: - Remove licenses that have expired in the cluster. type: bool + default: false serial_number: description: diff --git a/plugins/modules/system/java_cert.py b/plugins/modules/system/java_cert.py index 8f56e2b426..7333397bfd 100644 --- a/plugins/modules/system/java_cert.py +++ b/plugins/modules/system/java_cert.py @@ -68,6 +68,7 @@ options: description: - Create keystore if it does not exist. type: bool + default: false keystore_type: description: - Keystore type (JCEKS, JKS). diff --git a/plugins/modules/system/open_iscsi.py b/plugins/modules/system/open_iscsi.py index e5fecb9d99..222bb82f3d 100644 --- a/plugins/modules/system/open_iscsi.py +++ b/plugins/modules/system/open_iscsi.py @@ -65,10 +65,12 @@ options: to manual, hence combined with C(auto_node_startup=yes) will always return a changed state. type: bool + default: false show_nodes: description: - Whether the list of nodes in the persistent iSCSI database should be returned by the module. type: bool + default: false ''' EXAMPLES = r''' diff --git a/plugins/modules/system/puppet.py b/plugins/modules/system/puppet.py index 64b9d2aa60..db8c0ec8ef 100644 --- a/plugins/modules/system/puppet.py +++ b/plugins/modules/system/puppet.py @@ -80,14 +80,17 @@ options: description: - Whether to print a transaction summary. type: bool + default: false verbose: description: - Print extra information. type: bool + default: false debug: description: - Enable full debugging. type: bool + default: false requirements: - puppet author: diff --git a/plugins/modules/system/svc.py b/plugins/modules/system/svc.py index 5eaf965ed1..e921567074 100644 --- a/plugins/modules/system/svc.py +++ b/plugins/modules/system/svc.py @@ -36,7 +36,6 @@ options: - Should a 'down' file exist or not, if it exists it disables auto startup. Defaults to no. Downed does not imply stopped. type: bool - default: no enabled: description: - Whether the service is enabled or not, if disabled it also implies stopped. diff --git a/plugins/modules/system/ufw.py b/plugins/modules/system/ufw.py index eb3d5d69c8..c6df6fe63a 100644 --- a/plugins/modules/system/ufw.py +++ b/plugins/modules/system/ufw.py @@ -84,6 +84,7 @@ options: description: - Log new connections matched to this rule type: bool + default: false from_ip: description: - Source IP address. @@ -120,6 +121,7 @@ options: description: - Delete rule. type: bool + default: false interface: description: - Specify interface for the rule. The direction (in or out) used @@ -149,6 +151,7 @@ options: description: - Apply the rule to routed/forwarded packets. type: bool + default: false comment: description: - Add a comment to the rule. Requires UFW version >=0.35. diff --git a/plugins/modules/system/vdo.py b/plugins/modules/system/vdo.py index bbb73b3148..15fd9c62b8 100644 --- a/plugins/modules/system/vdo.py +++ b/plugins/modules/system/vdo.py @@ -148,6 +148,7 @@ options: a new volume, and cannot be changed for an existing volume. type: bool + default: false growphysical: description: - Specifies whether to attempt to execute a growphysical diff --git a/plugins/modules/web_infrastructure/django_manage.py b/plugins/modules/web_infrastructure/django_manage.py index 682406a4a2..10161c0426 100644 --- a/plugins/modules/web_infrastructure/django_manage.py +++ b/plugins/modules/web_infrastructure/django_manage.py @@ -270,7 +270,7 @@ def main(): apps=dict(default=None, required=False), cache_table=dict(default=None, required=False, type='str'), - clear=dict(default=None, required=False, type='bool'), + clear=dict(default=False, required=False, type='bool'), database=dict(default=None, required=False, type='str'), failfast=dict(default=False, required=False, type='bool', aliases=['fail_fast']), fixtures=dict(default=None, required=False, type='str'),