Changes for CORD POD configuration
diff --git a/cord-setup.yml b/cord-setup.yml
index 80e5a53..5f599ae 100644
--- a/cord-setup.yml
+++ b/cord-setup.yml
@@ -60,7 +60,7 @@
- name: (CloudLab) Set up extra disk space
shell: /usr/testbed/bin/mkextrafs -f /var/lib/uvtool/libvirt/images
creates=/var/lib/uvtool/libvirt/images/lost+found
- when: cloudlab
+ when: cloudlab is defined and cloudlab
- name: Add myself to libvirtd group
user: name={{ ansible_env['SUDO_USER'] }}
@@ -76,7 +76,7 @@
tasks:
- name: Create VMs to host OpenCloud services
sudo: no
- script: scripts/create-vms.sh
+ script: scripts/create-vms-cord.sh
- include: tasks/vm-ips.yml
@@ -115,66 +115,26 @@
# Play: prepare compute nodes for installation
- hosts: compute
sudo: yes
- vars:
- control_net: "{{ hostvars['head']['ansible_virbr0']['ipv4']['network'] }}/24"
- gateway: "{{ hostvars['head']['ansible_default_ipv4']['address'] }}"
tasks:
- name: Install package needed by Juju
apt: name=python-yaml state=present
- - name: Add key
+ - name: Add key for standard user
authorized_key: user="{{ ansible_env['SUDO_USER'] }}"
key="{{ hostvars['head']['sshkey']['stdout'] }}"
- - name: Add route via /etc/rc.local
- template: src=templates/etc/rc.local.cloudlab
- dest=/etc/rc.local
- mode=0755
- when: cloudlab
- notify:
- - run /etc/rc.local
+ - name: Add key for root
+ authorized_key: user="root"
+ key="{{ hostvars['head']['sshkey']['stdout'] }}"
- - name: Add route via /etc/rc.local
- template: src=templates/etc/rc.local
- dest=/etc/rc.local
- mode=0755
- when: not cloudlab
- notify:
- - run /etc/rc.local
-
- - name: Touch ~/.ssh/config
+ - name: Make sure that /var/lib/nova exists
file: path=/var/lib/nova state=directory
+ when: cloudlab is defined and cloudlab
- name: (CloudLab) Set up extra disk space
shell: /usr/testbed/bin/mkextrafs -f /var/lib/nova
creates=/var/lib/nova/lost+found
- when: cloudlab
-
- handlers:
- - name: run /etc/rc.local
- shell: /etc/rc.local
-
-# Play: Use libvirt hooks to set up iptables
-- hosts: head
- sudo: yes
- tasks:
- - name: Enable port forwarding for services
- copy: src=files/{{ item }}
- dest={{ item }}
- mode=0755
- notify:
- - reload libvirt config
- - run qemu hook
- with_items:
-# - /etc/libvirt/hooks/daemon
- - /etc/libvirt/hooks/qemu
-
- handlers:
- - name: reload libvirt config
- shell: killall -HUP libvirtd
-
- - name: run qemu hook
- shell: /etc/libvirt/hooks/qemu start start
+ when: cloudlab is defined and cloudlab
# Play: Install services using Juju
- hosts: head
@@ -211,3 +171,18 @@
- name: Deploy OpenStack services with Juju
shell: juju quickstart cord.yaml
+
+- hosts: head
+ sudo: no
+ tasks:
+
+ - name: Get Keystone IP
+ shell: uvt-kvm ip keystone
+ register: keystone_ip
+
+ - name: Create credentials
+ template: src=templates/admin-openrc-cord.sh.j2
+ dest={{ ansible_env['PWD'] }}/admin-openrc.sh
+
+ - name: Copy credentials to nova-cloud-controller
+ shell: "scp admin-openrc.sh ubuntu@nova-cloud-controller:"