Add key removal

Change-Id: Id7ad4190b1e1018f2fb388b1f5553f9f7663c572
diff --git a/tcp_tests/templates/cookied-cicd-bm-os-contrail40-maas/salt.yaml b/tcp_tests/templates/cookied-cicd-bm-os-contrail40-maas/salt.yaml
index 008dba0..3e50624 100644
--- a/tcp_tests/templates/cookied-cicd-bm-os-contrail40-maas/salt.yaml
+++ b/tcp_tests/templates/cookied-cicd-bm-os-contrail40-maas/salt.yaml
@@ -27,6 +27,14 @@
   retry: {count: 2, delay: 5}
   skip_fail: false
 
+- description: Generate a public key for machines in MAAS
+  cmd: |
+    ssh-keygen -y -f ~root/.ssh/id_rsa > ~root/.ssh/id_rsa.pub
+    maas mirantis sshkeys create key="$(cat ~root/.ssh/id_rsa.pub)"
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: Run comissioning of BM nodes
   cmd: |
     salt-call maas.process_machines
@@ -48,6 +56,17 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+- description: Remove all the salt-minions and re-register the cfg01 minion
+  cmd: |
+    salt-key -y -D;
+    salt-call test.ping
+    sleep 5
+    # Check that the cfg01 is registered
+    salt-key | grep cfg01
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: provision the automatically commissioned physical nodes through MAAS
   cmd: |
     salt-call maas.deploy_machines;