diff --git a/files/ansible-playbooks/update-indoor-scheduler.yml b/files/ansible-playbooks/update-indoor-scheduler.yml index 9a82fc8..51fcea9 100644 --- a/files/ansible-playbooks/update-indoor-scheduler.yml +++ b/files/ansible-playbooks/update-indoor-scheduler.yml @@ -92,6 +92,6 @@ changed_when: false -- import_playbook: update-indoor6-stable.patched.yml +- import_playbook: update-indoor6-stable.yml vars: is_run_by: "scheduler" diff --git a/files/ansible-playbooks/update-indoor6-stable.yml b/files/ansible-playbooks/update-indoor6-stable.yml index d5e6f4d..b2baaa4 100644 --- a/files/ansible-playbooks/update-indoor6-stable.yml +++ b/files/ansible-playbooks/update-indoor6-stable.yml @@ -1456,6 +1456,30 @@ reboot_applied_cf: "{{ (dev2_reboot_sched is defined) and (dev2_reboot_sched.rc is defined) and ((dev2_reboot_sched.rc | int) == 0) }}" changed_when: false + - name: Scheduler mode set action_state waiting when reboot initiated + when: is_run_by_effective == 'scheduler' and (reboot_applied_cf | default(false)) + delegate_to: localhost + ansible.builtin.uri: + url: "http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/{{ rmq_vhost|urlencode }}/{{ rmq_exchange|urlencode }}/publish" + method: POST + user: "{{ rmq_user }}" + password: "{{ rmq_pass }}" + force_basic_auth: true + status_code: 200 + headers: + content-type: "application/json" + body_format: json + body: + properties: + content_type: "application/json" + routing_key: "{{ control_queue }}" + payload: "{{ { + 'inscope_device': (ansible_hostname | default(inventory_hostname)), + 'task_name': 'custom_field_set', + 'task_add1': 'action_state', + 'task_result': 'waiting' + } | to_json }}" + - name: Scheduler mode publish action_restart_timestamp custom field to control queue when: is_run_by_effective == 'scheduler' and (reboot_applied_cf | default(false)) delegate_to: localhost