mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
E501 fixes (#22879)
This commit is contained in:
parent
4fdeade389
commit
3164e8b561
215 changed files with 1328 additions and 761 deletions
|
@ -264,7 +264,9 @@ def main():
|
|||
# - in case ports are missing from the ones specified by the user
|
||||
# - in case ports are missing from those on the device
|
||||
# - in case we are change the status of a server
|
||||
if port_needs_update(defined_ports, slb_server_ports) or port_needs_update(slb_server_ports, defined_ports) or status_needs_update(current_status, axapi_enabled_disabled(slb_server_status)):
|
||||
if (port_needs_update(defined_ports, slb_server_ports) or
|
||||
port_needs_update(slb_server_ports, defined_ports) or
|
||||
status_needs_update(current_status, axapi_enabled_disabled(slb_server_status))):
|
||||
result = axapi_call(module, session_url + '&method=slb.server.update', json.dumps(json_post))
|
||||
if axapi_failure(result):
|
||||
module.fail_json(msg="failed to update the server: %s" % result['response']['err']['msg'])
|
||||
|
|
|
@ -65,7 +65,18 @@ options:
|
|||
required: false
|
||||
default: round-robin
|
||||
aliases: ['method']
|
||||
choices: ['round-robin', 'weighted-rr', 'least-connection', 'weighted-least-connection', 'service-least-connection', 'service-weighted-least-connection', 'fastest-response', 'least-request', 'round-robin-strict', 'src-ip-only-hash', 'src-ip-hash']
|
||||
choices:
|
||||
- 'round-robin'
|
||||
- 'weighted-rr'
|
||||
- 'least-connection'
|
||||
- 'weighted-least-connection'
|
||||
- 'service-least-connection'
|
||||
- 'service-weighted-least-connection'
|
||||
- 'fastest-response'
|
||||
- 'least-request'
|
||||
- 'round-robin-strict'
|
||||
- 'src-ip-only-hash'
|
||||
- 'src-ip-hash'
|
||||
servers:
|
||||
description:
|
||||
- A list of servers to add to the service group. Each list item should be a
|
||||
|
|
|
@ -40,7 +40,8 @@ options:
|
|||
default: null
|
||||
aliases: []
|
||||
notes:
|
||||
- This module returns an 'in memory' base64 encoded version of the file, take into account that this will require at least twice the RAM as the original file size.
|
||||
- This module returns an 'in memory' base64 encoded version of the file, take into account that this will require at least twice the RAM as the
|
||||
original file size.
|
||||
- "See also: M(fetch)"
|
||||
requirements: []
|
||||
author:
|
||||
|
|
|
@ -36,7 +36,8 @@ description:
|
|||
options:
|
||||
account_api_token:
|
||||
description:
|
||||
- "Account API token. You can obtain your API key from the bottom of the Cloudflare 'My Account' page, found here: U(https://www.cloudflare.com/a/account)"
|
||||
- >
|
||||
Account API token. You can obtain your API key from the bottom of the Cloudflare 'My Account' page, found here: U(https://www.cloudflare.com/a/account)
|
||||
required: true
|
||||
account_email:
|
||||
description:
|
||||
|
|
|
@ -29,7 +29,9 @@ description:
|
|||
options:
|
||||
account_email:
|
||||
description:
|
||||
- "Account email. If omitted, the env variables DNSIMPLE_EMAIL and DNSIMPLE_API_TOKEN will be looked for. If those aren't found, a C(.dnsimple) file will be looked for, see: U(https://github.com/mikemaccana/dnsimple-python#getting-started)"
|
||||
- >
|
||||
Account email. If omitted, the env variables DNSIMPLE_EMAIL and DNSIMPLE_API_TOKEN will be looked for.
|
||||
If those aren't found, a C(.dnsimple) file will be looked for, see: U(https://github.com/mikemaccana/dnsimple-python#getting-started)
|
||||
required: false
|
||||
default: null
|
||||
|
||||
|
@ -41,7 +43,8 @@ options:
|
|||
|
||||
domain:
|
||||
description:
|
||||
- Domain to work with. Can be the domain name (e.g. "mydomain.com") or the numeric ID of the domain in DNSimple. If omitted, a list of domains will be returned.
|
||||
- Domain to work with. Can be the domain name (e.g. "mydomain.com") or the numeric ID of the domain in DNSimple. If omitted, a list of domains
|
||||
will be returned.
|
||||
- If domain is present but the domain doesn't exist, it will be created.
|
||||
required: false
|
||||
default: null
|
||||
|
@ -175,18 +178,19 @@ except ImportError:
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
account_email = dict(required=False),
|
||||
account_api_token = dict(required=False, no_log=True),
|
||||
domain = dict(required=False),
|
||||
record = dict(required=False),
|
||||
record_ids = dict(required=False, type='list'),
|
||||
type = dict(required=False, choices=['A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO', 'POOL']),
|
||||
ttl = dict(required=False, default=3600, type='int'),
|
||||
value = dict(required=False),
|
||||
priority = dict(required=False, type='int'),
|
||||
state = dict(required=False, choices=['present', 'absent']),
|
||||
solo = dict(required=False, type='bool'),
|
||||
argument_spec=dict(
|
||||
account_email=dict(required=False),
|
||||
account_api_token=dict(required=False, no_log=True),
|
||||
domain=dict(required=False),
|
||||
record=dict(required=False),
|
||||
record_ids=dict(required=False, type='list'),
|
||||
type=dict(required=False, choices=['A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO',
|
||||
'POOL']),
|
||||
ttl=dict(required=False, default=3600, type='int'),
|
||||
value=dict(required=False),
|
||||
priority=dict(required=False, type='int'),
|
||||
state=dict(required=False, choices=['present', 'absent']),
|
||||
solo=dict(required=False, type='bool'),
|
||||
),
|
||||
required_together = (
|
||||
['record', 'value']
|
||||
|
|
|
@ -25,7 +25,9 @@ module: dnsmadeeasy
|
|||
version_added: "1.3"
|
||||
short_description: Interface with dnsmadeeasy.com (a DNS hosting service).
|
||||
description:
|
||||
- "Manages DNS records via the v2 REST API of the DNS Made Easy service. It handles records only; there is no manipulation of domains or monitor/account support yet. See: U(https://www.dnsmadeeasy.com/integration/restapi/)"
|
||||
- >
|
||||
Manages DNS records via the v2 REST API of the DNS Made Easy service. It handles records only; there is no manipulation of domains or
|
||||
monitor/account support yet. See: U(https://www.dnsmadeeasy.com/integration/restapi/)
|
||||
options:
|
||||
account_key:
|
||||
description:
|
||||
|
@ -41,13 +43,15 @@ options:
|
|||
|
||||
domain:
|
||||
description:
|
||||
- Domain to work with. Can be the domain name (e.g. "mydomain.com") or the numeric ID of the domain in DNS Made Easy (e.g. "839989") for faster resolution.
|
||||
- Domain to work with. Can be the domain name (e.g. "mydomain.com") or the numeric ID of the domain in DNS Made Easy (e.g. "839989") for faster
|
||||
resolution
|
||||
required: true
|
||||
default: null
|
||||
|
||||
record_name:
|
||||
description:
|
||||
- Record name to get/create/delete/update. If record_name is not specified; all records for the domain will be returned in "result" regardless of the state argument.
|
||||
- Record name to get/create/delete/update. If record_name is not specified; all records for the domain will be returned in "result" regardless
|
||||
of the state argument.
|
||||
required: false
|
||||
default: null
|
||||
|
||||
|
@ -60,8 +64,12 @@ options:
|
|||
|
||||
record_value:
|
||||
description:
|
||||
- "Record value. HTTPRED: <redirection URL>, MX: <priority> <target name>, NS: <name server>, PTR: <target name>, SRV: <priority> <weight> <port> <target name>, TXT: <text value>"
|
||||
- "If record_value is not specified; no changes will be made and the record will be returned in 'result' (in other words, this module can be used to fetch a record's current id, type, and ttl)"
|
||||
- >
|
||||
Record value. HTTPRED: <redirection URL>, MX: <priority> <target name>, NS: <name server>, PTR: <target name>,
|
||||
SRV: <priority> <weight> <port> <target name>, TXT: <text value>"
|
||||
- >
|
||||
If record_value is not specified; no changes will be made and the record will be returned in 'result'
|
||||
(in other words, this module can be used to fetch a record's current id, type, and ttl)
|
||||
required: false
|
||||
default: null
|
||||
|
||||
|
@ -88,7 +96,8 @@ options:
|
|||
version_added: 1.5.1
|
||||
|
||||
notes:
|
||||
- The DNS Made Easy service requires that machines interacting with the API have the proper time and timezone set. Be sure you are within a few seconds of actual time by using NTP.
|
||||
- The DNS Made Easy service requires that machines interacting with the API have the proper time and timezone set. Be sure you are within a few
|
||||
seconds of actual time by using NTP.
|
||||
- This module returns record(s) in the "result" element when 'state' is set to 'present'. This value can be be registered and used in your playbooks.
|
||||
|
||||
requirements: [ hashlib, hmac ]
|
||||
|
|
|
@ -1640,7 +1640,9 @@ def main():
|
|||
if validate_certs:
|
||||
import ssl
|
||||
if not hasattr(ssl, 'SSLContext'):
|
||||
module.fail_json(msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task')
|
||||
module.fail_json(
|
||||
msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task'
|
||||
)
|
||||
|
||||
if fact_filter:
|
||||
regex = fnmatch.translate(fact_filter)
|
||||
|
|
|
@ -329,7 +329,9 @@ def main():
|
|||
if module.params['validate_certs']:
|
||||
import ssl
|
||||
if not hasattr(ssl, 'SSLContext'):
|
||||
module.fail_json(msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task')
|
||||
module.fail_json(
|
||||
msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task'
|
||||
)
|
||||
|
||||
server = module.params['server']
|
||||
server_port = module.params['server_port']
|
||||
|
|
|
@ -319,7 +319,9 @@ def main():
|
|||
if module.params['validate_certs']:
|
||||
import ssl
|
||||
if not hasattr(ssl, 'SSLContext'):
|
||||
module.fail_json(msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task')
|
||||
module.fail_json(
|
||||
msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task'
|
||||
)
|
||||
|
||||
server = module.params['server']
|
||||
server_port = module.params['server_port']
|
||||
|
|
|
@ -409,7 +409,9 @@ def main():
|
|||
if module.params['validate_certs']:
|
||||
import ssl
|
||||
if not hasattr(ssl, 'SSLContext'):
|
||||
module.fail_json(msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task')
|
||||
module.fail_json(
|
||||
msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task'
|
||||
)
|
||||
|
||||
server = module.params['server']
|
||||
server_port = module.params['server_port']
|
||||
|
|
|
@ -396,7 +396,9 @@ def main():
|
|||
if module.params['validate_certs']:
|
||||
import ssl
|
||||
if not hasattr(ssl, 'SSLContext'):
|
||||
module.fail_json(msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task')
|
||||
module.fail_json(
|
||||
msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task'
|
||||
)
|
||||
|
||||
server = module.params['server']
|
||||
server_port = module.params['server_port']
|
||||
|
|
|
@ -683,7 +683,9 @@ def main():
|
|||
if module.params['validate_certs']:
|
||||
import ssl
|
||||
if not hasattr(ssl, 'SSLContext'):
|
||||
module.fail_json(msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task')
|
||||
module.fail_json(
|
||||
msg='bigsuds does not support verifying certificates with python < 2.7.9. Either update python or set validate_certs=False on the task'
|
||||
)
|
||||
|
||||
server = module.params['server']
|
||||
server_port = module.params['server_port']
|
||||
|
|
|
@ -288,7 +288,12 @@ class HAProxy(object):
|
|||
"""
|
||||
data = self.execute('show stat', 200, False).lstrip('# ')
|
||||
r = csv.DictReader(data.splitlines())
|
||||
state = tuple(map(lambda d: { 'status': d['status'], 'weight': d['weight'] }, filter(lambda d: (pxname is None or d['pxname'] == pxname) and d['svname'] == svname, r)))
|
||||
state = tuple(
|
||||
map(
|
||||
lambda d: {'status': d['status'], 'weight': d['weight']},
|
||||
filter(lambda d: (pxname is None or d['pxname'] == pxname) and d['svname'] == svname, r)
|
||||
)
|
||||
)
|
||||
return state or None
|
||||
|
||||
|
||||
|
|
|
@ -172,7 +172,9 @@ options:
|
|||
required: False
|
||||
default: None
|
||||
description:
|
||||
- 'This is only used with bridge - MAC address of the bridge (note: this requires a recent kernel feature, originally introduced in 3.15 upstream kernel)'
|
||||
- >
|
||||
This is only used with bridge - MAC address of the bridge
|
||||
(note: this requires a recent kernel feature, originally introduced in 3.15 upstream kernel)
|
||||
slavepriority:
|
||||
required: False
|
||||
default: 32
|
||||
|
@ -187,7 +189,8 @@ options:
|
|||
required: False
|
||||
default: yes
|
||||
description:
|
||||
- This is only used with 'bridge-slave' - 'hairpin mode' for the slave, which allows frames to be sent back out through the slave the frame was received on.
|
||||
- This is only used with 'bridge-slave' - 'hairpin mode' for the slave, which allows frames to be sent back out through the slave the
|
||||
frame was received on.
|
||||
vlanid:
|
||||
required: False
|
||||
default: None
|
||||
|
@ -1106,7 +1109,8 @@ def main():
|
|||
gw6=dict(required=False, default=None, type='str'),
|
||||
dns6=dict(required=False, default=None, type='str'),
|
||||
# Bond Specific vars
|
||||
mode=dict(require=False, default="balance-rr", choices=["balance-rr", "active-backup", "balance-xor", "broadcast", "802.3ad", "balance-tlb", "balance-alb"], type='str'),
|
||||
mode=dict(require=False, default="balance-rr", type='str', choices=["balance-rr", "active-backup", "balance-xor", "broadcast", "802.3ad",
|
||||
"balance-tlb", "balance-alb"]),
|
||||
miimon=dict(required=False, default=None, type='str'),
|
||||
downdelay=dict(required=False, default=None, type='str'),
|
||||
updelay=dict(required=False, default=None, type='str'),
|
||||
|
|
|
@ -24,7 +24,8 @@ DOCUMENTATION = '''
|
|||
module: panos_nat_policy
|
||||
short_description: create a policy NAT rule
|
||||
description:
|
||||
- Create a policy nat rule. Keep in mind that we can either end up configuring source NAT, destination NAT, or both. Instead of splitting it into two we will make a fair attempt to determine which one the user wants.
|
||||
- Create a policy nat rule. Keep in mind that we can either end up configuring source NAT, destination NAT, or both. Instead of splitting it
|
||||
into two we will make a fair attempt to determine which one the user wants.
|
||||
author: "Luigi Mori (@jtschichold), Ivan Bojer (@ivanbojer)"
|
||||
version_added: "2.3"
|
||||
requirements:
|
||||
|
|
|
@ -241,7 +241,8 @@ def main():
|
|||
|
||||
# Use SNMP Version 3 with authPriv
|
||||
else:
|
||||
snmp_auth = cmdgen.UsmUserData(m_args['username'], authKey=m_args['authkey'], privKey=m_args['privkey'], authProtocol=integrity_proto, privProtocol=privacy_proto)
|
||||
snmp_auth = cmdgen.UsmUserData(m_args['username'], authKey=m_args['authkey'], privKey=m_args['privkey'], authProtocol=integrity_proto,
|
||||
privProtocol=privacy_proto)
|
||||
|
||||
# Use p to prefix OIDs with a dot for polling
|
||||
p = DefineOid(dotprefix=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue