blob: f06981443f05a8995904e230a9c2b4896c03b97e [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Andy Baviereb418af2018-01-29 11:32:31 -070015- name: Generate fabric-network-cfg.json
16 shell: cord generate
17 register: cord_generate
Andy Bavieraf2b8a62017-08-14 12:33:39 -070018 tags:
Andy Baviereb418af2018-01-29 11:32:31 -070019 - skip_ansible_lint
20
21- name: Set cord_profile_src_dir
22 set_fact:
23 cord_profile_src_dir: "../../orchestration/profiles/{{ cord_use_case }}"
24
25- name: Set fabric_network_cfg_json
26 set_fact:
27 fabric_network_cfg_json: "{{ cord_generate.stdout }}"
28
29- name: Regenerate fabric-service.yaml
30 template:
31 src: "{{ cord_profile_src_dir }}/templates/fabric-service.yaml.j2"
32 dest: "{{ head_cord_profile_dir }}/fabric-service.yaml"
33
34- name: Slurp fabric-service.yaml
35 slurp:
36 src: "{{ head_cord_profile_dir }}/fabric-service.yaml"
37 register: slurpfile
38
39- name: Delete old ONOS fabric configuration
40 uri:
41 url: "http://onos-fabric:8181/onos/v1/network/configuration/"
42 method: DELETE
43 user: onos
44 password: rocks
45 status_code: 200, 204
46
47- name: Upload new fabric configuration to XOS
48 uri:
49 url: "{{ xos_tosca_url }}/run"
50 method: POST
51 headers:
52 xos-username: "{{ xos_admin_user }}"
53 xos-password: "{{ xos_admin_pass }}"
54 body: "{{ slurpfile['content'] | b64decode }}"
55 status_code: 200
56 register: result
57 until: result | success
58 retries: 5
59 delay: 5
60
61- name: Re-activate ONOS apps
62 uri:
63 url: "{{ item }}"
64 method: POST
65 user: onos
66 password: rocks
67 status_code: 200
68 with_items:
69 - "http://onos-fabric:8181/onos/v1/applications/org.onosproject.vrouter/active"
70 - "http://onos-fabric:8181/onos/v1/applications/org.onosproject.segmentrouting/active"