blob: 95c5d921b50587f061a0a65f63d20aa951bfb506 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
|