Skip to content

Commit 4f36ace

Browse files
committed
update receptor peer config
1 parent b1730b0 commit 4f36ace

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

olam/deploy_olam_cluster.yml

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,18 @@
493493
when:
494494
- inventory_hostname in groups.execution
495495
- inventory_hostname not in groups.hop
496+
497+
- name: Add tcp-peers for control nodes
498+
ansible.builtin.lineinfile:
499+
path: /etc/receptor/receptor.conf
500+
insertbefore: '^- control-service:'
501+
line: |
502+
- tcp-peer:
503+
address: {{ hostvars[item]['ansible_default_ipv4']['address'] }}:27199
504+
redial: true
505+
with_inventory_hostnames:
506+
- "{{ groups.control | difference([inventory_hostname]) | join(',') }}"
507+
when: inventory_hostname in groups.control
496508

497509
- name: Add tcp-peers if present
498510
ansible.builtin.lineinfile:
@@ -516,6 +528,12 @@
516528
msg: "{{command_output.stdout_lines}}"
517529
when: debug_enabled
518530

531+
- name: Enable and start receptor service
532+
ansible.builtin.systemd:
533+
name: receptor-awx
534+
state: started
535+
enabled: true
536+
519537
- name: Provision awx
520538
hosts: control[0]
521539
vars_files:
@@ -589,22 +607,22 @@
589607

590608
tasks:
591609

592-
- name: Run awx-manage peers
593-
ansible.builtin.shell: |
594-
awx-manage register_peers {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} --peers {{ hostvars[item]['ansible_default_ipv4']['address'] }}
595-
args:
596-
executable: /bin/bash
597-
become_user: awx
598-
register: awx_peers
599-
with_inventory_hostnames:
600-
- "{{ peers }}"
601-
when: ( peers is defined )
602-
delegate_to: "{{ groups['control'][0] }}"
603-
604-
- name: Print to awx_peers
605-
ansible.builtin.debug:
606-
msg: "{{awx_peers}}"
607-
when: debug_enabled
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
608626

609627
- name: Enable and start ol-automation service
610628
ansible.builtin.systemd:
@@ -623,4 +641,4 @@
623641
ansible.builtin.command: "loginctl enable-linger awx"
624642
register: linger_result
625643
changed_when: linger_result.rc == 0
626-
when: not user_lingering.stat.exists
644+
when: not user_lingering.stat.exists

0 commit comments

Comments
 (0)