|
11 | 11 | # DNS Records (gestione speciale, non ha ID) |
12 | 12 | - name: Manage DNS records via API |
13 | 13 | ansible.builtin.include_tasks: manage_dns_records.yml |
| 14 | + tags: ['dns'] |
14 | 15 |
|
15 | 16 | # DHCP Reservations (gestione speciale per MAC address) |
16 | 17 | - name: Manage DHCP reservations via API |
17 | 18 | ansible.builtin.include_tasks: manage_dhcp_reservations.yml |
| 19 | + tags: ['dhcp'] |
18 | 20 |
|
19 | 21 | # Adlists |
20 | 22 | - name: Manage Adlists via API |
|
26 | 28 | key_attribute: "address" |
27 | 29 | desired_resources: "{{ pihole.adlists }}" |
28 | 30 | trigger_gravity: true |
29 | | - update_condition: >- |
30 | | - existing_dict[item].enabled != (desired_dict[item].enabled | default(true) | int) or |
31 | | - existing_dict[item].comment != (desired_dict[item].comment | default('')) |
32 | | - body_template: |
33 | | - address: "{{ desired_dict[item].url }}" |
34 | | - enabled: "{{ desired_dict[item].enabled | default(true) }}" |
35 | | - comment: "{{ desired_dict[item].comment | default('') }}" |
36 | 31 | when: pihole.adlists is defined |
| 32 | + tags: ['adlists', 'lists'] |
37 | 33 |
|
38 | 34 | # Whitelist Domains |
39 | 35 | - name: Manage Whitelist domains via API |
|
44 | 40 | response_key: "whitelist" |
45 | 41 | key_attribute: "domain" |
46 | 42 | desired_resources: "{{ pihole.whitelist.domains }}" |
47 | | - update_condition: >- |
48 | | - existing_dict[item].enabled != (desired_dict[item].enabled | default(true) | int) or |
49 | | - existing_dict[item].comment != (desired_dict[item].comment | default('')) |
50 | | - body_template: |
51 | | - domain: "{{ desired_dict[item].domain }}" |
52 | | - enabled: "{{ desired_dict[item].enabled | default(true) }}" |
53 | | - comment: "{{ desired_dict[item].comment | default('') }}" |
54 | 43 | when: pihole.whitelist.domains is defined |
| 44 | + tags: ['whitelist', 'lists'] |
55 | 45 |
|
56 | 46 | # Whitelist Regex |
57 | 47 | - name: Manage Whitelist regex via API |
|
62 | 52 | response_key: "regex" |
63 | 53 | key_attribute: "domain" |
64 | 54 | desired_resources: "{{ pihole.whitelist.regex }}" |
65 | | - update_condition: >- |
66 | | - existing_dict[item].enabled != (desired_dict[item].enabled | default(true) | int) or |
67 | | - existing_dict[item].comment != (desired_dict[item].comment | default('')) |
68 | | - body_template: |
69 | | - domain: "{{ desired_dict[item].domain }}" |
70 | | - enabled: "{{ desired_dict[item].enabled | default(true) }}" |
71 | | - comment: "{{ desired_dict[item].comment | default('') }}" |
72 | 55 | when: pihole.whitelist.regex is defined |
| 56 | + tags: ['whitelist', 'lists'] |
73 | 57 |
|
74 | 58 | # Blacklist Domains |
75 | 59 | - name: Manage Blacklist domains via API |
|
80 | 64 | response_key: "blacklist" |
81 | 65 | key_attribute: "domain" |
82 | 66 | desired_resources: "{{ pihole.blacklist.domains }}" |
83 | | - update_condition: >- |
84 | | - existing_dict[item].enabled != (desired_dict[item].enabled | default(true) | int) or |
85 | | - existing_dict[item].comment != (desired_dict[item].comment | default('')) |
86 | | - body_template: |
87 | | - domain: "{{ desired_dict[item].domain }}" |
88 | | - enabled: "{{ desired_dict[item].enabled | default(true) }}" |
89 | | - comment: "{{ desired_dict[item].comment | default('') }}" |
90 | 67 | when: pihole.blacklist.domains is defined |
| 68 | + tags: ['blacklist', 'lists'] |
91 | 69 |
|
92 | 70 | # Blacklist Regex |
93 | 71 | - name: Manage Blacklist regex via API |
|
98 | 76 | response_key: "regex" |
99 | 77 | key_attribute: "domain" |
100 | 78 | desired_resources: "{{ pihole.blacklist.regex }}" |
101 | | - update_condition: >- |
102 | | - existing_dict[item].enabled != (desired_dict[item].enabled | default(true) | int) or |
103 | | - existing_dict[item].comment != (desired_dict[item].comment | default('')) |
104 | | - body_template: |
105 | | - domain: "{{ desired_dict[item].domain }}" |
106 | | - enabled: "{{ desired_dict[item].enabled | default(true) }}" |
107 | | - comment: "{{ desired_dict[item].comment | default('') }}" |
108 | 79 | when: pihole.blacklist.regex is defined |
| 80 | + tags: ['blacklist', 'lists'] |
109 | 81 |
|
110 | 82 | - name: Update gravity if lists changed |
111 | 83 | ansible.builtin.include_tasks: update_gravity.yml |
112 | 84 | when: adlists_changed is defined and adlists_changed |
| 85 | + tags: ['gravity', 'lists'] |
113 | 86 |
|
114 | 87 | - name: Check and update Pi-hole |
115 | 88 | ansible.builtin.include_tasks: update_pihole.yml |
116 | 89 | when: pihole.check_updates | default(true) |
| 90 | + tags: ['updates'] |
0 commit comments