mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-11-23 07:48:04 +01:00
refactor wallabag
This commit is contained in:
parent
85623a90f8
commit
c6b4cb700b
3 changed files with 29 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Setup wallabag
|
- name: Wallabag
|
||||||
hosts: servers
|
hosts: servers
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -8,22 +8,40 @@
|
||||||
path: "{{ dir }}"
|
path: "{{ dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0775"
|
mode: "0775"
|
||||||
- name: Write env file
|
- name: Write files
|
||||||
ansible.builtin.template:
|
|
||||||
src: templates/wallabag.env.j2
|
|
||||||
dest: "{{ dir }}/wallabag.env"
|
|
||||||
mode: "0644"
|
|
||||||
- name: Write docker-compose.yaml
|
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: files/wallabag-docker-compose.yaml
|
src: "{{ item }}"
|
||||||
dest: "{{ dir }}/docker-compose.yaml"
|
dest: "{{ dir }}/"
|
||||||
mode: "0644"
|
mode: preserve
|
||||||
|
with_fileglob:
|
||||||
|
- files/{{ app_name }}/*
|
||||||
|
- files/{{ app_name }}/.*
|
||||||
|
notify:
|
||||||
|
- Restart service
|
||||||
|
- name: Write templates
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: "{{ dir }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
|
||||||
|
mode: preserve
|
||||||
|
with_fileglob:
|
||||||
|
- templates/{{ app_name }}/*.j2
|
||||||
|
- templates/{{ app_name }}/.*.j2
|
||||||
|
notify:
|
||||||
|
- Restart service
|
||||||
- name: Ensure service is started
|
- name: Ensure service is started
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
project_src: "{{ dir }}"
|
project_src: "{{ dir }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Restart service
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ dir }}"
|
||||||
|
state: restarted
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
dir: /mnt/data/wallabag
|
app_name: wallabag
|
||||||
|
dir: /mnt/data/{{ app_name }}
|
||||||
secret_key: !vault |
|
secret_key: !vault |
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
31346432623062383331306633383230376264326530643236393838356166346563653637376666
|
31346432623062383331306633383230376264326530643236393838356166346563653637376666
|
||||||
|
|
Loading…
Reference in a new issue