compat with Ansible 2.0, added service_relations
diff --git a/roles/juju-setup/tasks/main.yml b/roles/juju-setup/tasks/main.yml
index bf40c73..7935fe3 100644
--- a/roles/juju-setup/tasks/main.yml
+++ b/roles/juju-setup/tasks/main.yml
@@ -5,11 +5,11 @@
shell: uvt-kvm create {{ item.name }} --cpu={{ item.cpu }} --memory={{ item.memMB }} --disk={{ item.diskGB }}; \
uvt-kvm wait --insecure {{ item.name }}
creates=/var/lib/uvtool/libvirt/images/{{ item.name }}.qcow
- with_items: head_vm_list
+ with_items: "{{ head_vm_list }}"
- name: discover VM IP addresses
- shell: uvt-kvm ip {{ item.name }}
- with_items: head_vm_list
+ shell: "uvt-kvm ip {{ item.name }}"
+ with_items: "{{ head_vm_list }}"
register: vm_ip
- name: Create /etc/hosts with VM IP addresses
@@ -71,3 +71,14 @@
command: "juju deploy {{ item }} --config={{ openstack_cfg_path }}"
with_items: "{{ standalone_service_list | difference( juju_services.keys() ) }}"
+# FIXME: ignoring errors when creating relationships.
+# Previous method wasn't idempotent either
+
+- name: Create relations between services
+ command: "juju add-relation '{{ item.0.name }}' '{{ item.1 }}'"
+ ignore_errors: True
+ with_subelements:
+ - "{{ service_relations }}"
+ - relations
+
+# Need to wait for services to come up here