add dynamic ansible inventory script
Change-Id: I3e8ba79d0d6ec8e66e5118638ec9325ee78d50ef
diff --git a/roles/head-node/tasks/main.yml b/roles/head-node/tasks/main.yml
index 6735f20..d8a535e 100644
--- a/roles/head-node/tasks/main.yml
+++ b/roles/head-node/tasks/main.yml
@@ -44,6 +44,12 @@
group=maas
mode=0755
+- name: Capture MAAS API Key
+ become: yes
+ command: maas-region-admin apikey --username={{ maas.user }}
+ register: apikey
+ changed_when: false
+
- name: Ensure Compute Node Playbook
become: yes
template:
@@ -55,3 +61,12 @@
with_items:
- compute-node.yml
- switch-node.yml
+
+- name: Ensure Dynamic Inventory Script
+ become: yes
+ template:
+ src=files/pod-inventory
+ dest=/etc/maas/ansible/pod-inventory
+ owner=maas
+ group=maas
+ mode=0755