Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move asa provider to suboptions #32356

Merged
merged 1 commit into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Ansible Changes By Release
https://github.com/ansible/ansible/issues/31786
* Fix ansible-doc and ansible-console module-path option (https://github.com/ansible/ansible/pull/31744)
* Fix for hostname module on RHEL 7.5 (https://github.com/ansible/ansible/issues/31811)
* Fix provider password leak in logs for asa modules (https://github.com/ansible/ansible/issues/32343)

### Known Bugs
* Implicit localhost is getting ansible_connection from all:vars instead of
Expand Down
15 changes: 6 additions & 9 deletions lib/ansible/module_utils/asa.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
_DEVICE_CONFIGS = {}
_CONNECTION = None

asa_argument_spec = {
asa_provider_spec = {
'host': dict(),
'port': dict(type='int'),
'username': dict(fallback=(env_fallback, ['ANSIBLE_NET_USERNAME'])),
Expand All @@ -42,11 +42,15 @@
'authorize': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTHORIZE']), type='bool'),
'auth_pass': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTH_PASS']), no_log=True),
'timeout': dict(type='int'),
'provider': dict(type='dict'),
'context': dict(),
'passwords': dict()
}

asa_argument_spec = {
'provider': dict(type='dict', options=asa_provider_spec),
}
asa_argument_spec.update(asa_provider_spec)

command_spec = {
'command': dict(key=True),
'prompt': dict(),
Expand All @@ -59,17 +63,10 @@ def get_argspec():


def check_args(module):
provider = module.params['provider'] or {}

for key in asa_argument_spec:
if key not in ['context', 'passwords', 'provider', 'authorize'] and module.params[key]:
module.warn('argument %s has been deprecated and will be removed in a future version' % key)

if provider:
for param in ('auth_pass', 'password'):
if provider.get(param):
module.no_log_values.update(return_values(provider[param]))


def get_connection(module):
global _CONNECTION
Expand Down