Playbook for setting up XOS for MWC demo

Change-Id: I57e3ef9de4270e9ac9a0e73a8489a00dd4a180c1
diff --git a/mcord-cavium-test-playbook.yml b/mcord-cavium-test-playbook.yml
deleted file mode 100644
index 794852a..0000000
--- a/mcord-cavium-test-playbook.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-# 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.
-
-
----
-# mcord-ng40-test-playbook.yml
-# Tests CiaB cord-pod XOS configuration
-
-- name: Run base M-CORD tests
-  hosts: head
-  become: no
-  # These variables could be elevated to the profile. Think about
-  # doing this after the E2E test framework is complete.
-  vars:
-    test_networks:
-      - management
-      - sgi_network
-      - s11_network
-      - spgw_network
-      - s6a_network
-      - db_network
-      - flat_network_s1mme
-      - flat_network_s1u
-    test_services:
-      - vmme
-      - vhss
-      - hssdb
-      - vspgwc
-      - vspgwu
-    test_ports:
-      - { vm: vmme, network: management }
-      - { vm: vmme, network: s11_network }
-      - { vm: vmme, network: s6a_network }
-      - { vm: vmme, network: flat_network_s1mme }
-      - { vm: vhss, network: management }
-      - { vm: vhss, network: s6a_network }
-      - { vm: vhss, network: db_network }
-      - { vm: hssdb, network: management }
-      - { vm: hssdb, network: db_network }
-      - { vm: vspgwc, network: management }
-      - { vm: vspgwc, network: s11_network }
-      - { vm: vspgwc, network: spgw_network }
-      - { vm: vspgwu, network: management }
-      - { vm: vspgwu, network: flat_network_s1u }
-      - { vm: vspgwu, network: sgi_network }
-      - { vm: vspgwu, network: spgw_network }
-    epc_blueprint: mcord_5
-    epc_sync_objects:
-      - vspgwu/vspgwutenants
-      - vspgwc/vspgwctenants
-      - vmme/vmmetenants
-      - vhss/vhsstenants
-      - hssdb/hssdbserviceinstances
-  roles:
-    - create-epc
-    - test-mcord-base
-    - epc-synced
diff --git a/mcord-ng40-test-playbook.yml b/mcord-ng40-test-playbook.yml
deleted file mode 100644
index 2f906a3..0000000
--- a/mcord-ng40-test-playbook.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-# 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.
-
-
----
-# mcord-ng40-test-playbook.yml
-# Tests CiaB cord-pod XOS configuration
-
-- name: Run base M-CORD tests
-  hosts: head
-  become: no
-  # These variables could be elevated to the profile. Think about
-  # doing this after the E2E test framework is complete.
-  vars:
-    test_networks:
-      - management
-      - sgi_network
-      - s11_network
-      - spgw_network
-    test_services:
-      - venb
-      - vspgwc
-      - vspgwu
-    test_ports:
-      - { vm: venb, network: management }
-      - { vm: venb, network: s11_network }
-      - { vm: venb, network: sgi_network }
-      - { vm: venb, network: s1u_network }
-      - { vm: vspgwc, network: management }
-      - { vm: vspgwc, network: s11_network }
-      - { vm: vspgwc, network: spgw_network }
-      - { vm: vspgwu, network: management }
-      - { vm: vspgwu, network: s1u_network }
-      - { vm: vspgwu, network: sgi_network }
-      - { vm: vspgwu, network: spgw_network }
-    epc_blueprint: build
-    epc_sync_objects:
-      - vspgwu/vspgwutenants
-      - vspgwc/vspgwctenants
-      - venb/venbserviceinstances
-  roles:
-    - create-epc
-    - test-mcord-base
-    - epc-synced
-    - run-ng40
diff --git a/roles/create-epc/defaults/main.yml b/roles/create-epc/defaults/main.yml
deleted file mode 100644
index 13a4aec..0000000
--- a/roles/create-epc/defaults/main.yml
+++ /dev/null
@@ -1,24 +0,0 @@
----
-
-# 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.
-
-# roles/create-epc/defaults/main.yml
-
-head_credentials_dir: "/opt/credentials"
-
-xos_admin_user: "xosadmin@opencord.org"
-head_xos_admin_pass: "{{ lookup('file', head_credentials_dir ~ '/' ~ xos_admin_user) }}"
-
-epc_blueprint: "build"
diff --git a/roles/create-epc/tasks/main.yml b/roles/create-epc/tasks/main.yml
deleted file mode 100644
index fca4c96..0000000
--- a/roles/create-epc/tasks/main.yml
+++ /dev/null
@@ -1,47 +0,0 @@
----
-
-# 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.
-
-# roles/create-epc/tasks/main.yml
-
-- name: Check for EPC ServiceInstance
-  uri:
-    url: http://localhost/xosapi/v1/vepc/vepcserviceinstances
-    user: "{{ xos_admin_user }}"
-    password: "{{ head_xos_admin_pass }}"
-    return_content: yes
-  register: result
-
-- name: Get EPC Service ID
-  uri:
-    url: http://localhost/xosapi/v1/vepc/vepcservices
-    user: "{{ xos_admin_user }}"
-    password: "{{ head_xos_admin_pass }}"
-    return_content: yes
-  register: vepcservice
-  when: not result.json["items"]
-
-- name: Create EPC
-  uri:
-    url: http://localhost/xosapi/v1/vepc/vepcserviceinstances
-    user: "{{ xos_admin_user }}"
-    password: "{{ head_xos_admin_pass }}"
-    method: POST
-    body:
-      blueprint: "{{ epc_blueprint }}"
-      owner_id: "{{ vepcservice.json['items'][0]['id'] }}"
-      site_id: 1
-    body_format: json
-  when: not result.json["items"]
diff --git a/roles/epc-synced/defaults/main.yml b/roles/epc-synced/defaults/main.yml
deleted file mode 100644
index 3e41139..0000000
--- a/roles/epc-synced/defaults/main.yml
+++ /dev/null
@@ -1,24 +0,0 @@
----
-
-# 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.
-
-# roles/epc-synced/defaults/main.yml
-
-head_credentials_dir: "/opt/credentials"
-
-xos_admin_user: "xosadmin@opencord.org"
-head_xos_admin_pass: "{{ lookup('file', head_credentials_dir ~ '/' ~ xos_admin_user) }}"
-
-epc_sync_objects: []
diff --git a/roles/epc-synced/tasks/main.yml b/roles/epc-synced/tasks/main.yml
deleted file mode 100644
index d31a3dc..0000000
--- a/roles/epc-synced/tasks/main.yml
+++ /dev/null
@@ -1,29 +0,0 @@
----
-
-# 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.
-
-# roles/epc-synced/tasks/main.yml
-
-- name: Wait for synchronizers to run
-  uri:
-    url: http://localhost/xosapi/v1/{{ item }}
-    user: "{{ xos_admin_user }}"
-    password: "{{ head_xos_admin_pass }}"
-    return_content: yes
-  register: result
-  until: result.json["items"] and result.json["items"][0]["backend_status"] == "OK"
-  retries: 20
-  delay: 30
-  with_items: "{{ epc_sync_objects }}"
diff --git a/roles/test-mcord-base/defaults/main.yml b/roles/test-mcord-base/defaults/main.yml
deleted file mode 100644
index f4572f7..0000000
--- a/roles/test-mcord-base/defaults/main.yml
+++ /dev/null
@@ -1,48 +0,0 @@
----
-# 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.
-
-# test-mcord-base/defaults/main.yml
-
-test_networks:
-  - management
-  - sgi_network
-  - s11_network
-  - s1mme_network
-  - sbi_network
-  - nbi_network
-
-test_services:
-  - internetemulator
-  - vmme
-  - vspgwc
-  - sdncontroller
-  - vspgwu
-
-test_ports:
-  - { vm: vmme, network: management }
-  - { vm: vmme, network: s11_network }
-  - { vm: vmme, network: s1mme_network }
-  - { vm: vspgwc, network: management }
-  - { vm: vspgwc, network: s11_network }
-  - { vm: vspgwc, network: nbi_network }
-  - { vm: sdncontroller, network: management }
-  - { vm: sdncontroller, network: nbi_network }
-  - { vm: sdncontroller, network: sbi_network }
-  - { vm: vspgwu, network: management }
-  - { vm: vspgwu, network: s1u_network }
-  - { vm: vspgwu, network: sgi_network }
-  - { vm: vspgwu, network: sbi_network }
-  - { vm: internetemulator, network: management }
-  - { vm: internetemulator, network: sgi_network }
diff --git a/roles/test-mcord-base/tasks/main.yml b/roles/test-mcord-base/tasks/main.yml
deleted file mode 100644
index 111e019..0000000
--- a/roles/test-mcord-base/tasks/main.yml
+++ /dev/null
@@ -1,68 +0,0 @@
----
-# 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.
-
-# test-mcord-base/tasks/main.yml
-# Run tests to check that the base elements of M-CORD are present
-
-- name: Wait for networks to be synchronized
-  shell: source /opt/cord_profile/admin-openrc.sh; neutron net-list|grep '{{ item }}' > /dev/null
-  args:
-    executable: /bin/bash
-  register: result
-  until: result | success
-  retries: 10
-  delay: 60
-  with_items: "{{ test_networks }}"
-  tags:
-    - skip_ansible_lint # running a sub job
-
-- name: Wait for VMs to appear in Nova
-  shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}' > /dev/null
-  args:
-    executable: /bin/bash
-  register: result
-  until: result | success
-  retries: 10
-  delay: 60
-  with_items: "{{ test_services }}"
-  tags:
-    - skip_ansible_lint # running a sub job
-
-- name: Delete any VMs that are in ERROR state (XOS will re-create them)
-  shell: source /opt/cord_profile/admin-openrc.sh; for vm in $(nova list --all-tenants|grep 'ERROR'|awk '{ print $2 }'); do nova delete $vm; done
-  args:
-    executable: /bin/bash
-  tags:
-    - skip_ansible_lint # running a sub job
-
-- name: Wait for VMs to come up
-  shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}.*ACTIVE' > /dev/null
-  args:
-    executable: /bin/bash
-  register: result
-  until: result | success
-  retries: 10
-  delay: 60
-  with_items: "{{ test_services }}"
-  tags:
-    - skip_ansible_lint # running a sub job
-
-- name: Verify that VMs are properly networked
-  shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item.vm }}.*ACTIVE.*{{ item.network }}' > /dev/null
-  args:
-    executable: /bin/bash
-  with_items: "{{ test_ports }}"
-  tags:
-    - skip_ansible_lint # running a sub job