|
607 | 607 |
|
608 | 608 | tasks:
|
609 | 609 |
|
610 |
| - # - name: Run awx-manage peers |
611 |
| - # ansible.builtin.shell: | |
612 |
| - # awx-manage register_peers {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} --peers {{ hostvars[item]['ansible_default_ipv4']['address'] }} |
613 |
| - # args: |
614 |
| - # executable: /bin/bash |
615 |
| - # become_user: awx |
616 |
| - # register: awx_peers |
617 |
| - # with_inventory_hostnames: |
618 |
| - # - "{{ peers }}" |
619 |
| - # when: ( peers is defined ) |
620 |
| - # delegate_to: "{{ groups['control'][0] }}" |
621 |
| - |
622 |
| - # - name: Print to awx_peers |
623 |
| - # ansible.builtin.debug: |
624 |
| - # msg: "{{awx_peers}}" |
625 |
| - # when: debug_enabled |
| 610 | + - name: Add receptor address to each instance |
| 611 | + ansible.builtin.shell: | |
| 612 | + axw-manage add_receptor_address --instance={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} --address={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} --port=27199 --canonical |
| 613 | + args: |
| 614 | + executable: /bin/bash |
| 615 | + become_user: awx |
| 616 | + register: awx_receptor_address |
| 617 | + delegate_to: "{{ groups['control'][0] }}" |
| 618 | + |
| 619 | + - name: Print to awx_receptor_address |
| 620 | + ansible.builtin.debug: |
| 621 | + msg: "{{awx_receptor_address}}" |
| 622 | + when: debug_enabled |
| 623 | + |
| 624 | + - name: Add links between control nodes |
| 625 | + ansible.builtin.shell: | |
| 626 | + awx-manage register_peers {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} --peers {{ hostvars[item]['ansible_default_ipv4']['address'] }} |
| 627 | + args: |
| 628 | + executable: /bin/bash |
| 629 | + become_user: awx |
| 630 | + register: awx_control_peers |
| 631 | + with_inventory_hostnames: |
| 632 | + - "{{ groups.control | difference([inventory_hostname]) | join(',') }}" |
| 633 | + when: inventory_hostname in groups['control'][0] |
| 634 | + delegate_to: "{{ groups['control'][0] }}" |
| 635 | + |
| 636 | + - name: Print to awx_control_peers |
| 637 | + ansible.builtin.debug: |
| 638 | + msg: "{{awx_control_peers}}" |
| 639 | + when: debug_enabled |
| 640 | + |
| 641 | + - name: Add links between receptor nodes |
| 642 | + ansible.builtin.shell: | |
| 643 | + awx-manage register_peers {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} --peers {{ hostvars[item]['ansible_default_ipv4']['address'] }} |
| 644 | + args: |
| 645 | + executable: /bin/bash |
| 646 | + become_user: awx |
| 647 | + register: awx_peers |
| 648 | + with_inventory_hostnames: |
| 649 | + - "{{ peers }}" |
| 650 | + when: ( peers is defined ) |
| 651 | + delegate_to: "{{ groups['control'][0] }}" |
| 652 | + |
| 653 | + - name: Print to awx_peers |
| 654 | + ansible.builtin.debug: |
| 655 | + msg: "{{awx_peers}}" |
| 656 | + when: debug_enabled |
626 | 657 |
|
627 | 658 | - name: Enable and start ol-automation service
|
628 | 659 | ansible.builtin.systemd:
|
|
0 commit comments