CORD-229 - updated to implement initial base switch provisioning
Change-Id: I3deca583dc2753e1a2c77629f1ee45f8b66223c8
diff --git a/roles/head-node/files/compute-node.yml b/roles/head-node/files/compute-node.yml
index 7fb41f0..4a6a50d 100644
--- a/roles/head-node/files/compute-node.yml
+++ b/roles/head-node/files/compute-node.yml
@@ -1,4 +1,4 @@
- hosts: all
remote_user: ubuntu
roles:
- - compute-node
+ - {{ provision.role }}
diff --git a/roles/head-node/files/compute-node.yml.j2 b/roles/head-node/files/compute-node.yml.j2
deleted file mode 100644
index 4a6a50d..0000000
--- a/roles/head-node/files/compute-node.yml.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-- hosts: all
- remote_user: ubuntu
- roles:
- - {{ provision.role }}
diff --git a/roles/head-node/files/do-switch b/roles/head-node/files/do-switch
new file mode 100755
index 0000000..27c6819
--- /dev/null
+++ b/roles/head-node/files/do-switch
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+ID=$1
+HOSTNAME=$2
+IP=$3
+MAC=$4
+ROLE=$5
+
+LOG=/etc/maas/ansible/logs/$ID.log
+
+echo "" >> $LOG
+echo "***** BEGIN *****" >> $LOG
+echo "PROVISION $ID $HOSTNAME $IP $MAC $ROLE" >> $LOG
+
+SKIP_TAGS=
+EXTRA_VARS=--extra-vars=ansible_ssh_pass=onl
+
+echo "ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook -i $IP, /etc/maas/ansible/switch-node.yml $SKIP_TAGS $EXTRA_VARS" >> $LOG
+ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook -i $IP, /etc/maas/ansible/switch-node.yml $SKIP_TAGS $EXTRA_VARS >> $LOG
+
diff --git a/roles/head-node/files/switch-node.yml b/roles/head-node/files/switch-node.yml
new file mode 100644
index 0000000..3539060
--- /dev/null
+++ b/roles/head-node/files/switch-node.yml
@@ -0,0 +1,4 @@
+- hosts: all
+ remote_user: root
+ roles:
+ - fabric-switch