generated from ansible/ansible_template
fix the docker role
This commit is contained in:
parent
2cea7f21ca
commit
0004113253
|
@ -1 +0,0 @@
|
||||||
docker_skip_project: false
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
- hosts: docker
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
|
- common-server
|
||||||
|
- restic
|
||||||
|
tasks:
|
||||||
|
- import_tasks: tasks/main.yml
|
||||||
|
vars_files:
|
||||||
|
- vars/main.yml
|
|
@ -0,0 +1,7 @@
|
||||||
|
roles:
|
||||||
|
- src: https://git.2li.ch/ansible/common.git
|
||||||
|
scm: git
|
||||||
|
- src: https://git.2li.ch/ansible/common-server.git
|
||||||
|
scm: git
|
||||||
|
- src: https://git.2li.ch/ansible/restic.git
|
||||||
|
scm: git
|
|
@ -32,19 +32,26 @@
|
||||||
- "LICENSE"
|
- "LICENSE"
|
||||||
- "README.md"
|
- "README.md"
|
||||||
|
|
||||||
- name: "Copy the project files to the server"
|
- name: "Get the Systems repository"
|
||||||
copy:
|
ansible.builtin.git:
|
||||||
src: "{{ docker_project_name }}"
|
repo: "https://git.2li.ch/Nebucatnetzer/docker_systems.git"
|
||||||
dest: "{{ lookup('env', 'HOME') }}/"
|
dest: "{{ lookup('env', 'HOME') }}/docker_systems"
|
||||||
become: false
|
become: no
|
||||||
when: not docker_skip_project
|
when: docker_skip_project is undefined
|
||||||
|
|
||||||
- name: "Copy the traefik config"
|
- name: "Get the .env template"
|
||||||
copy:
|
ansible.builtin.fetch:
|
||||||
src: "traefik.yaml"
|
src: "{{ docker_project_path }}/.env.example"
|
||||||
dest: "{{ docker_project_path }}/traefik.yaml"
|
dest: "/tmp/.env.example"
|
||||||
become: false
|
become: no
|
||||||
when: not docker_skip_project
|
when: docker_skip_project is undefined
|
||||||
|
|
||||||
|
- name: "Copy the .env file"
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "/tmp/.env.example"
|
||||||
|
dest: "{{ docker_project_path }}/.env"
|
||||||
|
become: no
|
||||||
|
when: docker_skip_project is undefined
|
||||||
|
|
||||||
- name: "Start the Docker containers"
|
- name: "Start the Docker containers"
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
|
@ -52,4 +59,4 @@
|
||||||
state: "present"
|
state: "present"
|
||||||
pull: "yes"
|
pull: "yes"
|
||||||
remove_orphans: "yes"
|
remove_orphans: "yes"
|
||||||
when: not docker_skip_project
|
when: docker_skip_project is undefined
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
docker_lazydocker_version: 0.12
|
docker_lazydocker_version: 0.12
|
||||||
docker_project_path: "{{ lookup('env', 'HOME') }}/{{ docker_project_name }}"
|
docker_project_path: "{{ lookup('env', 'HOME') }}/docker_systems/{{ docker_project_name }}"
|
||||||
|
|
Reference in New Issue