From: nicoo Date: Sat, 24 Nov 2018 18:29:28 +0000 (+0100) Subject: ansible/preseed: Do not hardcode the installation interface X-Git-Url: https://git.realraum.at/?p=noc.git;a=commitdiff_plain;h=b1cab5f25b4691b1f19957d879f5cdf2a9b4f938 ansible/preseed: Do not hardcode the installation interface --- 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