+++ /dev/null
----
-- name: Basic Setup for alfred
- hosts: alfred.mgmt
- roles:
- - role: base
- - role: vm/host
--- /dev/null
+---
+- name: Basic Setup for alfred
+ hosts: alfred
+ roles:
+ - role: base
+ - role: vm/host
+++ /dev/null
----
-- name: Basic Setup for testvm
- hosts: testvm.mgmt
- roles:
- - role: base
- - role: vm/grub
- - role: vm/network
--- /dev/null
+---
+- name: Basic Setup for testvm
+ hosts: testvm
+ roles:
+ - role: base
+ - role: vm/grub
+ - role: vm/network
+++ /dev/null
----
-vm_host:
- installer:
- net_if: br-mgmt
- preseed_path: /srv/preseed
- path: /srv/installer
- distros:
- - distro: debian
- codename: stretch
- arch:
- - amd64
- - i386
- - distro: ubuntu
- codename: xenial
- arch:
- - amd64
- - i386
- network:
- interface: br-mgmt
- ip: 192.168.33.65
- mask: 255.255.255.0
- gateway: 192.168.33.1
- nameservers:
- - 192.168.33.1
- - 10.12.0.10
- indices:
- testvm.mgmt: 200
--- /dev/null
+---
+vm_host:
+ installer:
+ net_if: br-mgmt
+ preseed_path: /srv/preseed
+ path: /srv/installer
+ distros:
+ - distro: debian
+ codename: stretch
+ arch:
+ - amd64
+ - i386
+ - distro: ubuntu
+ codename: xenial
+ arch:
+ - amd64
+ - i386
+ network:
+ interface: br-mgmt
+ ip: 192.168.33.65
+ mask: 255.255.255.0
+ gateway: 192.168.33.1
+ nameservers:
+ - 192.168.33.1
+ - 10.12.0.10
+ indices:
+ testvm: 200
+++ /dev/null
----
-localconfig_ssh_config_user: root
-
-vm_install_host: alfred.mgmt
-
-vm_install:
- host: "{{ vm_install_host }}"
- mem: 1024
- numcpu: 2
- disks:
- primary: vda
- virtio:
- vda:
- vg: alfred
- lv: "{{ inventory_hostname }}"
- size: 10g
- interfaces:
- - idx: 1
- bridge: "{{ hostvars[vm_install_host].vm_host.network.interface }}"
- name: primary0
- autostart: True
-
-vm_network:
- systemd_link:
- 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(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.gateway | default(hostvars[vm_install_host].vm_host.network.ip) }}"
- nameservers: "{{ hostvars[vm_install_host].vm_host.network.nameservers }}"
- domain: realraum.at
--- /dev/null
+---
+localconfig_ssh_config_user: root
+
+vm_install_host: alfred
+
+vm_install:
+ host: "{{ vm_install_host }}"
+ mem: 1024
+ numcpu: 2
+ disks:
+ primary: vda
+ virtio:
+ vda:
+ vg: alfred
+ lv: "{{ inventory_hostname }}"
+ size: 10g
+ interfaces:
+ - idx: 1
+ bridge: "{{ hostvars[vm_install_host].vm_host.network.interface }}"
+ name: primary0
+ autostart: True
+
+vm_network:
+ systemd_link:
+ 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(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.gateway | default(hostvars[vm_install_host].vm_host.network.ip) }}"
+ nameservers: "{{ hostvars[vm_install_host].vm_host.network.nameservers }}"
+ domain: realraum.at
d-i preseed/late_command string \
lvremove -f {{ vmname }}/dummy; \
in-target bash -c "apt-get update -q && apt-get full-upgrade -y -q"; \
- in-target bash -c "passwd -d root; passwd -l root; umask 077; mkdir -p /root/.ssh/; echo -e '{{ lookup('pipe','cat ssh/noc/*.pub') | replace('\n', '\\n') }}' > /root/.ssh/authorized_keys"; \
+ in-target bash -c "passwd -d root; passwd -l root; umask 077; mkdir -p /root/.ssh/; echo -e '{{ noc_ssh_keys | join('\\n') }}' > /root/.ssh/authorized_keys"; \
in-target bash -c "sed 's/^\(\s*#\s*Port.*\)/Port 22000/' -i /etc/ssh/sshd_config"