fix cleanup, especially SSL cert issues for sequential runs
diff --git a/roles/juju-setup/handlers/main.yml b/roles/juju-setup/handlers/main.yml
deleted file mode 100644
index d31ae04..0000000
--- a/roles/juju-setup/handlers/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-# roles/juju-setup/handlers/tasks.yml
-
-- name: update-ca-certificates
- become: yes
- command: update-ca-certificates
-
diff --git a/roles/juju-setup/tasks/main.yml b/roles/juju-setup/tasks/main.yml
index ef0a2af..db8f25d 100644
--- a/roles/juju-setup/tasks/main.yml
+++ b/roles/juju-setup/tasks/main.yml
@@ -91,14 +91,14 @@
- name: Copy nova-cloud-controller CA certificate to head
command: juju scp {{ juju_services['nova-cloud-controller']['units'].keys()[0] }}:/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt {{ ansible_user_dir }}
-# creates={{ ansible_user_dir }}/keystone_juju_ca_cert.crt
-# (this is commented out to deal with multiple runs, as it prevents the new cert from being copied locallly
- name: Copy cert to system location
become: yes
command: cp {{ ansible_user_dir }}/keystone_juju_ca_cert.crt /usr/local/share/ca-certificates
- creates=/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt
- notify: update-ca-certificates
+
+- name: update-ca-certificates
+ become: yes
+ command: update-ca-certificates
- name: Move cert to all service VM's
command: ansible services -b -u ubuntu -m copy -a "src={{ ansible_user_dir }}/keystone_juju_ca_cert.crt dest=/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt owner=root group=root mode=0644"
diff --git a/scripts/single-node-pod.sh b/scripts/single-node-pod.sh
index 9d5d5fe..ec8bb4e 100755
--- a/scripts/single-node-pod.sh
+++ b/scripts/single-node-pod.sh
@@ -1,19 +1,28 @@
#!/usr/bin/env bash
function cleanup_from_previous_test() {
+
+ echo "## Cleanup ##"
+
+ echo "Destroying juju environment"
+ juju destroy-environment --force -y manual
+
VMS=$( sudo virsh list|grep running|awk '{print $2}' )
for VM in $VMS
do
+ echo "Destroying $VM"
sudo uvt-kvm destroy $VM
done
+ echo "Cleaning up files"
rm -rf ~/.juju
rm -f ~/.ssh/known_hosts
rm -rf ~/openstack-cluster-setup
+ echo "Cleaning up libvirt/dnsmasq"
sudo rm -f /var/lib/libvirt/dnsmasq/xos-mgmtbr.leases
sudo killall dnsmasq
- sudo service libvirt-bin restart
+ sudo service libvirt-bin restart
}
function bootstrap() {