summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2017-12-11 09:51:59 +0100
committerChristian Pointner <equinox@spreadspace.org>2017-12-11 09:51:59 +0100
commit25a186a96325c58095f28d51ba42451c5f827a04 (patch)
treeb7c44825e3aa2fa8ffe6764e1cb3772074002d39
parentgreatly improved vm-install role (diff)
cleanup and improvments
-rw-r--r--host_vars/kube2016.yaml3
-rw-r--r--host_vars/sk2016.yaml2
-rw-r--r--vminstall.yaml10
3 files changed, 8 insertions, 7 deletions
diff --git a/host_vars/kube2016.yaml b/host_vars/kube2016.yaml
index f174ff3b..fa2d8d1d 100644
--- a/host_vars/kube2016.yaml
+++ b/host_vars/kube2016.yaml
@@ -1,6 +1,5 @@
---
vm_install_host: sk2016
-vm_network_primary_address_index: 200
vm_install:
host: "{{ vm_install_host }}"
@@ -24,7 +23,7 @@ vm_network:
interfaces: "{{ vm_install.interfaces }}"
primary:
interface: primary0
- ip: "{{ (hostvars[vm_install_host].vm_host.network.ip+'/'+hostvars[vm_install_host].vm_host.network.mask) | ipaddr(vm_network_primary_address_index) | ipaddr('address') }}"
+ ip: "{{ (hostvars[vm_install_host].vm_host.network.ip+'/'+hostvars[vm_install_host].vm_host.network.mask) | ipaddr(hostvars[vm_install_host].vm_host.network.indices[inventory_hostname]) | ipaddr('address') }}"
mask: "{{ hostvars[vm_install_host].vm_host.network.mask }}"
gateway: "{{ hostvars[vm_install_host].vm_host.network.ip }}"
nameservers: "{{ hostvars[vm_install_host].vm_host.network.nameservers }}"
diff --git a/host_vars/sk2016.yaml b/host_vars/sk2016.yaml
index 91d1854d..449f6860 100644
--- a/host_vars/sk2016.yaml
+++ b/host_vars/sk2016.yaml
@@ -28,3 +28,5 @@ vm_host:
- 213.133.100.100
- 213.133.98.98
- 213.133.99.99
+ indices:
+ kube2016: 200
diff --git a/vminstall.yaml b/vminstall.yaml
index 7fbba705..6fe1e524 100644
--- a/vminstall.yaml
+++ b/vminstall.yaml
@@ -1,12 +1,12 @@
---
-### TODO: this doesn't seem to work... but we need some infos from
-### the VM Host...
-# - name: Gather facts of vm host
-# hosts: "{{ hostvars[vmname].vm_install.host }}"
-
- name: Basic Installation
hosts: "{{ vmname }}"
gather_facts: no
+ pre_tasks:
+ - name: Gather facts of vm host
+ setup:
+ delegate_to: "{{ vm_install.host }}"
+ delegate_facts: yes
roles:
- role: vm-install