From 3796e26a9dd6ccb3c929c044f39c6b1bd369e894 Mon Sep 17 00:00:00 2001 From: Joel Thompson Date: Thu, 17 Dec 2015 23:32:05 -0500 Subject: [PATCH] Add no_log=True to consul modules' API tokens API tokens should be considered sensitive and not logged. --- lib/ansible/modules/extras/clustering/consul.py | 2 +- lib/ansible/modules/extras/clustering/consul_acl.py | 4 ++-- lib/ansible/modules/extras/clustering/consul_kv.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/extras/clustering/consul.py b/lib/ansible/modules/extras/clustering/consul.py index 41c98d00228..609dce89227 100644 --- a/lib/ansible/modules/extras/clustering/consul.py +++ b/lib/ansible/modules/extras/clustering/consul.py @@ -523,7 +523,7 @@ def main(): http=dict(required=False, type='str'), timeout=dict(required=False, type='str'), tags=dict(required=False, type='list'), - token=dict(required=False) + token=dict(required=False, no_log=True) ), supports_check_mode=False, ) diff --git a/lib/ansible/modules/extras/clustering/consul_acl.py b/lib/ansible/modules/extras/clustering/consul_acl.py index e5d06814ebc..17d59ea62a8 100644 --- a/lib/ansible/modules/extras/clustering/consul_acl.py +++ b/lib/ansible/modules/extras/clustering/consul_acl.py @@ -313,13 +313,13 @@ def test_dependencies(module): def main(): argument_spec = dict( - mgmt_token=dict(required=True), + mgmt_token=dict(required=True, no_log=True), host=dict(default='localhost'), name=dict(required=False), port=dict(default=8500, type='int'), rules=dict(default=None, required=False, type='list'), state=dict(default='present', choices=['present', 'absent']), - token=dict(required=False), + token=dict(required=False, no_log=True), token_type=dict( required=False, choices=['client', 'management'], default='client') ) diff --git a/lib/ansible/modules/extras/clustering/consul_kv.py b/lib/ansible/modules/extras/clustering/consul_kv.py index 06dd55b71fc..bb7dea3ad39 100644 --- a/lib/ansible/modules/extras/clustering/consul_kv.py +++ b/lib/ansible/modules/extras/clustering/consul_kv.py @@ -241,7 +241,7 @@ def main(): recurse=dict(required=False, type='bool'), retrieve=dict(required=False, default=True), state=dict(default='present', choices=['present', 'absent']), - token=dict(required=False, default='anonymous'), + token=dict(required=False, default='anonymous', no_log=True), value=dict(required=False) )