2024-09-26 22:02:36 +00:00
|
|
|
---
|
2024-10-02 22:50:21 +00:00
|
|
|
- name: Run all roles
|
|
|
|
hosts: serguzim_net
|
2024-10-13 18:31:23 +00:00
|
|
|
vars:
|
2024-10-20 23:29:01 +00:00
|
|
|
host_services: "{{ all_services | services_for_host(inventory_hostname) }}"
|
2024-10-02 22:50:21 +00:00
|
|
|
tasks:
|
2024-10-08 20:01:54 +00:00
|
|
|
- name: Install software
|
|
|
|
ansible.builtin.include_role:
|
|
|
|
name: software
|
|
|
|
apply:
|
|
|
|
tags: software
|
|
|
|
tags: software
|
2024-10-14 01:30:59 +00:00
|
|
|
when: "inventory_hostname != 'node002'"
|
|
|
|
|
|
|
|
- name: Run always role
|
|
|
|
ansible.builtin.include_role:
|
|
|
|
name: always
|
|
|
|
apply:
|
|
|
|
tags: always
|
|
|
|
tags: always
|
2024-10-08 20:01:54 +00:00
|
|
|
|
2024-10-02 22:50:21 +00:00
|
|
|
- name: Include service roles
|
|
|
|
ansible.builtin.include_role:
|
2024-10-22 16:29:03 +00:00
|
|
|
name: "{{ services_item }}"
|
2024-10-02 22:50:21 +00:00
|
|
|
apply:
|
2024-10-22 16:29:03 +00:00
|
|
|
tags: "{{ services_item }}"
|
2024-10-02 22:50:21 +00:00
|
|
|
tags: always
|
2024-10-22 16:29:03 +00:00
|
|
|
loop: "{{ host_services | services_names() }}"
|
2024-10-02 22:50:21 +00:00
|
|
|
loop_control:
|
|
|
|
loop_var: services_item
|
2024-10-08 19:33:01 +00:00
|
|
|
|
|
|
|
- name: Reload caddy on caddy tag
|
|
|
|
ansible.builtin.include_tasks:
|
|
|
|
file: tasks/reload-caddy.yml
|
|
|
|
apply:
|
|
|
|
tags: caddy
|
2024-10-13 16:30:14 +00:00
|
|
|
tags:
|
|
|
|
- caddy
|
|
|
|
- never
|
2024-10-13 21:20:11 +00:00
|
|
|
|
|
|
|
- name: Stop unused services
|
|
|
|
ansible.builtin.include_tasks:
|
|
|
|
file: tasks/stop-unused.yml
|
|
|
|
apply:
|
|
|
|
tags:
|
|
|
|
- cleanup
|
|
|
|
- always
|
|
|
|
tags:
|
|
|
|
- cleanup
|
|
|
|
- always
|