|
208 | 208 | state: "{{ item.state | default('present') }}"
|
209 | 209 | comment: "{{ item.comment | default(omit) }}"
|
210 | 210 | with_items: "{{ pve_pools }}"
|
211 |
| - when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 211 | + when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
212 | 212 |
|
213 | 213 | - name: Configure Proxmox roles
|
214 | 214 | proxmox_role:
|
215 | 215 | name: "{{ item.name }}"
|
216 | 216 | privileges: "{{ item.privileges }}"
|
217 | 217 | state: "{{ item.state | default('present') }}"
|
218 | 218 | with_items: "{{ pve_roles }}"
|
219 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 219 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
220 | 220 |
|
221 | 221 | - name: Configure Proxmox groups
|
222 | 222 | proxmox_group:
|
223 | 223 | name: "{{ item.name }}"
|
224 | 224 | state: "{{ item.state | default('present') }}"
|
225 | 225 | comment: "{{ item.comment | default(omit) }}"
|
226 | 226 | with_items: "{{ pve_groups }}"
|
227 |
| - when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 227 | + when: "not pve_cluster_enabled or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
228 | 228 |
|
229 | 229 | - name: Configure Proxmox user accounts
|
230 | 230 | proxmox_user:
|
|
239 | 239 | password: "{{ item.password | default(omit) }}"
|
240 | 240 | expire: "{{ item.expire | default(omit) }}"
|
241 | 241 | with_items: "{{ pve_users }}"
|
242 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 242 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
243 | 243 |
|
244 | 244 | - name: Configure Proxmox ACLs
|
245 | 245 | proxmox_acl:
|
|
249 | 249 | groups: "{{ item.groups | default([]) }}"
|
250 | 250 | users: "{{ item.users | default([]) }}"
|
251 | 251 | with_items: "{{ pve_acls }}"
|
252 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 252 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
253 | 253 |
|
254 | 254 | - name: Create ZFS Pools
|
255 | 255 | zfs:
|
|
287 | 287 | thinpool: "{{ item.thinpool | default(omit) }}"
|
288 | 288 | sparse: "{{ item.sparse | default(omit) }}"
|
289 | 289 | with_items: "{{ pve_storages }}"
|
290 |
| - when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 290 | + when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
291 | 291 | tags: storage
|
292 | 292 |
|
293 | 293 | - name: Check datacenter.cfg exists
|
294 | 294 | stat:
|
295 | 295 | path: "/etc/pve/datacenter.cfg"
|
296 | 296 | register: _datacenter_cfg
|
297 | 297 | when:
|
298 |
| - - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 298 | + - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
299 | 299 | - "pve_datacenter_cfg | length > 0"
|
300 | 300 |
|
301 | 301 | - name: Create datacenter.cfg if it does not exist
|
|
304 | 304 | state: "touch"
|
305 | 305 | mode: 0640
|
306 | 306 | when:
|
307 |
| - - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 307 | + - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
308 | 308 | - "pve_datacenter_cfg | length > 0"
|
309 | 309 | - "not _datacenter_cfg.stat.exists"
|
310 | 310 |
|
|
319 | 319 | {{ k }}: {{ v }}
|
320 | 320 | {% endfor %}
|
321 | 321 | when:
|
322 |
| - - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == groups[pve_group][0])" |
| 322 | + - "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)" |
323 | 323 | - "pve_datacenter_cfg | length > 0"
|
324 | 324 |
|
325 | 325 | - import_tasks: ssl_config.yml
|
|
0 commit comments