ansible/roles/docker/tasks/services.yml

25 lines
853 B
YAML
Raw Normal View History

# vim: ft=yaml.ansible
---
2023-10-04 17:43:11 +00:00
- name: Set up external services network
2018-06-24 13:16:56 +00:00
docker_network:
name: external_services
2018-06-24 13:17:35 +00:00
2023-10-04 17:43:11 +00:00
- name: Deploy all services
include_tasks:
2023-10-04 17:43:11 +00:00
file: block.yml
vars:
service: "{{ item }}"
loop: "{{ services | dict2items(key_name='name', value_name='vars') }}"
when: single_service is not defined and
(item.vars.disabled_in_vagrant is not defined or
not (item.vars.disabled_in_vagrant and vagrant))
2023-10-04 17:43:11 +00:00
- name: Deploy single service
include_tasks:
file: block.yml
vars:
2023-10-04 19:34:59 +00:00
service: "{{ {single_service: services[single_service]} | dict2items(key_name='name', value_name='vars') | join }}"
2023-10-03 20:13:30 +00:00
when: single_service is defined and single_service in services and
2023-03-05 22:10:53 +00:00
(services[single_service].disabled_in_vagrant is not defined or
not (services[single_service].disabled_in_vagrant and vagrant))