|
216 | 216 | state: "{{ item.state | default('present') }}"
|
217 | 217 | comment: "{{ item.comment | default(omit) }}"
|
218 | 218 | with_items: "{{ pve_pools }}"
|
219 |
| - when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 219 | + when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
220 | 220 |
|
221 | 221 | - name: Configure Proxmox roles
|
222 | 222 | proxmox_role:
|
223 | 223 | name: "{{ item.name }}"
|
224 | 224 | privileges: "{{ item.privileges }}"
|
225 | 225 | state: "{{ item.state | default('present') }}"
|
226 | 226 | with_items: "{{ pve_roles }}"
|
227 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 227 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
228 | 228 |
|
229 | 229 | - name: Configure Proxmox groups
|
230 | 230 | proxmox_group:
|
231 | 231 | name: "{{ item.name }}"
|
232 | 232 | state: "{{ item.state | default('present') }}"
|
233 | 233 | comment: "{{ item.comment | default(omit) }}"
|
234 | 234 | with_items: "{{ pve_groups }}"
|
235 |
| - when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 235 | + when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
236 | 236 |
|
237 | 237 | - name: Configure Proxmox user accounts
|
238 | 238 | proxmox_user:
|
|
247 | 247 | password: "{{ item.password | default(omit) }}"
|
248 | 248 | expire: "{{ item.expire | default(omit) }}"
|
249 | 249 | with_items: "{{ pve_users }}"
|
250 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 250 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
251 | 251 |
|
252 | 252 | - name: Configure Proxmox ACLs
|
253 | 253 | proxmox_acl:
|
|
257 | 257 | groups: "{{ item.groups | default([]) }}"
|
258 | 258 | users: "{{ item.users | default([]) }}"
|
259 | 259 | with_items: "{{ pve_acls }}"
|
260 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 260 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
261 | 261 |
|
262 | 262 | - name: Create ZFS Pools
|
263 | 263 | zfs:
|
|
301 | 301 | thinpool: "{{ item.thinpool | default(omit) }}"
|
302 | 302 | sparse: "{{ item.sparse | default(omit) }}"
|
303 | 303 | with_items: "{{ pve_storages }}"
|
304 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 304 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
305 | 305 | tags: storage
|
306 | 306 |
|
307 | 307 | - name: Check datacenter.cfg exists
|
308 | 308 | stat:
|
309 | 309 | path: "/etc/pve/datacenter.cfg"
|
310 | 310 | register: _datacenter_cfg
|
311 | 311 | when:
|
312 |
| - - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 312 | + - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
313 | 313 | - "pve_datacenter_cfg | length > 0"
|
314 | 314 |
|
315 | 315 | - name: Create datacenter.cfg if it does not exist
|
|
318 | 318 | state: "touch"
|
319 | 319 | mode: 0640
|
320 | 320 | when:
|
321 |
| - - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 321 | + - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
322 | 322 | - "pve_datacenter_cfg | length > 0"
|
323 | 323 | - "not _datacenter_cfg.stat.exists"
|
324 | 324 |
|
|
333 | 333 | {{ k }}: {{ v }}
|
334 | 334 | {% endfor %}
|
335 | 335 | when:
|
336 |
| - - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 336 | + - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
337 | 337 | - "pve_datacenter_cfg | length > 0"
|
338 | 338 |
|
339 | 339 | - import_tasks: ssl_config.yml
|
|
0 commit comments