blob: 5ed93555c6901e13953abd54879f538a2a76b49b [file] [log] [blame]
Matteo Scandoloeb0d11c2017-08-08 13:05:26 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Scott Baker31acc652016-06-23 15:47:56 -070017---
18- hosts: {{ instance_name }}
19 gather_facts: False
20 connection: ssh
21 user: {{ username }}
Sapan Bhatia22c5dca2017-02-07 11:32:56 -080022 become: yes
Scott Baker31acc652016-06-23 15:47:56 -070023
24 tasks:
25
26 - name: Get Docker IP
27 #TODO: copy dockerip.sh to monitoring service synchronizer
28 script: /opt/xos/synchronizers/onos/scripts/dockerip.sh {{ sflow_container }}
29 register: sflowserviceaddr
30
31 - name: Wait for SFlow service to come up
32 wait_for:
33 host={{ '{{' }} sflowserviceaddr.stdout {{ '}}' }}
34 port={{ '{{' }} item {{ '}}' }}
35 state=present
36 with_items:
37 - {{ sflow_api_port }}
38
39 - name: Invoke SFlow service REST API to subscribe
40 uri:
41 url: http://{{ '{{' }} sflowserviceaddr.stdout {{ '}}' }}:{{ sflow_api_port }}/subscribe
42 body: "{{ listening_endpoint }}"
43 body_format: raw
44 method: POST