aboutsummaryrefslogblamecommitdiffstats
path: root/roles/miniflux/tasks/main.yml
blob: ba90164a5012c9ff6beecb22655cfd5f2b938429 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                    



















                                                               





















                                                                       

# git ~~ roles/git/tasks/main.yml
# Init git user and settings

---

- name: ensure miniflux is installed
  package:
    name: miniflux
    state: present

- 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

- 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
remember that computers suck.