Skip to content

Commit 01bcbcf

Browse files
author
David Castellanos
committed
Do not show passwords in Ansible output
This role prints passwords in Ansible outputs (e.g. when creating users, etc.). This is a problem because passwords must never appear in plaintext under any circunstances. This commit attempts to fix the problem described above. The option "no_log: true" has been added to tasks which may print passwords during Ansible execution.
1 parent d10f291 commit 01bcbcf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tasks/auth_initialization.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
password: "{{ mongodb_user_admin_password }}",
3434
roles: "userAdminAnyDatabase"
3535
}
36+
no_log: true
3637

3738
- name: create administrative user siteRootAdmin
3839
mongodb_user:
@@ -48,6 +49,7 @@
4849
password: "{{ mongodb_root_admin_password }}",
4950
roles: "root"
5051
}
52+
no_log: true
5153

5254
- name: create backup user "backupuser"
5355
mongodb_user:
@@ -63,6 +65,7 @@
6365
password: "{{ mongodb_root_backup_password }}",
6466
roles: "backup,clusterMonitor"
6567
}
68+
no_log: true
6669

6770
- name: Move back mongod.conf
6871
template: src=mongod.conf.j2 dest=/etc/mongod.conf owner=root group=root mode=0644

tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
when: ( mongodb_security_authorization == 'enabled'
3434
and (not mongodb_replication_replset
3535
or mongodb_replication_replset == '') )
36+
no_log: true
3637
tags: [mongodb]
3738

3839
- name: Include authorization configuration
@@ -60,6 +61,7 @@
6061
and mongodb_replication_replset != ''
6162
and mongodb_security_authorization == 'enabled'
6263
and mongodb_master is defined and mongodb_master )
64+
no_log: true
6365
tags: [mongodb]
6466

6567
- name: create normal users without replicaset
@@ -77,6 +79,7 @@
7779
when: ( mongodb_security_authorization == 'enabled'
7880
and (not mongodb_replication_replset
7981
or mongodb_replication_replset == '') )
82+
no_log: true
8083
tags: [mongodb]
8184

8285
- name: Include MMS Agent configuration

0 commit comments

Comments
 (0)