Add {{ docker_host }} variable.
This commit is contained in:
parent
edb616b612
commit
604e836b96
5 changed files with 5 additions and 4 deletions
1
env.yml
1
env.yml
|
@ -3,6 +3,7 @@ timezone: "Europe/Paris"
|
||||||
host_uid: 1000
|
host_uid: 1000
|
||||||
docker_projects_dir: "{{ ansible_env['HOME'] }}/docker-projects"
|
docker_projects_dir: "{{ ansible_env['HOME'] }}/docker-projects"
|
||||||
project_dir: "{{ docker_projects_dir }}/{{ role_name }}"
|
project_dir: "{{ docker_projects_dir }}/{{ role_name }}"
|
||||||
|
docker_host: "unix:///run/user/{{ host_uid }}/docker.sock"
|
||||||
|
|
||||||
# UID shift for mapping between host & containers
|
# UID shift for mapping between host & containers
|
||||||
uid_shift: 99999
|
uid_shift: 99999
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: "{{ ansible_env['HOME'] }}/.profile"
|
path: "{{ ansible_env['HOME'] }}/.profile"
|
||||||
regex: '^export DOCKER_HOST='
|
regex: '^export DOCKER_HOST='
|
||||||
line: "export DOCKER_HOST=unix:///run/user/{{ host_uid }}/docker.sock"
|
line: "export DOCKER_HOST={{ docker_host }}"
|
||||||
|
|
||||||
- name: "Make sure lingering is enabled for user {{ host_uid }}"
|
- name: "Make sure lingering is enabled for user {{ host_uid }}"
|
||||||
command:
|
command:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- name: Backup MySQL database
|
- name: Backup MySQL database
|
||||||
community.docker.docker_container_exec:
|
community.docker.docker_container_exec:
|
||||||
container: hedgedoc-mysql
|
container: hedgedoc-mysql
|
||||||
docker_host: "unix:///run/user/{{ host_uid }}/docker.sock"
|
docker_host: "{{ docker_host }}"
|
||||||
argv:
|
argv:
|
||||||
- /bin/bash
|
- /bin/bash
|
||||||
- "-c"
|
- "-c"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
-
|
-
|
||||||
--stdin-name dumpall.sql
|
--stdin-name dumpall.sql
|
||||||
environment:
|
environment:
|
||||||
DOCKER_HOST: "unix:///run/user/{{ host_uid }}/docker.sock"
|
DOCKER_HOST: "{{ docker_host }}"
|
||||||
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- name: Backup PostgreSQL database
|
- name: Backup PostgreSQL database
|
||||||
community.docker.docker_container_exec:
|
community.docker.docker_container_exec:
|
||||||
container: synapse-postgres
|
container: synapse-postgres
|
||||||
docker_host: "unix:///run/user/{{ host_uid }}/docker.sock"
|
docker_host: "{{ docker_host }}"
|
||||||
command: |
|
command: |
|
||||||
pg_dump -c
|
pg_dump -c
|
||||||
-d synapse
|
-d synapse
|
||||||
|
|
Loading…
Reference in a new issue