|
149 | 149 |
|
150 | 150 | - debug: |
151 | 151 | msg: "Primary: {{ primary }}, on_controller: {{ on_controller }}, in_cloud: {{ in_cloud }}" |
152 | | - |
153 | | - - name: Setting trix_external_fqdn |
154 | | - set_fact: |
155 | | - trix_external_fqdn: '{{ ansible_fqdn }}' |
156 | | - when: (trix_external_fqdn is not defined) or trix_external_fqdn=="" |
157 | | - |
158 | | - - debug: |
159 | | - msg: "trix_external_fqdn: {{ trix_external_fqdn }}" |
160 | 152 | tags: always |
161 | 153 |
|
162 | 154 |
|
|
335 | 327 | tags: always |
336 | 328 | when: ansible_connection not in 'chroot' and on_controller |
337 | 329 |
|
| 330 | + |
338 | 331 | - block: |
339 | 332 | - block: |
340 | 333 | - name: Trying to figure out external interface |
|
377 | 370 | tags: always |
378 | 371 | when: ansible_connection not in 'chroot' and on_controller |
379 | 372 |
|
| 373 | + |
| 374 | +- block: |
| 375 | + - name: Copy resolv.sh script to /tmp |
| 376 | + copy: |
| 377 | + src: 'resolve.sh' |
| 378 | + dest: '/tmp/resolve.sh' |
| 379 | + mode: 0755 |
| 380 | + |
| 381 | + - name: Resolving trix_external_fqdn |
| 382 | + command: "/tmp/resolve.sh {{ trix_ctrl_external_ip }} {{ trix_dns_forwarders | default([]) | first }}" |
| 383 | + register: trix_resolved_host_fqdn |
| 384 | + ignore_errors: true |
| 385 | + when: trix_ctrl_external_ip is defined |
| 386 | + |
| 387 | + - name: Setting trix_external_fqdn |
| 388 | + set_fact: |
| 389 | + trix_external_fqdn: "{{ trix_resolved_host_fqdn.stdout }}" |
| 390 | + when: |
| 391 | + - (trix_external_fqdn is not defined) or trix_external_fqdn=="" |
| 392 | + - trix_resolved_host_fqdn is defined |
| 393 | + |
| 394 | + - block: |
| 395 | + - fail: |
| 396 | + msg: 'trix_external_fqdn is not configured and it could not be resolved. I can continue but OpenOndemand might not work properly' |
| 397 | + ignore_errors: true |
| 398 | + |
| 399 | + - name: Wait 10s before continuing with a default |
| 400 | + wait_for: |
| 401 | + timeout: 10 |
| 402 | + |
| 403 | + - name: Setting trix_external_fqdn |
| 404 | + set_fact: |
| 405 | + trix_external_fqdn: '{{ ansible_fqdn }}' |
| 406 | + ignore_errors: true |
| 407 | + when: (trix_external_fqdn is not defined) or trix_external_fqdn=="" |
| 408 | + tags: always |
| 409 | + when: |
| 410 | + - ansible_connection not in 'chroot' and on_controller |
| 411 | + - (trix_external_fqdn is not defined) or trix_external_fqdn=="" |
| 412 | + |
| 413 | +- debug: |
| 414 | + msg: "trix_external_fqdn: {{ trix_external_fqdn }}" |
| 415 | + when: |
| 416 | + - ansible_connection not in 'chroot' and on_controller |
| 417 | + - trix_external_fqdn is defined |
| 418 | + |
| 419 | + |
380 | 420 | - block: |
381 | 421 | - name: Resolve admin group |
382 | 422 | getent: |
|
401 | 441 | num_ctrl: "{{ all_ctrl_ip | length }}" |
402 | 442 | tags: always |
403 | 443 |
|
404 | | -- name: Fetch selinux state |
405 | | - shell: getenforce || echo 'Disabled' |
406 | | - register: init_selinux_state |
407 | | - ignore_errors: true |
| 444 | +- block: |
| 445 | + - name: Fetch selinux state |
| 446 | + shell: getenforce || echo 'Disabled' |
| 447 | + register: init_selinux_state |
| 448 | + ignore_errors: true |
408 | 449 |
|
409 | | -- name: Verify if selinux matches with preferred state |
410 | | - fail: |
411 | | - msg: "Selinux enabled, but the system needs a reboot first to take effect. Please re-run after reboot" |
412 | | - when: |
413 | | - - enable_selinux|default(True) |
414 | | - - init_selinux_state.stdout is defined |
415 | | - - init_selinux_state.stdout == 'Disabled' |
| 450 | + - name: Verify if selinux matches with preferred state |
| 451 | + fail: |
| 452 | + msg: "Selinux enabled, but the system needs a reboot first to take effect. Please re-run after reboot" |
| 453 | + when: |
| 454 | + - enable_selinux|default(True) |
| 455 | + - init_selinux_state.stdout is defined |
| 456 | + - init_selinux_state.stdout == 'Disabled' |
416 | 457 |
|
417 | | -- name: Verify if selinux matches with preferred state |
418 | | - fail: |
419 | | - msg: "Selinux disabled, but the system needs a reboot first to take effect. Please re-run after reboot" |
420 | | - when: |
421 | | - - not enable_selinux|default(True) |
422 | | - - init_selinux_state.stdout is defined |
423 | | - - init_selinux_state.stdout == 'Enforcing' |
| 458 | + - name: Verify if selinux matches with preferred state |
| 459 | + fail: |
| 460 | + msg: "Selinux disabled, but the system needs a reboot first to take effect. Please re-run after reboot" |
| 461 | + when: |
| 462 | + - not enable_selinux|default(True) |
| 463 | + - init_selinux_state.stdout is defined |
| 464 | + - init_selinux_state.stdout == 'Enforcing' |
| 465 | + when: ansible_connection not in 'chroot' and on_controller |
424 | 466 |
|
425 | 467 | - name: Toggle selinux state |
426 | 468 | selinux: |
|
0 commit comments