From b232b894c3cbe087c8d504e91637dcf62199eed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Thu, 29 Jul 2021 17:00:20 +0200 Subject: Bump to third revision of homelab --- roles/miniflux/tasks/main.yml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'roles/miniflux/tasks') diff --git a/roles/miniflux/tasks/main.yml b/roles/miniflux/tasks/main.yml index 95c5d92..ba90164 100644 --- a/roles/miniflux/tasks/main.yml +++ b/roles/miniflux/tasks/main.yml @@ -9,22 +9,26 @@ name: miniflux state: present -- name: ensure miniflux db user exists - shell: | - createuser -U postgres miniflux - register: result - failed_when: result.rc != 0 and "already exists" not in result.stderr - -- name: ensure miniflux database exists - shell: | - createdb -U postgres -O miniflux miniflux - createdb -U postgres -O miniflux miniflux2 - register: result - failed_when: result.rc != 0 and "already exists" not in result.stderr - -- name: ensure miniflux db user exists - shell: | - psql -U postgres miniflux -c "create extension hstore" +- name: include postgres user + include_role: + name: postgres + tasks_from: create_user + vars: + postgres_db_user: "{{ miniflux_db_user }}" + +- name: include postgres db + include_role: + name: postgres + tasks_from: create_db + vars: + postgres_db_user: "{{ miniflux_db_user }}" + postgres_db_name: "{{ miniflux_db_name}}{{ item }}" + loop: + - "" + - 2 + +- name: ensure hstore extension for db + shell: psql -U postgres miniflux -c "create extension hstore" register: result failed_when: result.rc != 0 and "already exists" not in result.stderr -- cgit v1.2.3