have juju-setup use the new bridge, fix errors
diff --git a/roles/juju-setup/tasks/main.yml b/roles/juju-setup/tasks/main.yml
index ae82be7..58c553d 100644
--- a/roles/juju-setup/tasks/main.yml
+++ b/roles/juju-setup/tasks/main.yml
@@ -7,13 +7,20 @@
release={{ ansible_distribution_release }} arch=amd64
- name: create Virtual Machines with uvt-kvm
- shell: uvt-kvm create {{ item.name }} --cpu={{ item.cpu }} --memory={{ item.memMB }} --disk={{ item.diskGB }} ; \
- uvt-kvm wait --insecure {{ item.name }}
+ shell: uvt-kvm create {{ item.name }} --cpu={{ item.cpu }} --memory={{ item.memMB }} --disk={{ item.diskGB }} --bridge="mgmtbr"
creates=/var/lib/uvtool/libvirt/images/{{ item.name }}.qcow
with_items: "{{ head_vm_list }}"
- name: Have VMs autostart on reboot
- command: virsh autostart {{ item.name }}
+ virt:
+ name={{ item.name }}
+ command=autostart
+ with_items: "{{ head_vm_list }}"
+
+- name: wait for VM's to come up
+ wait_for:
+ host={{ item.name }}
+ port=22
with_items: "{{ head_vm_list }}"
- name: Create /etc/ansible/hosts file
@@ -63,13 +70,12 @@
juju_facts:
# For setwise operations on desired vs Juju state:
-# list of VM names in head_vm_list dict: head_vm_list | map(attribute='name') | list
# list of active juju_machines names: juju_machines.keys()
# list of active juju_services names: juju_services.keys()
- name: Add machines to Juju
command: "juju add-machine ssh:{{ item }}"
- with_items: "{{ head_vm_list | map(attribute='service') | list | difference( juju_machines.keys() ) }}"
+ with_items: "{{ head_vm_list | map(attribute='service') | list | reject('undefined') | difference( juju_machines.keys() ) }}"
# run this again, so machines will be in the juju_machines list
- name: Obtain Juju Facts after machine creation