diff --git a/files/ansible-playbooks/update-indoor4.yml b/files/ansible-playbooks/update-indoor4.yml index 4e098bd..7465040 100644 --- a/files/ansible-playbooks/update-indoor4.yml +++ b/files/ansible-playbooks/update-indoor4.yml @@ -819,11 +819,10 @@ task_name: "customfield_set" task_result: "indoor_hostname={{ indoor_hostname_value }}" - - name: Publish indoor_hostname customfield to control queue - when: indoor_hostname_payload is defined + - name: Publish indoor_hostname custom field to control queue delegate_to: localhost - ansible.builtin.uri: - url: "http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/{{ rmq_vhost | urlencode }}/{{ rmq_exchange | urlencode }}/publish" + uri: + url: "http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/{{ rmq_vhost|urlencode }}/{{ rmq_exchange|urlencode }}/publish" method: POST user: "{{ rmq_user }}" password: "{{ rmq_pass }}" @@ -836,14 +835,15 @@ properties: content_type: "application/json" routing_key: "{{ control_queue }}" - payload: "{{ indoor_hostname_payload | to_json }}" + payload: "{{ { + 'inscope_device': (ansible_hostname | default(inventory_hostname)), + 'task_name': 'custom_field_set', + 'task_add1': 'indoor_hostname', + 'task_result': indoor_hostname_value + } | to_json }}" payload_encoding: "string" - register: rmq_indoor_hostname_resp - changed_when: (rmq_indoor_hostname_resp.json is defined) and (rmq_indoor_hostname_resp.json.routed | default(false) | bool) - failed_when: > - (rmq_indoor_hostname_resp.status != 200) or - (rmq_indoor_hostname_resp.json is not defined) or - (not (rmq_indoor_hostname_resp.json.routed | default(false) | bool)) + changed_when: false + when: indoor_hostname_value is defined - name: Build specific image marker path on DEV2 (/tmp/prepared_for_) ansible.builtin.set_fact: