diff --git a/snackpot.yml b/snackpot.yml index 03e1a6f..84fc7be 100644 --- a/snackpot.yml +++ b/snackpot.yml @@ -76,12 +76,12 @@ path: "{{ docker_compose_base_dir }}/{{ item.path }}" state: directory with_filetree: templates/docker-compose - when: item.state == "directory" + when: item.state == "directory" and item.path.count("/.") == 0 tags: docker-config - - name: configure docker compose files + - name: deploy docker compose templates template: - dest: "{{ docker_compose_base_dir }}/{{ item.path }}" + dest: "{{ docker_compose_base_dir }}/{{ item.path | splitext | first }}" src: "docker-compose/{{ item.path }}" owner: root group: root @@ -89,15 +89,33 @@ backup: yes notify: restart docker compose services with_filetree: templates/docker-compose - when: item.state == "file" and not item.path.endswith("~") + when: item.state == "file" and item.path.endswith(".j2") + tags: docker-config + + - name: deploy docker compose files + copy: + dest: "{{ docker_compose_base_dir }}/{{ item.path }}" + src: "templates/docker-compose/{{ item.path }}" + owner: root + group: root + mode: 0660 + backup: yes + notify: restart docker compose services + with_filetree: templates/docker-compose + when: |- + item.state == "file" and not ( + item.path.endswith("~") or item.path.endswith(".j2") + or item.path.count("/.") > 0 + ) tags: docker-config - name: ensure directory exists file: path: "{{ docker_compose_base_dir }}/bin" state: directory + tags: docker-config - - name: install binaries + - name: install executables template: dest: "{{ docker_compose_base_dir }}/bin/{{ item.path }}" src: "bin/{{ item.path }}" @@ -106,6 +124,6 @@ mode: 0550 with_filetree: templates/bin when: item.state == "file" and not item.path.endswith("~") - tags: test + tags: docker-config # config nextcloud # hide pg password diff --git a/templates/docker-compose/letsencrypt-companion.env b/templates/docker-compose/letsencrypt-companion.env.j2 similarity index 100% rename from templates/docker-compose/letsencrypt-companion.env rename to templates/docker-compose/letsencrypt-companion.env.j2 diff --git a/templates/docker-compose/nextcloud.env b/templates/docker-compose/nextcloud.env.j2 similarity index 100% rename from templates/docker-compose/nextcloud.env rename to templates/docker-compose/nextcloud.env.j2 diff --git a/templates/docker-compose/postgres.env b/templates/docker-compose/postgres.env.j2 similarity index 100% rename from templates/docker-compose/postgres.env rename to templates/docker-compose/postgres.env.j2 diff --git a/templates/docker-compose/postgres/Dockerfile b/templates/docker-compose/postgres/Dockerfile.j2 similarity index 100% rename from templates/docker-compose/postgres/Dockerfile rename to templates/docker-compose/postgres/Dockerfile.j2 diff --git a/templates/docker-compose/postgres/init.sql b/templates/docker-compose/postgres/init.sql.j2 similarity index 100% rename from templates/docker-compose/postgres/init.sql rename to templates/docker-compose/postgres/init.sql.j2 diff --git a/templates/docker-compose/web.env b/templates/docker-compose/web.env.j2 similarity index 100% rename from templates/docker-compose/web.env rename to templates/docker-compose/web.env.j2