aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-21 17:39:24 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-21 17:49:50 +0000
commit84aa6a0ad17aa8517c1429272cf4c6fcaed9bfbb (patch)
tree8c56f72fe17b3d5556fb21f5b058a62262d2e3ac /roles
parentdea389b8e65f0222e8f618c15530a0d0172c728e (diff)
downloadrules-84aa6a0ad17aa8517c1429272cf4c6fcaed9bfbb.tar.gz
roles/postgres: Pass ansible-lint
Diffstat (limited to 'roles')
-rw-r--r--roles/postgres/tasks/create_db.yml4
-rw-r--r--roles/postgres/tasks/create_user.yml4
-rw-r--r--roles/postgres/tasks/main.yml2
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 }}"
remember that computers suck.