From 3bb7a77b149108f1cd5e177a4f6bee374f47bc9c Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:46:32 +1200 Subject: [PATCH] arg_spec adjustments: modules [o-s]* (#10512) * arg_spec adjustments: modules [o-s]* * add changelog frag --- changelogs/fragments/10512-rfdn-4.yml | 42 +++++++++++++++++++++ plugins/modules/oci_vcn.py | 17 +++------ plugins/modules/one_image_info.py | 4 +- plugins/modules/one_template.py | 8 ++-- plugins/modules/one_vnet.py | 6 +-- plugins/modules/onepassword_info.py | 2 +- plugins/modules/oneview_fc_network_info.py | 4 +- plugins/modules/opendj_backendprop.py | 6 +-- plugins/modules/ovh_monthly_billing.py | 8 ++-- plugins/modules/pagerduty.py | 16 ++++---- plugins/modules/pagerduty_change.py | 17 ++++----- plugins/modules/pagerduty_user.py | 2 +- plugins/modules/pam_limits.py | 2 +- plugins/modules/pear.py | 4 +- plugins/modules/pkgng.py | 16 ++++---- plugins/modules/pnpm.py | 10 ++--- plugins/modules/portage.py | 14 +++---- plugins/modules/pritunl_org.py | 6 +-- plugins/modules/pritunl_org_info.py | 2 +- plugins/modules/pritunl_user.py | 18 ++++----- plugins/modules/pritunl_user_info.py | 8 +--- plugins/modules/pubnub_blocks.py | 6 +-- plugins/modules/pushbullet.py | 8 ++-- plugins/modules/pushover.py | 2 +- plugins/modules/redis_data.py | 10 ++--- plugins/modules/redis_data_incr.py | 4 +- plugins/modules/riak.py | 10 ++--- plugins/modules/rocketchat.py | 4 +- plugins/modules/rollbar_deployment.py | 11 ++---- plugins/modules/say.py | 2 +- plugins/modules/scaleway_database_backup.py | 4 +- plugins/modules/sendgrid.py | 18 ++++----- plugins/modules/sensu_silence.py | 12 +++--- plugins/modules/sorcery.py | 6 +-- plugins/modules/ssh_config.py | 24 +++++------- plugins/modules/statusio_maintenance.py | 40 ++++++++------------ plugins/modules/svr4pkg.py | 8 ++-- plugins/modules/swdepot.py | 2 +- plugins/modules/syslogger.py | 6 +-- plugins/modules/sysrc.py | 4 +- plugins/modules/systemd_creds_decrypt.py | 14 +++---- plugins/modules/systemd_creds_encrypt.py | 8 ++-- 42 files changed, 210 insertions(+), 205 deletions(-) create mode 100644 changelogs/fragments/10512-rfdn-4.yml diff --git a/changelogs/fragments/10512-rfdn-4.yml b/changelogs/fragments/10512-rfdn-4.yml new file mode 100644 index 0000000000..6d8f9e7d77 --- /dev/null +++ b/changelogs/fragments/10512-rfdn-4.yml @@ -0,0 +1,42 @@ +minor_changes: + - oci_vcn - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - one_image_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - one_template - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - one_vnet - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - onepassword_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - oneview_fc_network_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - opendj_backendprop - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - ovh_monthly_billing - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pagerduty - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pagerduty_change - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pagerduty_user - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pam_limits - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pear - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pkgng - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pnpm - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - portage - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pritunl_org - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pritunl_org_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pritunl_user - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pritunl_user_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pubnub_blocks - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pushbullet - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - pushover - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - redis_data - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - redis_data_incr - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - riak - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - rocketchat - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - rollbar_deployment - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - say - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - scaleway_database_backup - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - sendgrid - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - sensu_silence - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - sorcery - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - ssh_config - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - statusio_maintenance - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - svr4pkg - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - swdepot - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - syslogger - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - sysrc - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - systemd_creds_decrypt - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). + - systemd_creds_encrypt - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512). diff --git a/plugins/modules/oci_vcn.py b/plugins/modules/oci_vcn.py index e44d2b0f20..56a637ac2c 100644 --- a/plugins/modules/oci_vcn.py +++ b/plugins/modules/oci_vcn.py @@ -162,17 +162,12 @@ def main(): ) module_args.update( dict( - cidr_block=dict(type="str", required=False), - compartment_id=dict(type="str", required=False), - display_name=dict(type="str", required=False, aliases=["name"]), - dns_label=dict(type="str", required=False), - state=dict( - type="str", - required=False, - default="present", - choices=["absent", "present"], - ), - vcn_id=dict(type="str", required=False, aliases=["id"]), + cidr_block=dict(type="str"), + compartment_id=dict(type="str"), + display_name=dict(type="str", aliases=["name"]), + dns_label=dict(type="str"), + state=dict(type="str", default="present", choices=["absent", "present"]), + vcn_id=dict(type="str", aliases=["id"]), ) ) diff --git a/plugins/modules/one_image_info.py b/plugins/modules/one_image_info.py index 248422b6ec..f940444cad 100644 --- a/plugins/modules/one_image_info.py +++ b/plugins/modules/one_image_info.py @@ -281,8 +281,8 @@ IMAGE_STATES = ['INIT', 'READY', 'USED', 'DISABLED', 'LOCKED', 'ERROR', 'CLONE', class ImageInfoModule(OpenNebulaModule): def __init__(self): argument_spec = dict( - ids=dict(type='list', aliases=['id'], elements='str', required=False), - name=dict(type='str', required=False), + ids=dict(type='list', aliases=['id'], elements='str'), + name=dict(type='str'), ) mutually_exclusive = [ ['ids', 'name'], diff --git a/plugins/modules/one_template.py b/plugins/modules/one_template.py index a9538b1cee..091c4c55a7 100644 --- a/plugins/modules/one_template.py +++ b/plugins/modules/one_template.py @@ -163,11 +163,11 @@ from ansible_collections.community.general.plugins.module_utils.opennebula impor class TemplateModule(OpenNebulaModule): def __init__(self): argument_spec = dict( - id=dict(type='int', required=False), - name=dict(type='str', required=False), + id=dict(type='int'), + name=dict(type='str'), state=dict(type='str', choices=['present', 'absent'], default='present'), - template=dict(type='str', required=False), - filter=dict(type='str', required=False, choices=['user_primary_group', 'user', 'all', 'user_groups'], default='user'), + template=dict(type='str'), + filter=dict(type='str', choices=['user_primary_group', 'user', 'all', 'user_groups'], default='user'), ) mutually_exclusive = [ diff --git a/plugins/modules/one_vnet.py b/plugins/modules/one_vnet.py index 6cf4d3e549..b77530e756 100644 --- a/plugins/modules/one_vnet.py +++ b/plugins/modules/one_vnet.py @@ -263,10 +263,10 @@ class NetworksModule(OpenNebulaModule): def __init__(self): argument_spec = dict( - id=dict(type='int', required=False), - name=dict(type='str', required=False), + id=dict(type='int'), + name=dict(type='str'), state=dict(type='str', choices=['present', 'absent'], default='present'), - template=dict(type='str', required=False), + template=dict(type='str'), ) mutually_exclusive = [ diff --git a/plugins/modules/onepassword_info.py b/plugins/modules/onepassword_info.py index 3028f8ccac..5689d28fe6 100644 --- a/plugins/modules/onepassword_info.py +++ b/plugins/modules/onepassword_info.py @@ -374,7 +374,7 @@ def main(): username=dict(type='str'), master_password=dict(required=True, type='str', no_log=True), secret_key=dict(type='str', no_log=True), - ), default=None), + )), search_terms=dict(required=True, type='list', elements='dict'), ), supports_check_mode=True diff --git a/plugins/modules/oneview_fc_network_info.py b/plugins/modules/oneview_fc_network_info.py index af20869dc3..9de22ef55c 100644 --- a/plugins/modules/oneview_fc_network_info.py +++ b/plugins/modules/oneview_fc_network_info.py @@ -87,8 +87,8 @@ class FcNetworkInfoModule(OneViewModuleBase): def __init__(self): argument_spec = dict( - name=dict(required=False, type='str'), - params=dict(required=False, type='dict') + name=dict(type='str'), + params=dict(type='dict') ) super(FcNetworkInfoModule, self).__init__( diff --git a/plugins/modules/opendj_backendprop.py b/plugins/modules/opendj_backendprop.py index fbfb6eb915..be4edac125 100644 --- a/plugins/modules/opendj_backendprop.py +++ b/plugins/modules/opendj_backendprop.py @@ -153,9 +153,9 @@ def main(): opendj_bindir=dict(default="/opt/opendj/bin", type="path"), hostname=dict(required=True), port=dict(required=True), - username=dict(default="cn=Directory Manager", required=False), - password=dict(required=False, no_log=True), - passwordfile=dict(required=False, type="path"), + username=dict(default="cn=Directory Manager"), + password=dict(no_log=True), + passwordfile=dict(type="path"), backend=dict(required=True), name=dict(required=True), value=dict(required=True), diff --git a/plugins/modules/ovh_monthly_billing.py b/plugins/modules/ovh_monthly_billing.py index 438bf7db7f..912b697517 100644 --- a/plugins/modules/ovh_monthly_billing.py +++ b/plugins/modules/ovh_monthly_billing.py @@ -98,10 +98,10 @@ def main(): argument_spec=dict( project_id=dict(required=True), instance_id=dict(required=True), - endpoint=dict(required=False), - application_key=dict(required=False, no_log=True), - application_secret=dict(required=False, no_log=True), - consumer_key=dict(required=False, no_log=True), + endpoint=dict(), + application_key=dict(no_log=True), + application_secret=dict(no_log=True), + consumer_key=dict(no_log=True), ), supports_check_mode=True ) diff --git a/plugins/modules/pagerduty.py b/plugins/modules/pagerduty.py index 36dd95c600..78443e8410 100644 --- a/plugins/modules/pagerduty.py +++ b/plugins/modules/pagerduty.py @@ -242,15 +242,15 @@ def main(): module = AnsibleModule( argument_spec=dict( state=dict(required=True, choices=['running', 'started', 'ongoing', 'absent']), - name=dict(required=False), - user=dict(required=False), + name=dict(), + user=dict(), token=dict(required=True, no_log=True), - service=dict(required=False, type='list', elements='str', aliases=["services"]), - window_id=dict(required=False), - requester_id=dict(required=False), - hours=dict(default='1', required=False), # @TODO change to int? - minutes=dict(default='0', required=False), # @TODO change to int? - desc=dict(default='Created by Ansible', required=False), + service=dict(type='list', elements='str', aliases=["services"]), + window_id=dict(), + requester_id=dict(), + hours=dict(default='1'), # @TODO change to int? + minutes=dict(default='0'), # @TODO change to int? + desc=dict(default='Created by Ansible'), validate_certs=dict(default=True, type='bool'), ) ) diff --git a/plugins/modules/pagerduty_change.py b/plugins/modules/pagerduty_change.py index aaa4387f50..de77016969 100644 --- a/plugins/modules/pagerduty_change.py +++ b/plugins/modules/pagerduty_change.py @@ -121,15 +121,14 @@ def main(): argument_spec=dict( integration_key=dict(required=True, type='str', no_log=True), summary=dict(required=True, type='str'), - source=dict(required=False, default='Ansible', type='str'), - user=dict(required=False, type='str'), - repo=dict(required=False, type='str'), - revision=dict(required=False, type='str'), - environment=dict(required=False, type='str'), - link_url=dict(required=False, type='str'), - link_text=dict(required=False, type='str'), - url=dict(required=False, - default='https://events.pagerduty.com/v2/change/enqueue', type='str'), + source=dict(default='Ansible', type='str'), + user=dict(type='str'), + repo=dict(type='str'), + revision=dict(type='str'), + environment=dict(type='str'), + link_url=dict(type='str'), + link_text=dict(type='str'), + url=dict(default='https://events.pagerduty.com/v2/change/enqueue', type='str'), validate_certs=dict(default=True, type='bool') ), supports_check_mode=True diff --git a/plugins/modules/pagerduty_user.py b/plugins/modules/pagerduty_user.py index e03342c792..0830af97f3 100644 --- a/plugins/modules/pagerduty_user.py +++ b/plugins/modules/pagerduty_user.py @@ -188,7 +188,7 @@ def main(): state=dict(type='str', default='present', choices=['present', 'absent']), pd_role=dict(type='str', default='responder', choices=['global_admin', 'manager', 'responder', 'observer', 'stakeholder', 'limited_stakeholder', 'restricted_access']), - pd_teams=dict(type='list', elements='str', required=False)), + pd_teams=dict(type='list', elements='str')), required_if=[['state', 'present', ['pd_teams']], ], supports_check_mode=True, ) diff --git a/plugins/modules/pam_limits.py b/plugins/modules/pam_limits.py index b1cb76d9fa..536ba59662 100644 --- a/plugins/modules/pam_limits.py +++ b/plugins/modules/pam_limits.py @@ -183,7 +183,7 @@ def main(): use_min=dict(default=False, type='bool'), backup=dict(default=False, type='bool'), dest=dict(default=limits_conf, type='str'), - comment=dict(required=False, default='', type='str') + comment=dict(default='', type='str') ), supports_check_mode=True, ) diff --git a/plugins/modules/pear.py b/plugins/modules/pear.py index 49dcfc5ce0..5eb84b509d 100644 --- a/plugins/modules/pear.py +++ b/plugins/modules/pear.py @@ -293,8 +293,8 @@ def main(): argument_spec=dict( name=dict(aliases=['pkg'], required=True), state=dict(default='present', choices=['present', 'installed', "latest", 'absent', 'removed']), - executable=dict(default=None, required=False, type='path'), - prompts=dict(default=None, required=False, type='list', elements='raw'), + executable=dict(type='path'), + prompts=dict(type='list', elements='raw'), ), supports_check_mode=True) diff --git a/plugins/modules/pkgng.py b/plugins/modules/pkgng.py index 4bae02e8b5..58eafb9e0c 100644 --- a/plugins/modules/pkgng.py +++ b/plugins/modules/pkgng.py @@ -422,17 +422,17 @@ def autoremove_packages(module, run_pkgng): def main(): module = AnsibleModule( argument_spec=dict( - state=dict(default="present", choices=["present", "latest", "absent"], required=False), + state=dict(default="present", choices=["present", "latest", "absent"]), name=dict(aliases=["pkg"], required=True, type='list', elements='str'), cached=dict(default=False, type='bool'), - ignore_osver=dict(default=False, required=False, type='bool'), - annotation=dict(required=False, type='list', elements='str'), - pkgsite=dict(required=False), - rootdir=dict(required=False, type='path'), - chroot=dict(required=False, type='path'), - jail=dict(required=False, type='str'), + ignore_osver=dict(default=False, type='bool'), + annotation=dict(type='list', elements='str'), + pkgsite=dict(), + rootdir=dict(type='path'), + chroot=dict(type='path'), + jail=dict(type='str'), autoremove=dict(default=False, type='bool'), - use_globs=dict(default=True, required=False, type='bool'), + use_globs=dict(default=True, type='bool'), ), supports_check_mode=True, mutually_exclusive=[["rootdir", "chroot", "jail"]]) diff --git a/plugins/modules/pnpm.py b/plugins/modules/pnpm.py index d213220a02..2dad63a608 100644 --- a/plugins/modules/pnpm.py +++ b/plugins/modules/pnpm.py @@ -339,11 +339,11 @@ class Pnpm(object): def main(): arg_spec = dict( - name=dict(default=None), - alias=dict(default=None), - path=dict(default=None, type="path"), - version=dict(default=None), - executable=dict(default=None, type="path"), + name=dict(), + alias=dict(), + path=dict(type="path"), + version=dict(), + executable=dict(type="path"), ignore_scripts=dict(default=False, type="bool"), no_optional=dict(default=False, type="bool"), production=dict(default=False, type="bool"), diff --git a/plugins/modules/portage.py b/plugins/modules/portage.py index 1404b00a90..8a00b934dd 100644 --- a/plugins/modules/portage.py +++ b/plugins/modules/portage.py @@ -510,13 +510,13 @@ portage_absent_states = ['absent', 'unmerged', 'removed'] def main(): module = AnsibleModule( argument_spec=dict( - package=dict(type='list', elements='str', default=None, aliases=['name']), + package=dict(type='list', elements='str', aliases=['name']), state=dict( default=portage_present_states[0], choices=portage_present_states + portage_absent_states, ), update=dict(default=False, type='bool'), - backtrack=dict(default=None, type='int'), + backtrack=dict(type='int'), deep=dict(default=False, type='bool'), newuse=dict(default=False, type='bool'), changed_use=dict(default=False, type='bool'), @@ -525,18 +525,18 @@ def main(): nodeps=dict(default=False, type='bool'), onlydeps=dict(default=False, type='bool'), depclean=dict(default=False, type='bool'), - select=dict(default=None, type='bool'), + select=dict(type='bool'), quiet=dict(default=False, type='bool'), verbose=dict(default=False, type='bool'), - sync=dict(default=None, choices=['yes', 'web', 'no']), + sync=dict(choices=['yes', 'web', 'no']), getbinpkgonly=dict(default=False, type='bool'), getbinpkg=dict(default=False, type='bool'), usepkgonly=dict(default=False, type='bool'), usepkg=dict(default=False, type='bool'), keepgoing=dict(default=False, type='bool'), - jobs=dict(default=None, type='int'), - loadavg=dict(default=None, type='float'), - withbdeps=dict(default=None, type='bool'), + jobs=dict(type='int'), + loadavg=dict(type='float'), + withbdeps=dict(type='bool'), quietbuild=dict(default=False, type='bool'), quietfail=dict(default=False, type='bool'), ), diff --git a/plugins/modules/pritunl_org.py b/plugins/modules/pritunl_org.py index 7c7c2560b3..f87813031b 100644 --- a/plugins/modules/pritunl_org.py +++ b/plugins/modules/pritunl_org.py @@ -176,10 +176,8 @@ def main(): argument_spec.update( dict( name=dict(required=True, type="str", aliases=["org"]), - force=dict(required=False, type="bool", default=False), - state=dict( - required=False, choices=["present", "absent"], default="present" - ), + force=dict(type="bool", default=False), + state=dict(choices=["present", "absent"], default="present"), ) ) diff --git a/plugins/modules/pritunl_org_info.py b/plugins/modules/pritunl_org_info.py index 4618de0ee0..952acd8963 100644 --- a/plugins/modules/pritunl_org_info.py +++ b/plugins/modules/pritunl_org_info.py @@ -113,7 +113,7 @@ def main(): argument_spec.update( dict( - organization=dict(required=False, type="str", default=None, aliases=["org"]) + organization=dict(type="str", aliases=["org"]) ) ) diff --git a/plugins/modules/pritunl_user.py b/plugins/modules/pritunl_user.py index c8cc9ea9c6..45de07eba6 100644 --- a/plugins/modules/pritunl_user.py +++ b/plugins/modules/pritunl_user.py @@ -320,18 +320,14 @@ def main(): argument_spec.update( dict( organization=dict(required=True, type="str", aliases=["org"]), - state=dict( - required=False, choices=["present", "absent"], default="present" - ), + state=dict(choices=["present", "absent"], default="present"), user_name=dict(required=True, type="str"), - user_type=dict( - required=False, choices=["client", "server"], default="client" - ), - user_email=dict(required=False, type="str", default=None), - user_groups=dict(required=False, type="list", elements="str", default=None), - user_disabled=dict(required=False, type="bool", default=None), - user_gravatar=dict(required=False, type="bool", default=None), - user_mac_addresses=dict(required=False, type="list", elements="str", default=None), + user_type=dict(choices=["client", "server"], default="client"), + user_email=dict(type="str"), + user_groups=dict(type="list", elements="str"), + user_disabled=dict(type="bool"), + user_gravatar=dict(type="bool"), + user_mac_addresses=dict(type="list", elements="str"), ) ) diff --git a/plugins/modules/pritunl_user_info.py b/plugins/modules/pritunl_user_info.py index 93786b166d..2e8180675a 100644 --- a/plugins/modules/pritunl_user_info.py +++ b/plugins/modules/pritunl_user_info.py @@ -151,12 +151,8 @@ def main(): argument_spec.update( dict( organization=dict(required=True, type="str", aliases=["org"]), - user_name=dict(required=False, type="str", default=None), - user_type=dict( - required=False, - choices=["client", "server"], - default="client", - ), + user_name=dict(type="str"), + user_type=dict(choices=["client", "server"], default="client"), ) ) diff --git a/plugins/modules/pubnub_blocks.py b/plugins/modules/pubnub_blocks.py index 0eabae8ca9..316fced4be 100644 --- a/plugins/modules/pubnub_blocks.py +++ b/plugins/modules/pubnub_blocks.py @@ -532,9 +532,9 @@ def _content_of_file_at_path(path): def main(): fields = dict( - email=dict(default='', required=False, type='str'), - password=dict(default='', required=False, type='str', no_log=True), - account=dict(default='', required=False, type='str'), + email=dict(default='', type='str'), + password=dict(default='', type='str', no_log=True), + account=dict(default='', type='str'), application=dict(required=True, type='str'), keyset=dict(required=True, type='str', no_log=False), state=dict(default='present', type='str', diff --git a/plugins/modules/pushbullet.py b/plugins/modules/pushbullet.py index 2f13f1dee2..990ac36525 100644 --- a/plugins/modules/pushbullet.py +++ b/plugins/modules/pushbullet.py @@ -114,12 +114,12 @@ def main(): module = AnsibleModule( argument_spec=dict( api_key=dict(type='str', required=True, no_log=True), - channel=dict(type='str', default=None), - device=dict(type='str', default=None), + channel=dict(type='str'), + device=dict(type='str'), push_type=dict(type='str', default="note", choices=['note', 'link']), title=dict(type='str', required=True), - body=dict(type='str', default=None), - url=dict(type='str', default=None), + body=dict(type='str'), + url=dict(type='str'), ), mutually_exclusive=( ['channel', 'device'], diff --git a/plugins/modules/pushover.py b/plugins/modules/pushover.py index fc1f970a61..dcfce34a06 100644 --- a/plugins/modules/pushover.py +++ b/plugins/modules/pushover.py @@ -140,7 +140,7 @@ def main(): msg=dict(required=True), app_token=dict(required=True, no_log=True), user_key=dict(required=True, no_log=True), - pri=dict(required=False, default='0', choices=['-2', '-1', '0', '1', '2']), + pri=dict(default='0', choices=['-2', '-1', '0', '1', '2']), device=dict(type='str'), ), ) diff --git a/plugins/modules/redis_data.py b/plugins/modules/redis_data.py index f8b0c75a3d..4efe409b72 100644 --- a/plugins/modules/redis_data.py +++ b/plugins/modules/redis_data.py @@ -143,11 +143,11 @@ def main(): redis_auth_args = redis_auth_argument_spec() module_args = dict( key=dict(type='str', required=True, no_log=False), - value=dict(type='str', required=False), - expiration=dict(type='int', required=False), - non_existing=dict(type='bool', required=False), - existing=dict(type='bool', required=False), - keep_ttl=dict(type='bool', required=False), + value=dict(type='str'), + expiration=dict(type='int'), + non_existing=dict(type='bool'), + existing=dict(type='bool'), + keep_ttl=dict(type='bool'), state=dict(type='str', default='present', choices=['present', 'absent']), ) diff --git a/plugins/modules/redis_data_incr.py b/plugins/modules/redis_data_incr.py index b0d339c3c0..d5f2fe05c2 100644 --- a/plugins/modules/redis_data_incr.py +++ b/plugins/modules/redis_data_incr.py @@ -98,8 +98,8 @@ def main(): redis_auth_args = redis_auth_argument_spec() module_args = dict( key=dict(type='str', required=True, no_log=False), - increment_int=dict(type='int', required=False), - increment_float=dict(type='float', required=False), + increment_int=dict(type='int'), + increment_float=dict(type='float'), ) module_args.update(redis_auth_args) diff --git a/plugins/modules/riak.py b/plugins/modules/riak.py index abd6e185d9..2009ca0a22 100644 --- a/plugins/modules/riak.py +++ b/plugins/modules/riak.py @@ -103,15 +103,13 @@ def main(): module = AnsibleModule( argument_spec=dict( - command=dict(required=False, default=None, choices=[ - 'ping', 'kv_test', 'join', 'plan', 'commit']), + command=dict(choices=['ping', 'kv_test', 'join', 'plan', 'commit']), config_dir=dict(default='/etc/riak', type='path'), - http_conn=dict(required=False, default='127.0.0.1:8098'), - target_node=dict(default='riak@127.0.0.1', required=False), + http_conn=dict(default='127.0.0.1:8098'), + target_node=dict(default='riak@127.0.0.1'), wait_for_handoffs=dict(default=0, type='int'), wait_for_ring=dict(default=0, type='int'), - wait_for_service=dict( - required=False, default=None, choices=['kv']), + wait_for_service=dict(choices=['kv']), validate_certs=dict(default=True, type='bool')) ) diff --git a/plugins/modules/rocketchat.py b/plugins/modules/rocketchat.py index 77a6ac95d7..6da9b36e8d 100644 --- a/plugins/modules/rocketchat.py +++ b/plugins/modules/rocketchat.py @@ -221,7 +221,7 @@ def main(): domain=dict(type='str', required=True), token=dict(type='str', required=True, no_log=True), protocol=dict(type='str', default='https', choices=['http', 'https']), - msg=dict(type='str', required=False), + msg=dict(type='str'), channel=dict(type='str'), username=dict(type='str', default='Ansible'), icon_url=dict(type='str', default='https://docs.ansible.com/favicon.ico'), @@ -229,7 +229,7 @@ def main(): link_names=dict(type='int', default=1, choices=[0, 1]), validate_certs=dict(default=True, type='bool'), color=dict(type='str', default='normal', choices=['normal', 'good', 'warning', 'danger']), - attachments=dict(type='list', elements='dict', required=False), + attachments=dict(type='list', elements='dict'), is_pre740=dict(default=True, type='bool') ) ) diff --git a/plugins/modules/rollbar_deployment.py b/plugins/modules/rollbar_deployment.py index e7f8b6387f..e0cf4e31aa 100644 --- a/plugins/modules/rollbar_deployment.py +++ b/plugins/modules/rollbar_deployment.py @@ -100,13 +100,10 @@ def main(): token=dict(required=True, no_log=True), environment=dict(required=True), revision=dict(required=True), - user=dict(required=False), - rollbar_user=dict(required=False), - comment=dict(required=False), - url=dict( - required=False, - default='https://api.rollbar.com/api/1/deploy/' - ), + user=dict(), + rollbar_user=dict(), + comment=dict(), + url=dict(default='https://api.rollbar.com/api/1/deploy/'), validate_certs=dict(default=True, type='bool'), ), supports_check_mode=True diff --git a/plugins/modules/say.py b/plugins/modules/say.py index 5be37e6f20..eff582f125 100644 --- a/plugins/modules/say.py +++ b/plugins/modules/say.py @@ -67,7 +67,7 @@ def main(): module = AnsibleModule( argument_spec=dict( msg=dict(required=True), - voice=dict(required=False), + voice=dict(), ), supports_check_mode=True ) diff --git a/plugins/modules/scaleway_database_backup.py b/plugins/modules/scaleway_database_backup.py index d952452daf..48add5dfc6 100644 --- a/plugins/modules/scaleway_database_backup.py +++ b/plugins/modules/scaleway_database_backup.py @@ -354,8 +354,8 @@ def main(): region=dict(required=True, choices=SCALEWAY_REGIONS), id=dict(), name=dict(type='str'), - database_name=dict(required=False), - instance_id=dict(required=False), + database_name=dict(), + instance_id=dict(), expires_at=dict(), wait=dict(type='bool', default=False), wait_timeout=dict(type='int', default=300), diff --git a/plugins/modules/sendgrid.py b/plugins/modules/sendgrid.py index ba2562d90c..c0e4b239bc 100644 --- a/plugins/modules/sendgrid.py +++ b/plugins/modules/sendgrid.py @@ -214,19 +214,19 @@ def post_sendgrid_api(module, username, password, from_address, to_addresses, def main(): module = AnsibleModule( argument_spec=dict( - username=dict(required=False), - password=dict(required=False, no_log=True), - api_key=dict(required=False, no_log=True), - bcc=dict(required=False, type='list', elements='str'), - cc=dict(required=False, type='list', elements='str'), - headers=dict(required=False, type='dict'), + username=dict(), + password=dict(no_log=True), + api_key=dict(no_log=True), + bcc=dict(type='list', elements='str'), + cc=dict(type='list', elements='str'), + headers=dict(type='dict'), from_address=dict(required=True), - from_name=dict(required=False), + from_name=dict(), to_addresses=dict(required=True, type='list', elements='str'), subject=dict(required=True), body=dict(required=True), - html_body=dict(required=False, default=False, type='bool'), - attachments=dict(required=False, type='list', elements='path') + html_body=dict(default=False, type='bool'), + attachments=dict(type='list', elements='path') ), supports_check_mode=True, mutually_exclusive=[ diff --git a/plugins/modules/sensu_silence.py b/plugins/modules/sensu_silence.py index 12a5f872b9..91e6f63496 100644 --- a/plugins/modules/sensu_silence.py +++ b/plugins/modules/sensu_silence.py @@ -265,14 +265,14 @@ def create( def main(): module = AnsibleModule( argument_spec=dict( - check=dict(required=False), - creator=dict(required=False), - expire=dict(type='int', required=False), - expire_on_resolve=dict(type='bool', required=False), - reason=dict(required=False), + check=dict(), + creator=dict(), + expire=dict(type='int'), + expire_on_resolve=dict(type='bool'), + reason=dict(), state=dict(default='present', choices=['present', 'absent']), subscription=dict(required=True), - url=dict(required=False, default='http://127.0.01:4567'), + url=dict(default='http://127.0.01:4567'), ), supports_check_mode=True ) diff --git a/plugins/modules/sorcery.py b/plugins/modules/sorcery.py index 8af9b6bc18..de50741185 100644 --- a/plugins/modules/sorcery.py +++ b/plugins/modules/sorcery.py @@ -697,11 +697,11 @@ def manage_spells(module): def main(): module = AnsibleModule( argument_spec=dict( - name=dict(default=None, aliases=['spell', 'grimoire'], type='list', elements='str'), - repository=dict(default=None, type='str'), + name=dict(aliases=['spell', 'grimoire'], type='list', elements='str'), + repository=dict(type='str'), state=dict(default='present', choices=['present', 'latest', 'absent', 'cast', 'dispelled', 'rebuild']), - depends=dict(default=None), + depends=dict(), update=dict(default=False, type='bool'), update_cache=dict(default=False, aliases=['update_codex'], type='bool'), cache_valid_time=dict(default=0, type='int') diff --git a/plugins/modules/ssh_config.py b/plugins/modules/ssh_config.py index 39e316993e..6a83095f37 100644 --- a/plugins/modules/ssh_config.py +++ b/plugins/modules/ssh_config.py @@ -390,7 +390,7 @@ class SSHConfig(object): def main(): module = AnsibleModule( argument_spec=dict( - group=dict(default=None, type='str'), + group=dict(type='str'), host=dict(type='str', required=True), hostname=dict(type='str'), host_key_algorithms=dict(type='str', no_log=False), @@ -398,24 +398,20 @@ def main(): identities_only=dict(type='bool'), other_options=dict(type='dict'), port=dict(type='str'), - proxycommand=dict(type='str', default=None), - proxyjump=dict(type='str', default=None), + proxycommand=dict(type='str'), + proxyjump=dict(type='str'), forward_agent=dict(type='bool'), add_keys_to_agent=dict(type='bool'), remote_user=dict(type='str'), - ssh_config_file=dict(default=None, type='path'), + ssh_config_file=dict(type='path'), state=dict(type='str', default='present', choices=['present', 'absent']), - strict_host_key_checking=dict( - type='str', - default=None, - choices=['yes', 'no', 'ask', 'accept-new'], - ), - controlmaster=dict(type='str', default=None, choices=['yes', 'no', 'ask', 'auto', 'autoask']), - controlpath=dict(type='str', default=None), - controlpersist=dict(type='str', default=None), + strict_host_key_checking=dict(type='str', choices=['yes', 'no', 'ask', 'accept-new']), + controlmaster=dict(type='str', choices=['yes', 'no', 'ask', 'auto', 'autoask']), + controlpath=dict(type='str'), + controlpersist=dict(type='str'), dynamicforward=dict(type='str'), - user=dict(default=None, type='str'), - user_known_hosts_file=dict(type='str', default=None), + user=dict(type='str'), + user_known_hosts_file=dict(type='str'), ), supports_check_mode=True, mutually_exclusive=[ diff --git a/plugins/modules/statusio_maintenance.py b/plugins/modules/statusio_maintenance.py index 31304bb6b7..c823a286c5 100644 --- a/plugins/modules/statusio_maintenance.py +++ b/plugins/modules/statusio_maintenance.py @@ -344,30 +344,22 @@ def main(): api_id=dict(required=True), api_key=dict(required=True, no_log=True), statuspage=dict(required=True), - state=dict(required=False, default='present', - choices=['present', 'absent']), - url=dict(default='https://api.status.io', required=False), - components=dict(type='list', elements='str', required=False, default=None, - aliases=['component']), - containers=dict(type='list', elements='str', required=False, default=None, - aliases=['container']), - all_infrastructure_affected=dict(type='bool', default=False, - required=False), - automation=dict(type='bool', default=False, required=False), - title=dict(required=False, default='A new maintenance window'), - desc=dict(required=False, default='Created by Ansible'), - minutes=dict(type='int', required=False, default=10), - maintenance_notify_now=dict(type='bool', default=False, - required=False), - maintenance_notify_72_hr=dict(type='bool', default=False, - required=False), - maintenance_notify_24_hr=dict(type='bool', default=False, - required=False), - maintenance_notify_1_hr=dict(type='bool', default=False, - required=False), - maintenance_id=dict(required=False, default=None), - start_date=dict(default=None, required=False), - start_time=dict(default=None, required=False) + state=dict(default='present', choices=['present', 'absent']), + url=dict(default='https://api.status.io'), + components=dict(type='list', elements='str', aliases=['component']), + containers=dict(type='list', elements='str', aliases=['container']), + all_infrastructure_affected=dict(type='bool', default=False), + automation=dict(type='bool', default=False), + title=dict(default='A new maintenance window'), + desc=dict(default='Created by Ansible'), + minutes=dict(type='int', default=10), + maintenance_notify_now=dict(type='bool', default=False), + maintenance_notify_72_hr=dict(type='bool', default=False), + maintenance_notify_24_hr=dict(type='bool', default=False), + maintenance_notify_1_hr=dict(type='bool', default=False), + maintenance_id=dict(), + start_date=dict(), + start_time=dict() ), supports_check_mode=True, ) diff --git a/plugins/modules/svr4pkg.py b/plugins/modules/svr4pkg.py index a939801603..76d65c8f43 100644 --- a/plugins/modules/svr4pkg.py +++ b/plugins/modules/svr4pkg.py @@ -192,10 +192,10 @@ def main(): argument_spec=dict( name=dict(required=True), state=dict(required=True, choices=['present', 'absent']), - src=dict(default=None), - proxy=dict(default=None), - response_file=dict(default=None), - zone=dict(required=False, default='all', choices=['current', 'all']), + src=dict(), + proxy=dict(), + response_file=dict(), + zone=dict(default='all', choices=['current', 'all']), category=dict(default=False, type='bool') ), supports_check_mode=True diff --git a/plugins/modules/swdepot.py b/plugins/modules/swdepot.py index 5ac730f36f..69ed726aa0 100644 --- a/plugins/modules/swdepot.py +++ b/plugins/modules/swdepot.py @@ -134,7 +134,7 @@ def main(): argument_spec=dict( name=dict(aliases=['pkg'], required=True), state=dict(choices=['present', 'absent', 'latest'], required=True), - depot=dict(default=None, required=False) + depot=dict() ), supports_check_mode=True ) diff --git a/plugins/modules/syslogger.py b/plugins/modules/syslogger.py index dbe4513d34..7f7dfabd38 100644 --- a/plugins/modules/syslogger.py +++ b/plugins/modules/syslogger.py @@ -167,17 +167,17 @@ def main(): module_args = dict( ident=dict(type='str', default='ansible_syslogger'), msg=dict(type='str', required=True), - priority=dict(type='str', required=False, + priority=dict(type='str', choices=["emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"], default='info'), - facility=dict(type='str', required=False, + facility=dict(type='str', choices=["kern", "user", "mail", "daemon", "auth", "lpr", "news", "uucp", "cron", "syslog", "local0", "local1", "local2", "local3", "local4", "local5", "local6", "local7"], default='daemon'), - log_pid=dict(type='bool', required=False, default=False) + log_pid=dict(type='bool', default=False) ) module = AnsibleModule( diff --git a/plugins/modules/sysrc.py b/plugins/modules/sysrc.py index fce0833053..a3e24830a0 100644 --- a/plugins/modules/sysrc.py +++ b/plugins/modules/sysrc.py @@ -106,11 +106,11 @@ class Sysrc(StateModuleHelper): module = dict( argument_spec=dict( name=dict(type='str', required=True), - value=dict(type='str', default=None), + value=dict(type='str'), state=dict(type='str', default='present', choices=['absent', 'present', 'value_present', 'value_absent']), path=dict(type='str', default='/etc/rc.conf'), delim=dict(type='str', default=' '), - jail=dict(type='str', default=None) + jail=dict(type='str') ), supports_check_mode=True ) diff --git a/plugins/modules/systemd_creds_decrypt.py b/plugins/modules/systemd_creds_decrypt.py index fbe80f2f16..c896737a93 100644 --- a/plugins/modules/systemd_creds_decrypt.py +++ b/plugins/modules/systemd_creds_decrypt.py @@ -100,16 +100,12 @@ def main(): """Decrypt secret using systemd-creds.""" module = AnsibleModule( argument_spec=dict( - name=dict(type="str", required=False), - newline=dict(type="bool", required=False, default=False), + name=dict(type="str"), + newline=dict(type="bool", default=False), secret=dict(type="str", required=True, no_log=True), - timestamp=dict(type="str", required=False), - transcode=dict( - type="str", - choices=["base64", "unbase64", "hex", "unhex"], - required=False, - ), - user=dict(type="str", required=False), + timestamp=dict(type="str"), + transcode=dict(type="str", choices=["base64", "unbase64", "hex", "unhex"]), + user=dict(type="str"), ), supports_check_mode=True, ) diff --git a/plugins/modules/systemd_creds_encrypt.py b/plugins/modules/systemd_creds_encrypt.py index 6f6e635416..2c4912427e 100644 --- a/plugins/modules/systemd_creds_encrypt.py +++ b/plugins/modules/systemd_creds_encrypt.py @@ -97,12 +97,12 @@ def main(): """Encrypt secret using systemd-creds.""" module = AnsibleModule( argument_spec=dict( - name=dict(type="str", required=False), - not_after=dict(type="str", required=False), + name=dict(type="str"), + not_after=dict(type="str"), pretty=dict(type="bool", default=False), secret=dict(type="str", required=True, no_log=True), - timestamp=dict(type="str", required=False), - user=dict(type="str", required=False), + timestamp=dict(type="str"), + user=dict(type="str"), ), supports_check_mode=True, )