made it run, ssh key issues
fix user/root difference, lint
lint, make 'apt-get dist-upgrade' an option, formatting
add more missing things
remove extraneous keystone pw
remove database relation to neutron-gateway which is no longer required
fixed roles so async resumption only happens when those VMs exist
workaround for old Jinja
add missing compute relations and variables
whitespace
Change-Id: I323806ea2594bb70fb95a6d11a489625f59ac0da
diff --git a/roles/docker-compose/tasks/main.yml b/roles/docker-compose/tasks/main.yml
index 84d0edd..a623cf1 100644
--- a/roles/docker-compose/tasks/main.yml
+++ b/roles/docker-compose/tasks/main.yml
@@ -1,7 +1,15 @@
---
# docker-compose/tasks/main.yml
+# The following two tests are equivalent and both evaluate to 0 when
+# `onos-cord-1` VM isn't set to be created, but the `equalto` test only exists
+# in Jinja v2.7.4, which is later than what's in Ubuntu 14.04 (v2.7.2).
+#
+# {{ head_vm_list | selectattr('name', 'equalto', 'onos-cord-1') | list | length }}
+# {{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}
+
- name: Wait for onos_setup_playbook to complete
+ when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
async_status: jid={{ onos_setup_playbook.ansible_job_id }}
register: onos_setup_playbook_result
until: onos_setup_playbook_result.finished
@@ -9,18 +17,22 @@
retries: 120
- name: Copy SSL Certs to ONOS so docker-compose can find it
+ when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
command: ansible onos-cord-1 -u ubuntu -m copy \
-a "src=/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt dest=~/cord/xos-certs.crt"
- name: Build ONOS image with docker-compose
+ when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
command: ansible onos-cord-1 -u ubuntu -m command \
-a "docker-compose build chdir=cord"
- name: Start ONOS
+ when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
command: ansible onos-cord-1:onos-fabric-1 -u ubuntu -m command \
-a "docker-compose up -d chdir=cord"
- name: Wait for xos_setup_playbook to complete
+ when: "{{ head_vm_list | map(attribute='name') | list | intersect(['xos-1']) | list | length }}"
async_status: jid={{ xos_setup_playbook.ansible_job_id }}
register: xos_setup_playbook_result
until: xos_setup_playbook_result.finished
@@ -28,6 +40,7 @@
retries: 120
- name: Copy admin-openrc.sh into XOS container
+ when: "{{ head_vm_list | map(attribute='name') | list | intersect(['xos-1']) | list | length }}"
command: ansible xos-1 -u ubuntu -m copy \
-a "src=~/admin-openrc.sh dest={{ service_profile_repo_dest }}/{{ xos_configuration }}"