ansible/preseed: Do not hardcode the installation interface
authornicoo <nicoo@realraum.at>
Sat, 24 Nov 2018 18:29:28 +0000 (19:29 +0100)
committernicoo <nicoo@realraum.at>
Sat, 24 Nov 2018 23:30:33 +0000 (00:30 +0100)
ansible/roles/preseed/templates/preseed_debian-stretch.cfg.j2
ansible/roles/vm/install/meta/main.yml

index b9d0085..f39e3f3 100644 (file)
@@ -8,7 +8,7 @@ d-i debian-installer/locale string en_US.UTF-8
 d-i keyboard-configuration/xkb-keymap select us
 
 d-i netcfg/disable_dhcp boolean true
-d-i netcfg/choose_interface select enp1s1
+d-i netcfg/choose_interface select {{ install_interface | default(hostvars[hostname].network_cooked.primary.interface) }}
 d-i netcfg/disable_autoconfig boolean false
 d-i netcfg/get_ipaddress string {{ hostvars[hostname].network_cooked.primary.ip }}
 d-i netcfg/get_netmask string {{ hostvars[hostname].network_cooked.primary.mask }}
index 14ba5b5..696479f 100644 (file)
@@ -3,3 +3,4 @@ dependencies:
   - role: preseed
     # TODO: Find a way to eliminate the duplicate defaults.
     ssh_keys: "{{ hostvars[hostname].ssh_keys | default(noc_ssh_keys) }}"
+    install_interface: enp1s1