This commit is contained in:
2025-11-26 23:38:01 +02:00
parent cb671b3474
commit c91a28581d

View File

@@ -819,11 +819,10 @@
task_name: "customfield_set" task_name: "customfield_set"
task_result: "indoor_hostname={{ indoor_hostname_value }}" task_result: "indoor_hostname={{ indoor_hostname_value }}"
- name: Publish indoor_hostname customfield to control queue - name: Publish indoor_hostname custom field to control queue
when: indoor_hostname_payload is defined
delegate_to: localhost delegate_to: localhost
ansible.builtin.uri: uri:
url: "http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/{{ rmq_vhost | urlencode }}/{{ rmq_exchange | urlencode }}/publish" url: "http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/{{ rmq_vhost|urlencode }}/{{ rmq_exchange|urlencode }}/publish"
method: POST method: POST
user: "{{ rmq_user }}" user: "{{ rmq_user }}"
password: "{{ rmq_pass }}" password: "{{ rmq_pass }}"
@@ -836,14 +835,15 @@
properties: properties:
content_type: "application/json" content_type: "application/json"
routing_key: "{{ control_queue }}" 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" payload_encoding: "string"
register: rmq_indoor_hostname_resp changed_when: false
changed_when: (rmq_indoor_hostname_resp.json is defined) and (rmq_indoor_hostname_resp.json.routed | default(false) | bool) when: indoor_hostname_value is defined
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))
- name: Build specific image marker path on DEV2 (/tmp/prepared_for_<image>) - name: Build specific image marker path on DEV2 (/tmp/prepared_for_<image>)
ansible.builtin.set_fact: ansible.builtin.set_fact: