From b1cab5f25b4691b1f19957d879f5cdf2a9b4f938 Mon Sep 17 00:00:00 2001 From: nicoo Date: Sat, 24 Nov 2018 19:29:28 +0100 Subject: [PATCH] ansible/preseed: Do not hardcode the installation interface --- ansible/roles/preseed/templates/preseed_debian-stretch.cfg.j2 | 2 +- ansible/roles/vm/install/meta/main.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/preseed/templates/preseed_debian-stretch.cfg.j2 b/ansible/roles/preseed/templates/preseed_debian-stretch.cfg.j2 index b9d0085..f39e3f3 100644 --- a/ansible/roles/preseed/templates/preseed_debian-stretch.cfg.j2 +++ b/ansible/roles/preseed/templates/preseed_debian-stretch.cfg.j2 @@ -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 }} diff --git a/ansible/roles/vm/install/meta/main.yml b/ansible/roles/vm/install/meta/main.yml index 14ba5b5..696479f 100644 --- a/ansible/roles/vm/install/meta/main.yml +++ b/ansible/roles/vm/install/meta/main.yml @@ -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 -- 1.7.10.4