General optimations and refactorings in preparation for simpleicon role implementation

This commit is contained in:
2025-07-06 14:54:31 +02:00
parent eed72368c1
commit cfeb8a5bf8
41 changed files with 421 additions and 151 deletions

View File

@@ -1,23 +1,27 @@
- name: "Create (optional) '{{ docker_compose.files.dockerfile }}'"
- name: Create (optional) Dockerfile
template:
src: "{{ playbook_dir }}/roles/{{ role_name }}/templates/Dockerfile.j2"
dest: "{{ docker_compose.files.dockerfile }}"
notify: docker compose up
ignore_errors: false
register: create_dockerfile_result
src: "{{ item }}"
dest: "{{ docker_compose.files.dockerfile }}"
with_first_found:
- "{{ playbook_dir }}/roles/{{ role_name }}/templates/Dockerfile.j2"
- "{{ playbook_dir }}/roles/{{ role_name }}/files/Dockerfile"
notify: docker compose up
register: create_dockerfile_result
failed_when:
- create_dockerfile_result is failed
- "'Could not find or access' not in create_dockerfile_result.msg"
- name: "Create (optional) '{{ docker_compose.files.env }}'"
template:
src: "env.j2"
src: "{{ item }}"
dest: "{{ docker_compose.files.env }}"
mode: '770'
force: yes
notify: docker compose up
register: env_template
ignore_errors: false
with_first_found:
- "{{ playbook_dir }}/roles/{{ role_name }}/templates/env.j2"
- "{{ playbook_dir }}/roles/{{ role_name }}/files/env"
failed_when:
- env_template is failed
- "'Could not find or access' not in env_template.msg"