ansible-edda/playbooks/services.yml

199 lines
7.9 KiB
YAML
Raw Normal View History

2022-12-12 23:49:20 +01:00
---
- name: "services : asgard:&zfs"
hosts: "asgard:&zfs"
vars_files:
- "vars/services/volumes.yml"
2022-12-16 22:16:23 +01:00
tasks:
2022-12-18 19:49:55 +01:00
- name: "datasets : user"
ansible.builtin.include_role:
2022-12-18 19:36:21 +01:00
name: "services/datasets/user"
apply:
tags:
2022-12-14 21:20:00 +01:00
- "services:{{ services_service_name }}"
2022-12-18 19:49:55 +01:00
- "services:datasets"
- "services:datasets:user"
- "services:datasets:user:{{ services_service_name }}"
- "services:{{ services_service_name }}:datasets:user"
vars:
services_service_volumes: "{{ services_volumes[services_service_name] }}"
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
tags: "always"
- name: "services : asgard"
hosts: "asgard"
vars_files:
- "vars/services/volumes.yml"
- "vars/services/deploy/versions.yml"
2022-12-16 22:16:23 +01:00
roles:
2022-12-18 19:36:21 +01:00
- role: "services/setup/system"
2022-12-18 19:49:55 +01:00
tags:
- "services:setup"
- "services:setup:system"
2023-09-30 23:44:56 +02:00
vars:
services_setup_system_containers_storage_fuse_overlay: "{{ 'zfs' in group_names }}"
2022-12-16 22:16:23 +01:00
tasks:
2022-12-18 19:49:55 +01:00
- name: "setup : user"
ansible.builtin.include_role:
2022-12-18 19:36:21 +01:00
name: "services/setup/user"
apply:
tags:
2022-12-14 21:20:00 +01:00
- "services:{{ services_service_name }}"
2022-12-18 19:49:55 +01:00
- "services:setup"
- "services:setup:user"
- "services:setup:user:{{ services_service_name }}"
- "services:{{ services_service_name }}:setup:user"
vars:
services_service_volumes: "{{ services_volumes[services_service_name] }}"
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
tags: "always"
2022-12-16 21:49:50 +01:00
2023-07-17 22:31:05 +02:00
- name: "deploy rproxy"
ansible.builtin.include_role:
name: "services/deploy/rproxy"
apply:
tags:
- "services:rproxy"
- "services:deploy"
- "services:deploy:rproxy"
- "services:rproxy:deploy"
vars:
services_service_name: "rproxy"
2023-08-17 17:09:30 +02:00
services_deploy_rproxy_nginx_stream_config: "files/services/deploy/stream.conf"
2023-07-17 22:31:05 +02:00
services_deploy_rproxy_nginx_subdomain_config_files:
- "files/services/deploy/rproxy/nginx-conf.d/http-default.conf"
- "files/services/deploy/rproxy/nginx-conf.d/wojciechkozlowski.eu.conf"
- "files/services/deploy/rproxy/nginx-conf.d/www.wojciechkozlowski.eu.conf"
services_service_deploy_versions: "{{ services_deploy_versions.rproxy }}"
2023-07-17 22:31:05 +02:00
when: "'rproxy' in services_host_services"
tags: "always"
- name: "deploy lrproxy"
ansible.builtin.include_role:
name: "services/deploy/rproxy"
apply:
tags:
- "services:lrproxy"
- "services:deploy"
- "services:deploy:lrproxy"
- "services:lrproxy:deploy"
vars:
services_service_name: "lrproxy"
2023-08-17 17:09:30 +02:00
services_deploy_rproxy_nginx_stream_config: "files/services/deploy/stream.conf"
2023-07-17 22:31:05 +02:00
services_deploy_rproxy_nginx_subdomain_config_files:
2023-08-16 23:21:11 +02:00
- "files/services/deploy/lrproxy/nginx-conf.d/archive.music.thenineworlds.net.conf"
2024-02-04 19:00:30 +01:00
- "files/services/deploy/lrproxy/nginx-conf.d/cloud.thenineworlds.net.conf"
2023-10-22 18:31:32 +02:00
- "files/services/deploy/lrproxy/nginx-conf.d/dash.thenineworlds.net.conf"
2023-08-17 17:09:30 +02:00
- "files/services/deploy/lrproxy/nginx-conf.d/database.thenineworlds.net.conf"
2023-08-16 23:21:11 +02:00
- "files/services/deploy/lrproxy/nginx-conf.d/git.thenineworlds.net.conf"
- "files/services/deploy/lrproxy/nginx-conf.d/music.thenineworlds.net.conf"
- "files/services/deploy/lrproxy/nginx-conf.d/notes.thenineworlds.net.conf"
services_service_deploy_versions: "{{ services_deploy_versions.lrproxy }}"
2023-07-17 22:31:05 +02:00
when: "'lrproxy' in services_host_services"
tags: "always"
2022-12-16 21:49:50 +01:00
- name: "deploy"
ansible.builtin.include_role:
2022-12-18 19:36:21 +01:00
name: "services/deploy/{{ services_service_name }}"
2022-12-16 21:49:50 +01:00
apply:
tags:
- "services:{{ services_service_name }}"
- "services:deploy"
- "services:deploy:{{ services_service_name }}"
- "services:{{ services_service_name }}:deploy"
vars:
services_service_deploy_versions: "{{ services_deploy_versions[services_service_name] }}"
2023-07-17 22:31:05 +02:00
loop: "{{
services_host_services | dict2items |
rejectattr('key', '==', 'rproxy') |
rejectattr('key', '==', 'lrproxy') |
map(attribute='key') }}"
2022-12-17 00:15:10 +01:00
loop_control:
loop_var: "services_service_name"
2022-12-17 00:09:05 +01:00
tags: "always"
2022-12-18 00:44:32 +01:00
- name: "services : asgard:&zfs"
hosts: "asgard:&zfs"
2022-12-18 01:38:30 +01:00
2022-12-18 00:44:32 +01:00
tasks:
2022-12-18 19:49:55 +01:00
- name: "datasets : backups : user"
2022-12-18 01:38:30 +01:00
ansible.builtin.include_role:
2022-12-18 19:36:21 +01:00
name: "services/datasets/backups/user"
2022-12-18 01:38:30 +01:00
apply:
tags:
- "services:{{ services_service_name }}"
2022-12-18 19:49:55 +01:00
- "services:datasets"
- "services:datasets:backups"
- "services:datasets:backups:user"
- "services:datasets:backups:user:{{ services_service_name }}"
- "services:{{ services_service_name }}:datasets:backups:user"
2022-12-18 01:38:30 +01:00
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
tags: "always"
2023-02-12 16:37:48 +01:00
- name: "backups : snapshots"
2022-12-18 00:44:32 +01:00
ansible.builtin.include_role:
2023-02-19 22:36:16 +01:00
name: "backups/snapshots/user"
2022-12-18 00:44:32 +01:00
apply:
tags:
- "services:{{ services_service_name }}"
- "services:backups"
2023-02-12 16:37:48 +01:00
- "services:backups:snapshots"
2023-02-19 22:36:16 +01:00
- "services:backups:snapshots:user"
- "services:backups:snapshots:user:{{ services_service_name }}"
- "services:{{ services_service_name }}:backups:snapshots:user"
vars:
backups_snapshots_user_name: "\
{{ services_backups_snapshots_services[services_service_name].user_name }}"
backups_snapshots_user_data_dataset: "\
{{ services_backups_snapshots_services[services_service_name].data_dataset }}"
backups_snapshots_user_backup_dataset: "\
{{ services_backups_snapshots_services[services_service_name].backup_dataset }}"
backups_snapshots_user_recursive: "\
{{ services_backups_snapshots_services[services_service_name].recursive }}"
backups_snapshots_user_skip_parent: "\
{{ services_backups_snapshots_services[services_service_name].skip_parent }}"
2023-02-12 16:37:48 +01:00
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
loop_control:
loop_var: "services_service_name"
tags: "always"
- name: "services : asgard:&restic"
hosts: "asgard:&restic"
2023-02-12 16:37:48 +01:00
tasks:
- name: "backups : restic"
ansible.builtin.include_role:
2023-02-19 22:36:16 +01:00
name: "backups/restic/user"
2023-02-12 16:37:48 +01:00
apply:
tags:
- "services:{{ services_service_name }}"
- "services:backups"
2023-02-19 22:36:16 +01:00
- "services:backups:restic:user"
- "services:backups:restic:user:{{ services_service_name }}"
- "services:{{ services_service_name }}:backups:restic:user"
vars:
backups_restic_user_name: "\
{{ services_backups_restic_services[services_service_name].user_name }}"
backups_restic_user_use_dataset: "{{ 'zfs' in group_names }}"
backups_restic_user_data_dataset: "\
2023-07-11 21:16:59 +02:00
{{ services_backups_restic_services[services_service_name].data_dataset | default('') }}"
2023-02-19 22:36:16 +01:00
backups_restic_user_data_directory: "\
{{ services_backups_restic_services[services_service_name].data_directory }}"
backups_restic_user_data_exclude_list: "\
{{ services_backups_restic_services[services_service_name].exclude }}"
2023-02-19 22:36:16 +01:00
backups_restic_user_aws_bucket_prefix: "\
{{ services_backups_restic_services[services_service_name].aws_bucket_prefix }}"
2022-12-18 00:44:32 +01:00
loop: "{{ services_host_services | dict2items | map(attribute='key') }}"
2023-07-11 21:16:59 +02:00
when: "services_host_services[services_service_name].restic"
2022-12-18 00:44:32 +01:00
loop_control:
loop_var: "services_service_name"
2022-12-18 01:38:30 +01:00
tags: "always"