
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


---
- hosts: 127.0.0.1
  connection: local
  vars:
    appname: {{ appname }}
    dependencies: {{ dependencies }}
{% if component_configs %}
    component_configs:
{% for component_config in component_configs %}
       - component: {{ component_config.component }}
         config_params: {{  component_config.config_params }}
{% endfor %}
{% endif %}
{% if rest_configs %}
    var_rest_configs:
{% for rest_config in rest_configs %}
       - endpoint: {{ rest_config.endpoint }}
         body: "{{ '{{' }} lookup('file', '{{ files_dir }}/{{ rest_config.fn }}') {{ '}}' }}"
{% endfor %}
{% endif %}
    rest_hostname: {{ rest_hostname }}
    rest_port: {{ rest_port }}

  tasks:
{% if install_dependencies %}
  - name: Install ONOS apps by URL
    uri:
        url: "http://{{ rest_hostname }}:{{ rest_port }}/{{ '{{' }}  item.endpoint {{ '}}' }}"
        body: "{{ '{{' }} item.body | to_json {{ '}}' }}"
        user: onos
        password: rocks
        body_format: json
        method: POST
    with_items:
       {% for install_dependency in install_dependencies %}
       - endpoint: "onos/v1/applications"
         body:
           url: "{{ install_dependency }}"
           activate: "true"
       {% endfor %}
{% endif %}

{% if dependencies %}
  - name: Add dependencies to ONOS
    uri:
      url: http://{{ rest_hostname }}:{{ rest_port }}/onos/v1/applications/{{ '{{' }} item {{ '}}' }}/active
      method: POST
      user: karaf
      password: karaf
    with_items:
        {% for dependency in dependencies %}
        - {{ dependency }}
        {% endfor %}
{% endif %}

{% if rest_configs %}
# Do this after services have been activated, or it will cause an exception.
# vOLT will re-read its net config; vbng may not.
  - name: Add ONOS configuration values
    uri:
      url: http://{{ rest_hostname }}:{{ rest_port }}/{{ '{{' }} item.endpoint {{ '}}' }} #http://localhost:8181/onos/v1/network/configuration/
      body: "{{ '{{' }} item.body {{ '}}' }}"
      body_format: json
      method: POST
      user: karaf
      password: karaf
    with_items: "{{ '{{' }} var_rest_configs {{ '}}' }}"
{% endif %}
