computer-playbook/playbook.constructor.yml

101 lines
2.5 KiB
YAML
Raw Normal View History

---
2025-01-29 14:20:34 +01:00
- name: Merge variables
hosts: all
tasks:
- name: Merge system_email definitions
set_fact:
2025-02-03 11:44:13 +01:00
system_email: "{{ default_system_email | combine(system_email | default({}, true), recursive=True) }}"
- name: Merge domain definitions
set_fact:
2025-02-03 11:44:13 +01:00
domains: "{{ defaults_domains | combine(domains | default({}, true), recursive=True) }}"
2025-02-06 21:18:25 +01:00
- name: Merge redirect domain definitions into dictionary
2025-02-03 22:08:16 +01:00
set_fact:
2025-02-06 21:18:25 +01:00
combined_mapping: >-
2025-02-03 22:28:42 +01:00
{{
(defaults_redirect_domain_mappings | items2dict(key_name='source', value_name='target'))
2025-02-06 21:18:25 +01:00
| combine(
2025-02-15 16:02:27 +01:00
(redirect_domain_mappings | default([]) | items2dict(key_name='source', value_name='target')),
2025-02-06 21:18:25 +01:00
recursive=True
)
2025-02-03 22:28:42 +01:00
}}
2025-02-06 21:18:25 +01:00
- name: Transform combined mapping to list with source and target keys
set_fact:
redirect_domain_mappings: "{{ redirect_domain_mappings | default([]) + [ {'source': item.key, 'target': item.value} ] }}"
loop: "{{ combined_mapping | dict2items }}"
2025-02-03 11:44:13 +01:00
- name: Merge application definitions
set_fact:
applications: "{{ defaults_applications | combine(applications | default({}, true), recursive=True) }}"
- name: Merge networks definitions
set_fact:
networks: "{{ defaults_networks | combine(networks | default({}, true), recursive=True) }}"
2025-02-06 15:02:18 +01:00
- name: Merge oidc configuration
set_fact:
oidc: "{{ defaults_oidc | combine(oidc | default({}, true), recursive=True) }}"
- name: print oidc dict
debug:
var: oidc
when: enable_debug | bool
- name: update device
hosts: all
become: true
roles:
- role: update
2024-01-09 12:47:44 +01:00
when: mode_update | bool
- name: setup standard wireguard
hosts: wireguard_server
become: true
roles:
- wireguard
# vpn setup
- name: setup wireguard client behind firewall\nat
hosts: wireguard_behind_firewall
become: true
roles:
- client-wireguard-behind-firewall
- name: setup wireguard client
hosts: wireguard_client
become: true
roles:
- client-wireguard
## backup setup
- name: setup replica backup hosts
2024-01-14 01:01:16 +01:00
hosts: backup_remote_to_local
become: true
roles:
- role: backup-remote-to-local
- name: setup backup to swappable
hosts: backup_to_usb
become: true
roles:
- backup-data-to-usb
## driver setup
- name: driver-intel
hosts: intel
become: true
roles:
- driver-intel
- name: setup multiprinter hosts
hosts: epson_multiprinter
become: true
roles:
- driver-epson-multiprinter
## system setup
- name: setup swapfile hosts
hosts: swapfile
become: false
roles:
- system-swapfile