From 16f58ca6422bb959ba5ff56bfd1767ef00814465 Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Wed, 18 Aug 2021 14:40:19 +0200 Subject: [PATCH] fix: minor change with ansible no_log --- CHANGELOG.md | 4 ++++ library/influxdb_privilege.py | 4 ++-- tasks/config.yml | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea844a5..de8dae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/library/influxdb_privilege.py b/library/influxdb_privilege.py index f957988..7b6473e 100644 --- a/library/influxdb_privilege.py +++ b/library/influxdb_privilege.py @@ -59,9 +59,9 @@ def main(): fields = { 'user': { 'type': 'str', 'required': True }, 'database': { 'type': 'str', 'required': True }, - 'privilege': { 'type': 'str', 'required': True, 'choices': ['ALL', 'WRITE', 'READ'] }, + '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'] } diff --git a/tasks/config.yml b/tasks/config.yml index 99d36b7..773db96 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -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