| --- |
| # 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 |
| url: http://{{ public_mgmt_ip }}:{{ ms_ext_mgmt_port }}/v1/servers/{{ uuid }} |
| body: 'reachable={{ reachable }}' |
| HEADER_Content-type: 'application/x-www-form-urlencoded' |
| when: uuid is defined |