fix: minor change with ansible no_log

This commit is contained in:
Adrien Waksberg 2021-08-18 14:40:19 +02:00
parent 85c60f40eb
commit 16f58ca642
3 changed files with 10 additions and 6 deletions

View file

@ -14,6 +14,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
- test: replace kitchen to molecule
### Fixed
- fix no_log
### Removed
- remove support for debian 9

View file

@ -61,7 +61,7 @@ def main():
'database': { 'type': 'str', 'required': True },
'privilege': { 'type': 'str', 'required': True, 'choices': ['ALL', 'WRITE', 'READ'] },
'api_user': { 'type': 'str' },
'api_password': { 'type': 'str' },
'api_password': { 'type': 'str', 'no_log': True},
'api_host': { 'type': 'str', 'default': '127.0.0.1' },
'api_port': { 'type': 'int', 'default': 8086 },
'state': { 'type': 'str', 'default': 'present', 'choices': ['present', 'absent'] }

View file

@ -30,8 +30,9 @@
username: '{{ influxdb_api_user }}'
password: '{{ influxdb_api_password }}'
loop: '{{ influxdb_users }}'
loop_control:
label: '{{ item.name }}'
when: item.state is not defined or item.state != 'absent'
no_log: true
tags: influxdb
- name: delete users
@ -41,8 +42,9 @@
password: '{{ influxdb_api_password }}'
state: absent
loop: '{{ influxdb_users }}'
loop_control:
label: '{{ item.name }}'
when: item.state is defined and item.state == 'absent'
no_log: true
tags: influxdb
- name: create databases
@ -51,7 +53,6 @@
username: '{{ influxdb_api_user }}'
password: '{{ influxdb_api_password }}'
loop: '{{ influxdb_databases }}'
no_log: true
tags: influxdb
- name: create privileges
@ -64,5 +65,4 @@
api_port: '{{ influxdb_api_port }}'
state: '{{ item.state|default("present") }}'
loop: '{{ influxdb_privileges }}'
no_log: true
tags: influxdb