Refactor wallabag stack name and repo variables
Brought in line with other stack naming schemes.
This commit is contained in:
parent
9cf43d0d5d
commit
a52cab2f61
6 changed files with 17 additions and 20 deletions
|
|
@ -6,7 +6,7 @@ Contains only a single deployed image and a couple of simple variables to set.
|
|||
## Variables
|
||||
|
||||
```
|
||||
wallabag_upstream_file_dir: "{{ docker_stack_files_dir }}/{{ stack.name }}"
|
||||
wallabag_upstream_file_dir: "{{ docker_stack_files_dir }}/{{ stack_name }}"
|
||||
```
|
||||
|
||||
The on-target directory where the proxy configuration file should be stashed.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
wallabag_version: latest
|
||||
|
||||
wallabag_upstream_file_dir: "{{ docker_stack_files_dir }}/{{ stack.name }}"
|
||||
wallabag_upstream_file_dir: "{{ docker_stack_files_dir }}/{{ stack_name }}"
|
||||
|
||||
wallabag_use_https: true
|
||||
|
||||
|
|
|
|||
|
|
@ -15,28 +15,28 @@
|
|||
listen: "update wallabag upstream"
|
||||
|
||||
# figure out if upstream id exists
|
||||
- name: check {{ stack.name }} upstream
|
||||
- name: check {{ stack_name }} upstream
|
||||
community.docker.docker_container_exec:
|
||||
container: "{{ caddy_container_id }}"
|
||||
command: >
|
||||
curl localhost:2019/id/{{ stack.name }}_upstream/
|
||||
curl localhost:2019/id/{{ stack_name }}_upstream/
|
||||
changed_when: False
|
||||
register: result
|
||||
become: true
|
||||
listen: "update wallabag upstream"
|
||||
|
||||
# upstream already exists, patch it
|
||||
- name: remove old {{ stack.name }} upstream
|
||||
- name: remove old {{ stack_name }} upstream
|
||||
community.docker.docker_container_exec:
|
||||
container: "{{ caddy_container_id }}"
|
||||
command: >
|
||||
curl -X DELETE localhost:2019/id/{{ stack.name }}_upstream/
|
||||
curl -X DELETE localhost:2019/id/{{ stack_name }}_upstream/
|
||||
become: true
|
||||
when: (result.stdout | from_json)['error'] is not defined
|
||||
listen: "update wallabag upstream"
|
||||
|
||||
# upstream has to be created
|
||||
- name: add {{ stack.name }} upstream
|
||||
- name: add {{ stack_name }} upstream
|
||||
community.docker.docker_container_exec:
|
||||
container: "{{ caddy_container_id }}"
|
||||
command: >
|
||||
|
|
@ -50,4 +50,3 @@
|
|||
state: absent
|
||||
become: true
|
||||
listen: "update wallabag upstream"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
community.docker.docker_container_exec:
|
||||
container: "{{ caddy_container_id }}"
|
||||
command: >
|
||||
curl localhost:2019/id/{{ stack.name }}_upstream/
|
||||
curl localhost:2019/id/{{ stack_name }}_upstream/
|
||||
register: result
|
||||
changed_when: (result.stdout | from_json) != (lookup('template', 'upstream.json.j2') | from_yaml)
|
||||
become: true
|
||||
|
|
@ -12,14 +12,12 @@
|
|||
|
||||
- name: Deploy wallabag to swarm
|
||||
community.general.docker_stack:
|
||||
name: "{{ stack.name }}"
|
||||
name: "{{ stack_name }}"
|
||||
state: present
|
||||
prune: yes
|
||||
compose:
|
||||
- "{{ stack.compose }}"
|
||||
when: stack is defined
|
||||
- "{{ stack_compose }}"
|
||||
become: true
|
||||
tags:
|
||||
- docker-swarm
|
||||
notify: "update wallabag upstream"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"@id": "{{ stack.name }}_upstream",
|
||||
"@id": "{{ stack_name }}_upstream",
|
||||
{% if server_domain is not undefined and not none %}
|
||||
"match": [
|
||||
{
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
{% if subdomain_alias is not undefined and not none %}
|
||||
"{{ subdomain_alias }}.{{ server_domain }}"
|
||||
{% else %}
|
||||
"{{ stack.name }}.{{ server_domain }}"
|
||||
"{{ stack_name }}.{{ server_domain }}"
|
||||
{% endif %}
|
||||
]
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
{% if subdomain_alias is not undefined and not none %}
|
||||
"/{{ subdomain_alias }}*"
|
||||
{% else %}
|
||||
"/{{ stack.name }}*"
|
||||
"/{{ stack_name }}*"
|
||||
{% endif %}
|
||||
]
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
"handler": "reverse_proxy",
|
||||
"upstreams": [
|
||||
{
|
||||
"dial": "{{ stack.name }}_app:80"
|
||||
"dial": "{{ stack_name }}_app:80"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
|
||||
stack:
|
||||
name: wallabag
|
||||
compose: "{{ lookup('template', 'docker-stack.yml.j2') | from_yaml }}"
|
||||
stack_name: wallabag
|
||||
|
||||
stack_image: "wallabag/wallabag"
|
||||
|
||||
stack_compose: "{{ lookup('template', 'docker-stack.yml.j2') | from_yaml }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue