Improve reuse of tasks
This commit is contained in:
parent
13cf7a05ee
commit
3b5e27be2f
7 changed files with 8 additions and 7 deletions
9
_ansible/tasks/steps/create-service-directory.yml
Normal file
9
_ansible/tasks/steps/create-service-directory.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
- name: Setting the service path
|
||||
ansible.builtin.set_fact:
|
||||
service_path: "{{ (services_path, svc.name) | path_join }}"
|
||||
|
||||
- name: Create a service directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ service_path }}"
|
||||
state: directory
|
||||
mode: "0755"
|
5
_ansible/tasks/steps/template-docker-compose.yml
Normal file
5
_ansible/tasks/steps/template-docker-compose.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: Template docker-compose
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ (service_path, 'docker-compose.yml') | path_join }}"
|
||||
mode: "0644"
|
5
_ansible/tasks/steps/template-service-env.yml
Normal file
5
_ansible/tasks/steps/template-service-env.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: Template service.env file
|
||||
ansible.builtin.template:
|
||||
src: service.env.j2
|
||||
dest: "{{ (service_path, 'service.env') | path_join }}"
|
||||
mode: "0600"
|
5
_ansible/tasks/steps/template-site-config.yml
Normal file
5
_ansible/tasks/steps/template-site-config.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: Template caddy config
|
||||
ansible.builtin.template:
|
||||
src: caddy_site.conf.j2
|
||||
dest: "{{ (caddy_config_path, svc.domain + '.conf') | path_join }}"
|
||||
mode: "0644"
|
Reference in a new issue