Skip to content

Commit f9540b2

Browse files
committed
add receptor address and swap peer from control to local exec
1 parent 4f36ace commit f9540b2

File tree

2 files changed

+49
-17
lines changed

2 files changed

+49
-17
lines changed

olam/convert_ansible_inventory.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ echo ""
2727

2828
echo "[control:vars]"
2929
echo "node_type=control"
30-
echo "peers=local_execution_group"
30+
# echo "peers=local_execution_group"
3131
echo ""
3232

3333
echo "[execution]"
@@ -40,6 +40,7 @@ echo ""
4040

4141
echo "[local_execution_group:vars]"
4242
echo "node_type=execution"
43+
echo "peers=control"
4344
echo ""
4445

4546
echo "[hop]"

olam/deploy_olam_cluster.yml

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -607,22 +607,53 @@
607607

608608
tasks:
609609

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
626657

627658
- name: Enable and start ol-automation service
628659
ansible.builtin.systemd:

0 commit comments

Comments
 (0)