CORD-1551 - updated maas makefiles and multi-stage dockerfile

Change-Id: I0bab86e0207edb12f553ddcfe040882f04f34f25
diff --git a/roles/compute-node/defaults/main.yml b/roles/compute-node/defaults/main.yml
index 8bb3905..1b224a1 100644
--- a/roles/compute-node/defaults/main.yml
+++ b/roles/compute-node/defaults/main.yml
@@ -1,6 +1,7 @@
 ---
 
-pub_ssh_key: "{{ lookup('file', '/etc/maas/.ssh/cord_rsa.pub') }}"
+pub_ssh_key_file_location: "{{ pub_ssh_key_location | default ('/etc/maas/.ssh') }}"
+pub_ssh_key: "{{ lookup('file', pub_ssh_key_file_location+'/cord_rsa.pub') }}"
 
 compute_node:
     password: "{{password_compute_node | default(lookup('password', 'passwords/compute_node.txt chars=ascii_letters,digits'))}}"
diff --git a/roles/compute-node/files/remove-maas-components b/roles/compute-node/files/remove-maas-components
index 5adf79e..f3b09e7 100755
--- a/roles/compute-node/files/remove-maas-components
+++ b/roles/compute-node/files/remove-maas-components
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 KEEP_DOCKER=0
-DOCKER_ENGINE="docker-engine"
+DOCKER_ENGINE="docker-ce"
 DOCKER_REGISTRY="/docker-registry /docker-registry-mirror"
 CONTAINER_LIST=$(docker ps -qa)
 
@@ -17,15 +17,11 @@
     shift
 done
 
-CONTAINER_LIST=$(docker ps --format '{{.ID}} {{.Names}}' | grep -v ' registry$' | grep -v ' registry-mirror$' | awk '{print $1}')
-
-docker kill $CONTAINER_LIST
-docker rm -f $CONTAINER_LIST
-if [ $KEEP_DOCKER -eq 0 ]; then
-    docker rmi -f $(docker images -aq)
-fi
-
-sudo apt-get remove --purge -y bind9 apache2 $DOCKER_ENGINE ansible $(dpkg --get-selections | grep maas | cut -f1)
+docker rm -f $(docker ps -aq)
+docker rmi -f $(docker images -q)
+docker volume rm -f $(docker volume ls -q)
+docker network rm $(docker network ls -q)
+sudo apt-get remove --purge -y bind9 apache2 apt-cacher-ng $DOCKER_ENGINE ansible $(dpkg --get-selections | grep maas | cut -f1)
 
 sudo rm -rf \
     /etc/maas \
@@ -41,6 +37,7 @@
     /etc/apt/sources.list.d/ppa_maas_stable_trusty.list \
     /etc/apt/sources.list.d/ppa_ansible_ansible_trusty.list \
     /etc/network/if-pre-up.d/nat \
+    /etc/apt/apt.conf.d/03apt-cacher-ng \
     $DOCKER_REGISTRY
 
 sudo apt-get update -y
diff --git a/roles/compute-node/files/remove-xos-components b/roles/compute-node/files/remove-xos-components
index 2f2cf07..d18eebe 100755
--- a/roles/compute-node/files/remove-xos-components
+++ b/roles/compute-node/files/remove-xos-components
@@ -24,6 +24,12 @@
 
 sudo apt-get remove --purge -y $(dpkg --get-selections | grep "nagioas\|juju\|nova\|neutron" | awk '{print $1}') &&sudo apt-get autoremove -y && sudo rm -rf /etc/juju /etc/neutron /home/ubuntu/.juju && sudo find / -name "*juju*" -exec rm -r \{\} \; && sudo rm -f /var/lib/uvtool/libvirt/images/*
 
+sudo rm -rf \
+    /opt/cord* \
+    /opt/onos_* \
+    /opt/credentials \
+    /opt/images
+
 OVS=$(which ovs-vsctl)
 
 if [ ! -z $OVS ]; then
diff --git a/roles/compute-node/tasks/main.yml b/roles/compute-node/tasks/main.yml
index fe2b1ae..fb5b9bb 100644
--- a/roles/compute-node/tasks/main.yml
+++ b/roles/compute-node/tasks/main.yml
@@ -108,7 +108,7 @@
 - name: Ensure SSH Key Pair
   become: yes
   copy:
-    src: "/etc/maas/.ssh/{{item.src}}"
+    src: "{{pub_ssh_key_file_location}}/{{item.src}}"
     dest: "{{ansible_env['PWD']}}/.ssh/{{item.dest}}"
     owner: "{{ ansible_user_id }}"
     group: "docker"