diff options
author | binary <me@rgoncalves.se> | 2021-03-15 20:42:30 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2021-03-15 20:42:30 +0100 |
commit | e5fda5ea2f71c2a432a8bcfdefb835f70c4a49b0 (patch) | |
tree | e6d78c1e0dfe896eef6085ade373278171411d38 /roles/miniflux/tasks | |
parent | 6cf77357bcd32ecff44446564ece49b1ab286ece (diff) | |
download | infrastructure-e5fda5ea2f71c2a432a8bcfdefb835f70c4a49b0.tar.gz |
Add miniflux role for rss agregation.
Diffstat (limited to 'roles/miniflux/tasks')
-rw-r--r-- | roles/miniflux/tasks/main.yml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/roles/miniflux/tasks/main.yml b/roles/miniflux/tasks/main.yml new file mode 100644 index 0000000..95c5d92 --- /dev/null +++ b/roles/miniflux/tasks/main.yml @@ -0,0 +1,49 @@ + +# git ~~ roles/git/tasks/main.yml +# Init git user and settings + +--- + +- name: ensure miniflux is installed + package: + 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" + register: result + failed_when: result.rc != 0 and "already exists" not in result.stderr + +- name: run postgres migrations + shell: | + psql -U postgres -c "ALTER USER miniflux WITH SUPERUSER" + miniflux -migrate + psql -U postgres -c "ALTER USER miniflux WITH NOSUPERUSER" + +- name: generate configuration + template: + src: etc-miniflux.conf.j2 + dest: /etc/miniflux.conf + owner: "{{ miniflux_user }}" + owner: "{{ miniflux_group }}" + mode: "0644" + +- name: ensure miniflux is enabled and restarted + service: + name: miniflux + state: restarted + enabled: true |