Scott Baker | 31acc65 | 2016-06-23 15:47:56 -0700 | [diff] [blame] | 1 | --- |
| 2 | - hosts: {{ instance_name }} |
| 3 | gather_facts: False |
| 4 | connection: ssh |
| 5 | user: {{ username }} |
Sapan Bhatia | 22c5dca | 2017-02-07 11:32:56 -0800 | [diff] [blame] | 6 | become: yes |
Scott Baker | 31acc65 | 2016-06-23 15:47:56 -0700 | [diff] [blame] | 7 | |
| 8 | tasks: |
| 9 | |
| 10 | - name: Get Docker IP |
| 11 | #TODO: copy dockerip.sh to monitoring service synchronizer |
| 12 | script: /opt/xos/synchronizers/onos/scripts/dockerip.sh {{ sflow_container }} |
| 13 | register: sflowserviceaddr |
| 14 | |
| 15 | - name: Wait for SFlow service to come up |
| 16 | wait_for: |
| 17 | host={{ '{{' }} sflowserviceaddr.stdout {{ '}}' }} |
| 18 | port={{ '{{' }} item {{ '}}' }} |
| 19 | state=present |
| 20 | with_items: |
| 21 | - {{ sflow_api_port }} |
| 22 | |
| 23 | - name: Invoke SFlow service REST API to subscribe |
| 24 | uri: |
| 25 | url: http://{{ '{{' }} sflowserviceaddr.stdout {{ '}}' }}:{{ sflow_api_port }}/subscribe |
| 26 | body: "{{ listening_endpoint }}" |
| 27 | body_format: raw |
| 28 | method: POST |