aboutsummaryrefslogtreecommitdiffstats
path: root/roles/miniflux
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-07-29 17:00:20 +0200
committerRomain Gonçalves <me@rgoncalves.se>2021-07-29 17:00:20 +0200
commitb232b894c3cbe087c8d504e91637dcf62199eed1 (patch)
treeea72a7d1a7f63c6425ee46785e1cec924351b2c3 /roles/miniflux
parent22126073344e60c405d086df37b64da0c6d3c086 (diff)
downloadinfrastructure-b232b894c3cbe087c8d504e91637dcf62199eed1.tar.gz
Bump to third revision of homelab
Diffstat (limited to 'roles/miniflux')
-rw-r--r--roles/miniflux/meta/main.yml9
-rw-r--r--roles/miniflux/tasks/main.yml36
-rw-r--r--roles/miniflux/vars/main.yml2
3 files changed, 24 insertions, 23 deletions
diff --git a/roles/miniflux/meta/main.yml b/roles/miniflux/meta/main.yml
index ca4e7dd..3ffef7b 100644
--- a/roles/miniflux/meta/main.yml
+++ b/roles/miniflux/meta/main.yml
@@ -1,8 +1,3 @@
-
-# miniflux ~~ roles/miniflux/meta/main.yml
-# Meta parameters
-
----
-
dependencies:
- - { role: postgres, tags: "dependency" }
+ - role: postgres
+ tags: dependency
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
diff --git a/roles/miniflux/vars/main.yml b/roles/miniflux/vars/main.yml
index 13e634c..37f2a45 100644
--- a/roles/miniflux/vars/main.yml
+++ b/roles/miniflux/vars/main.yml
@@ -6,6 +6,8 @@
miniflux_user: "_miniflux"
miniflux_group: "_miniflux"
+miniflux_db_user: "miniflux"
+miniflux_db_name: "miniflux"
miniflux_listenaddr: "0.0.0.0"
miniflux_port: "8010"
remember that computers suck.