From 84aa6a0ad17aa8517c1429272cf4c6fcaed9bfbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Tue, 21 Dec 2021 17:39:24 +0000 Subject: roles/postgres: Pass ansible-lint --- roles/postgres/tasks/create_db.yml | 4 ++-- roles/postgres/tasks/create_user.yml | 4 ++-- roles/postgres/tasks/main.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/postgres/tasks/create_db.yml b/roles/postgres/tasks/create_db.yml index 9adb6ee..7a4fe6e 100644 --- a/roles/postgres/tasks/create_db.yml +++ b/roles/postgres/tasks/create_db.yml @@ -1,4 +1,4 @@ -- name: ensure miniflux database exists - shell: createdb -U postgres -O "{{ postgres_db_user }}" "{{ postgres_db_name }}" +- name: create database # noqa: no-changed-when + command: createdb -U postgres -O "{{ postgres_db_user }}" "{{ postgres_db_name }}" register: result failed_when: result.rc != 0 and "already exists" not in result.stderr diff --git a/roles/postgres/tasks/create_user.yml b/roles/postgres/tasks/create_user.yml index 123070d..4716939 100644 --- a/roles/postgres/tasks/create_user.yml +++ b/roles/postgres/tasks/create_user.yml @@ -1,4 +1,4 @@ -- name: ensure miniflux db user exists - shell: createuser -U postgres "{{ postgres_db_user }}" +- name: create database user # noqa: no-changed-when + command: createuser -U postgres "{{ postgres_db_user }}" register: result failed_when: result.rc != 0 and "already exists" not in result.stderr diff --git a/roles/postgres/tasks/main.yml b/roles/postgres/tasks/main.yml index d8fe000..78f208c 100644 --- a/roles/postgres/tasks/main.yml +++ b/roles/postgres/tasks/main.yml @@ -34,7 +34,7 @@ when: postgres_dir != "/var/postgresql" # NOTE: this tasks needs `pipelining` set to `false` to work correctly -- name: init postgres database +- name: init postgres database # noqa: no-changed-when command: cmd: initdb -D "{{ postgres_dir }}/data/" -U "{{ postgres_db_user }}" --encoding=UTF-8 --locale=en_US.UTF-8 chdir: "{{ postgres_dir }}" -- cgit v1.2.3