ansible-edda/plays/services/main.yml

98 lines
3.0 KiB
YAML

---
- name: "services : zfs"
hosts: "zfs"
roles:
- role: "datasets/system"
tags: "services:datasets_system"
tasks:
- name: "datasets_user"
ansible.builtin.include_role:
name: "datasets/user"
apply:
tags:
- "services:{{ services_service_name }}"
- "services:datasets_user"
- "services:datasets_user:{{ services_service_name }}"
- "services:{{ services_service_name }}:datasets_user"
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
tags: "always"
- name: "services : asgard"
hosts: "asgard"
roles:
- role: "setup/system"
tags: "services:setup_system"
tasks:
- name: "setup_user"
ansible.builtin.include_role:
name: "setup/user"
apply:
tags:
- "services:{{ services_service_name }}"
- "services:setup_user"
- "services:setup_user:{{ services_service_name }}"
- "services:{{ services_service_name }}:setup_user"
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
tags: "always"
- name: "deploy"
ansible.builtin.include_role:
name: "deploy/{{ services_service_name }}"
apply:
tags:
- "services:{{ services_service_name }}"
- "services:deploy"
- "services:deploy:{{ services_service_name }}"
- "services:{{ services_service_name }}:deploy"
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
tags: "always"
- name: "services : yggdrasil"
hosts: "yggdrasil"
roles:
- role: "datasets/backups/system"
when: the_nine_worlds_production | bool
tags: "services:datasets_backups_system"
tasks:
- name: "datasets_backups_user"
ansible.builtin.include_role:
name: "datasets/backups/user"
apply:
tags:
- "services:{{ services_service_name }}"
- "services:datasets_backups_user"
- "services:datasets_backups_user:{{ services_service_name }}"
- "services:{{ services_service_name }}:datasets_backups_user"
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
when: the_nine_worlds_production | bool
tags: "always"
- name: "backups"
ansible.builtin.include_role:
name: "backups"
apply:
tags:
- "services:{{ services_service_name }}"
- "services:backups"
- "services:backups:{{ services_service_name }}"
- "services:{{ services_service_name }}:backups"
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
when: the_nine_worlds_production | bool
tags: "always"