From 726c46394e2b7496c26fae551b05bda7ba1b57c2 Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 24 Jan 2019 20:08:30 +0100 Subject: [PATCH] ansible/host_vars: Add installation metadata for the metrics VM --- ansible/host_vars/alfred/main.yml | 1 + ansible/host_vars/metrics/main.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/ansible/host_vars/alfred/main.yml b/ansible/host_vars/alfred/main.yml index ab6ad85..ed73d0c 100644 --- a/ansible/host_vars/alfred/main.yml +++ b/ansible/host_vars/alfred/main.yml @@ -9,4 +9,5 @@ vm_host: gateway: "{{ net.mgmt.gw }}" nameservers: "{{ net.mgmt.dns }}" indices: + metrics: 74 testvm: 99 diff --git a/ansible/host_vars/metrics/main.yml b/ansible/host_vars/metrics/main.yml index 31b6b26..c1d5edf 100644 --- a/ansible/host_vars/metrics/main.yml +++ b/ansible/host_vars/metrics/main.yml @@ -1,2 +1,35 @@ --- localconfig_ssh_config_user: root + +vm_host: alfred + +install: + host: "{{ vm_host }}" + mem: 1024 + numcpu: 2 + disks: + primary: /dev/vda + virtio: + vda: + vg: "{{ vm_host }}" + lv: "{{ inventory_hostname }}" + size: 10g + vdb: + vg: "{{ vm_host }}" + lv: "{{ inventory_hostname }}-data" + + interfaces: + - bridge: "{{ hostvars[vm_host].vm_host.network.interface }}" + name: mgmt0 + autostart: True + +network: + nameservers: "{{ hostvars[vm_host].vm_host.network.nameservers }}" + domain: realraum.at + systemd_link: + interfaces: "{{ install.interfaces }}" + primary: + interface: mgmt0 + ip: "{{ (hostvars[vm_host].vm_host.network.ip+'/'+hostvars[vm_host].vm_host.network.mask) | ipaddr(hostvars[vm_host].vm_host.network.indices[inventory_hostname]) | ipaddr('address') }}" + mask: "{{ hostvars[vm_host].vm_host.network.mask }}" + gateway: "{{ hostvars[vm_host].vm_host.network.gateway | default(hostvars[vm_host].vm_host.network.ip) }}" -- 1.7.10.4