added installation roles for XOS and ONOS on sub-vm's
diff --git a/roles/onos-vm-install/defaults/main.yml b/roles/onos-vm-install/defaults/main.yml
new file mode 100644
index 0000000..2a5be99
--- /dev/null
+++ b/roles/onos-vm-install/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+
diff --git a/roles/onos-vm-install/files/docker-compose.yml b/roles/onos-vm-install/files/docker-compose.yml
new file mode 100644
index 0000000..9b16c4d
--- /dev/null
+++ b/roles/onos-vm-install/files/docker-compose.yml
@@ -0,0 +1,10 @@
+onos:
+ image: onosproject/onos
+ expose:
+ - "6653"
+ - "8101"
+ - "8181"
+ - "9876"
+ net: host
+ volumes:
+ - ./id_rsa:/root/node_key:ro
diff --git a/roles/onos-vm-install/files/onos-setup-playbook.yml b/roles/onos-vm-install/files/onos-setup-playbook.yml
new file mode 100644
index 0000000..88839d0
--- /dev/null
+++ b/roles/onos-vm-install/files/onos-setup-playbook.yml
@@ -0,0 +1,69 @@
+---
+- hosts: onos-cord-1
+ remote_user: ubuntu
+
+ tasks:
+ - name: Include configuration vars
+ include_vars: onos-setup-vars.yml
+
+ # https://docs.docker.com/engine/installation/linux/ubuntulinux/
+ - name: Prereqs and SSL support for apt for SSL
+ become: yes
+ apt:
+ name={{ item }}
+ update_cache=yes
+ cache_valid_time=3600
+ with_items:
+ - apt-transport-https
+ - ca-certificates
+ - python-pip
+
+ - name: Trust docker apt key
+ become: yes
+ apt_key:
+ keyserver=pool.sks-keyservers.net
+ id=58118E89F3A912897C070ADBF76221572C52609D
+
+ - name: Add docker apt repo
+ become: yes
+ apt_repository:
+ repo="deb https://apt.dockerproject.org/repo ubuntu-trusty main"
+
+ - name: Install docker
+ become: yes
+ apt:
+ update_cache=yes
+ cache_valid_time=3600
+ name=docker-engine
+
+ - name: Make user part of the Docker group
+ become: yes
+ user:
+ name={{ ansible_user_id }}
+ groups="docker" append=yes
+
+ # https://docs.docker.com/compose/install/#install-using-pip
+ - name: Install docker-compose from PyPi
+ become: yes
+ pip:
+ name=docker-compose
+
+ - name: Copy over SSH keys
+ copy:
+ src=~/.ssh/{{ item }}
+ dest={{ ansible_user_dir }}/cord/{{ item }}
+ owner={{ ansible_user_id }} mode=0600
+ with_items:
+ - id_rsa
+ - id_rsa.pub
+
+ - name: Create CORD directory
+ file:
+ path={{ ansible_user_dir }}/cord
+ state=directory
+
+ - name: Copy over docker-compose.yml files
+ copy:
+ src=~/docker-compose.yml
+ dest={{ ansible_user_dir }}/cord/docker-compose.yml
+
diff --git a/roles/onos-vm-install/tasks/main.yml b/roles/onos-vm-install/tasks/main.yml
new file mode 100644
index 0000000..01e45fc
--- /dev/null
+++ b/roles/onos-vm-install/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+# onos-vm-install/tasks/main.yml
+#
+# Install ONOS on a sub vm by calling ansible
+
+- name: Create a vars file from template
+ template:
+ src=onos-setup-vars.yml.j2
+ dest={{ ansible_user_dir }}/onos-setup-vars.yml
+
+- name: Copy over ONOS playbook and docker compose files
+ copy:
+ src={{ item }}
+ dest={{ ansible_user_dir }}/{{ item }}
+ with_items:
+ - onos-setup-playbook.yml
+ - docker-compose.yml
+
+- name: Run the ONOS ansible playbook
+ command: ansible-playbook {{ ansible_user_dir }}/onos-setup-playbook.yml
+
diff --git a/roles/onos-vm-install/templates/onos-setup-vars.yml.j2 b/roles/onos-vm-install/templates/onos-setup-vars.yml.j2
new file mode 100644
index 0000000..cd21505
--- /dev/null
+++ b/roles/onos-vm-install/templates/onos-setup-vars.yml.j2
@@ -0,0 +1,2 @@
+---
+
diff --git a/roles/xos-vm-install/defaults/main.yml b/roles/xos-vm-install/defaults/main.yml
new file mode 100644
index 0000000..a2d12d1
--- /dev/null
+++ b/roles/xos-vm-install/defaults/main.yml
@@ -0,0 +1,7 @@
+---
+
+xos_repo_url: "https://github.com/open-cloud/xos.git"
+xos_repo_dest: "~/xos"
+xos_repo_branch: "HEAD"
+
+xos_configuration: "devel"
diff --git a/roles/xos-vm-install/files/xos-setup-cord-pod-playbook.yml b/roles/xos-vm-install/files/xos-setup-cord-pod-playbook.yml
new file mode 100644
index 0000000..ca2bc3d
--- /dev/null
+++ b/roles/xos-vm-install/files/xos-setup-cord-pod-playbook.yml
@@ -0,0 +1,65 @@
+---
+- hosts: xos-1
+ remote_user: ubuntu
+
+ tasks:
+ - name: Include configuration vars
+ include_vars: xos-setup-vars.yml
+
+ - name: Install prerequisites
+ apt:
+ name={{ item }}
+ update_cache=yes
+ cache_valid_time=3600
+ become: yes
+ with_items:
+ - git
+ - make
+ - python-novaclient
+ - python-neutronclient
+ - python-keystoneclient
+ - python-glanceclient
+
+ # force=yes because we're putting other files in the repo, which will cause
+ # this to fail in the future. Wipes out local changes.
+ - name: Clone XOS repo
+ git:
+ repo={{ xos_repo_url }}
+ dest={{ xos_repo_dest }}
+ version={{ xos_repo_branch }}
+ force=yes
+
+ - name: Make XOS prerequisites
+ command: make -f {{ xos_repo_dest }}/xos/configurations/common/Makefile.prereqs
+
+ - name: Copy over SSH keys
+ copy:
+ src=~/.ssh/{{ item }}
+ dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/
+ owner={{ ansible_user_id }} mode=0600
+ with_items:
+ - id_rsa
+ - id_rsa.pub
+
+ - name: copy over admin-openrc.sh
+ copy:
+ src=~/admin-openrc.sh
+ dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}
+
+ - name: copy over SSH key as node_key
+ copy:
+ src=~/.ssh/id_rsa
+ dest={{ xos_repo_dest }}//xos/configurations/{{ xos_configuration }}/node_key
+
+ - name: create images directory
+ file:
+ path={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/images
+ state=directory
+
+ - name: download software image
+ get_url:
+ url=http://www.vicci.org/opencloud/trusty-server-cloudimg-amd64-disk1.img
+ checksum=sha256:5fb160ea09649f9cebe5cfd7aaf3d1a341e8e0f9eca6e52e46eb6271155c48b0
+ dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/images/trusty-server-multi-nic.img
+
+
diff --git a/roles/xos-vm-install/tasks/main.yml b/roles/xos-vm-install/tasks/main.yml
new file mode 100644
index 0000000..b08b64d
--- /dev/null
+++ b/roles/xos-vm-install/tasks/main.yml
@@ -0,0 +1,18 @@
+---
+# xos-vm-install/tasks/main.yml
+#
+# Install XOS on a sub vm by calling ansible
+
+- name: Create a vars file from template
+ template:
+ src=xos-setup-vars.yml.j2
+ dest={{ ansible_user_dir }}/xos-setup-vars.yml
+
+- name: Copy over XOS ansible playbook
+ copy:
+ src=xos-setup-{{ xos_configuration }}-playbook.yml
+ dest={{ ansible_user_dir }}/xos-setup-playbook.yml
+
+- name: Run the XOS ansible playbook
+ command: ansible-playbook {{ ansible_user_dir }}/xos-setup-playbook.yml
+
diff --git a/roles/xos-vm-install/templates/xos-setup-vars.yml.j2 b/roles/xos-vm-install/templates/xos-setup-vars.yml.j2
new file mode 100644
index 0000000..415a079
--- /dev/null
+++ b/roles/xos-vm-install/templates/xos-setup-vars.yml.j2
@@ -0,0 +1,8 @@
+---
+
+xos_repo_url: "{{ xos_repo_url }}"
+xos_repo_dest: "{{ xos_repo_dest }}"
+xos_repo_branch: "{{ xos_repo_branch }}"
+
+xos_configuration: "{{ xos_configuration }}"
+