blob: 5819e50be022ac124fbe6c2c7ff9acbf1523c361 [file] [log] [blame]
---
# tasks file for opdk-set-reachable
- name: Check for {{ server_type }} self report
opdk_server_self:
server_type: '{{ server_type }}'
username: '{{ opdk_user_email }}'
password: '{{ opdk_user_pass }}'
- name: Set uuid if router
set_fact:
uuid: '{{ edge_router_self.uUID }}'
when: edge_router_self is defined and server_type == 'router'
- name: Set uuid if message processor
set_fact:
uuid: '{{ edge_mp_self.uUID }}'
when: edge_mp_self is defined and server_type == 'mp'
- name: Set reachability to {{ reachable }} if set
uri:
user: '{{ opdk_user_email }}'
password: '{{ opdk_user_pass }}'
method: POST
status_code: 200
body_format: json
url: http://{{ public_mgmt_ip }}:{{ ms_ext_mgmt_port }}/v1/servers/{{ uuid }}
body: "reachable: {{ reachable }}"
when: uuid is defined