Matteo Scandolo | eb0d11c | 2017-08-08 13:05:26 -0700 | [diff] [blame^] | 1 | |
| 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 | |
rdudyala | 996d70b | 2016-10-13 17:40:55 +0000 | [diff] [blame] | 17 | --- |
| 18 | - hosts: 127.0.0.1 |
| 19 | connection: local |
| 20 | gather_facts: False |
| 21 | user: ubuntu |
| 22 | vars: |
| 23 | monitoringagents: |
| 24 | {% for agent in agents %} |
| 25 | - url: {{ agent.url }} |
| 26 | body: {{ agent.body }} |
| 27 | {% endfor %} |
| 28 | |
| 29 | tasks: |
Srikanth Vavilapalli | 3a28960 | 2016-12-16 01:44:43 +0000 | [diff] [blame] | 30 | # - name: debug |
| 31 | # debug: msg=" {{ '{{' }} item {{ '}}' }} " |
| 32 | # with_items: " {{ '{{' }} monitoringagents {{ '}}' }} " |
rdudyala | 996d70b | 2016-10-13 17:40:55 +0000 | [diff] [blame] | 33 | |
| 34 | - name: starting openstack service monitoring agent |
| 35 | uri: |
| 36 | url: "{{ '{{' }} item.url {{ '}}' }}" |
| 37 | method: POST |
| 38 | body: "{{ '{{' }} item.body {{ '}}' }}" |
| 39 | force_basic_auth: yes |
| 40 | status_code: 200 |
| 41 | body_format: json |
| 42 | with_items: " {{ '{{' }} monitoringagents {{ '}}' }} " |
| 43 | |