mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Adds fallback env variables for F5 bigip modules (#21213)
These would be a convenience that could be used instead of having to specify them for each module
This commit is contained in:
parent
239c6aee35
commit
5137244c3e
1 changed files with 42 additions and 9 deletions
|
@ -30,21 +30,54 @@
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import bigsuds
|
import bigsuds
|
||||||
|
bigsuds_found = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
bigsuds_found = False
|
bigsuds_found = False
|
||||||
else:
|
|
||||||
bigsuds_found = True
|
|
||||||
|
from ansible.module_utils.basic import env_fallback
|
||||||
|
|
||||||
|
|
||||||
def f5_argument_spec():
|
def f5_argument_spec():
|
||||||
return dict(
|
return dict(
|
||||||
server=dict(type='str', required=True),
|
server=dict(
|
||||||
user=dict(type='str', required=True),
|
type='str',
|
||||||
password=dict(type='str', aliases=['pass', 'pwd'], required=True, no_log=True),
|
required=True,
|
||||||
validate_certs = dict(default='yes', type='bool'),
|
fallback=(env_fallback, ['F5_SERVER'])
|
||||||
server_port = dict(type='int', default=443, required=False),
|
),
|
||||||
state = dict(type='str', default='present', choices=['present', 'absent']),
|
user=dict(
|
||||||
partition = dict(type='str', default='Common')
|
type='str',
|
||||||
|
required=True,
|
||||||
|
fallback=(env_fallback, ['F5_USER'])
|
||||||
|
),
|
||||||
|
password=dict(
|
||||||
|
type='str',
|
||||||
|
aliases=['pass', 'pwd'],
|
||||||
|
required=True,
|
||||||
|
no_log=True,
|
||||||
|
fallback=(env_fallback, ['F5_PASSWORD'])
|
||||||
|
),
|
||||||
|
validate_certs=dict(
|
||||||
|
default='yes',
|
||||||
|
type='bool',
|
||||||
|
fallback=(env_fallback, ['F5_VALIDATE_CERTS'])
|
||||||
|
),
|
||||||
|
server_port=dict(
|
||||||
|
type='int',
|
||||||
|
default=443,
|
||||||
|
required=False,
|
||||||
|
fallback=(env_fallback, ['F5_SERVER_PORT'])
|
||||||
|
),
|
||||||
|
state=dict(
|
||||||
|
type='str',
|
||||||
|
default='present',
|
||||||
|
choices=['present', 'absent']
|
||||||
|
),
|
||||||
|
partition=dict(
|
||||||
|
type='str',
|
||||||
|
default='Common',
|
||||||
|
fallback=(env_fallback, ['F5_PARTITION'])
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue