mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
General optimations and refactorings in preparation for simpleicon role implementation
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user