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
|
||||
docker_projects_dir: "{{ ansible_env['HOME'] }}/docker-projects"
|
||||
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: 99999
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
lineinfile:
|
||||
path: "{{ ansible_env['HOME'] }}/.profile"
|
||||
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 }}"
|
||||
command:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
- name: Backup MySQL database
|
||||
community.docker.docker_container_exec:
|
||||
container: hedgedoc-mysql
|
||||
docker_host: "unix:///run/user/{{ host_uid }}/docker.sock"
|
||||
docker_host: "{{ docker_host }}"
|
||||
argv:
|
||||
- /bin/bash
|
||||
- "-c"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
-
|
||||
--stdin-name dumpall.sql
|
||||
environment:
|
||||
DOCKER_HOST: "unix:///run/user/{{ host_uid }}/docker.sock"
|
||||
DOCKER_HOST: "{{ docker_host }}"
|
||||
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
||||
become: true
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
- name: Backup PostgreSQL database
|
||||
community.docker.docker_container_exec:
|
||||
container: synapse-postgres
|
||||
docker_host: "unix:///run/user/{{ host_uid }}/docker.sock"
|
||||
docker_host: "{{ docker_host }}"
|
||||
command: |
|
||||
pg_dump -c
|
||||
-d synapse
|
||||
|
|
Loading…
Reference in a new issue