diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-10-03 03:33:21 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-10-03 03:33:21 +0200 |
commit | 1b5e37c03eeef86c56722b7141e80cb97c8af1f0 (patch) | |
tree | 88fa43a2aaa7287f2ec2c6ea8774fa76850f3763 /roles | |
parent | whitespace fix (diff) |
don't use netplan
Diffstat (limited to 'roles')
-rw-r--r-- | roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 | 4 | ||||
-rw-r--r-- | roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2 | 4 | ||||
-rw-r--r-- | roles/ubuntu-ws/tasks/main.yml | 9 | ||||
-rw-r--r-- | roles/vm/host/tasks/network.yml | 1 | ||||
-rw-r--r-- | roles/vm/network/tasks/main.yml | 15 | ||||
-rw-r--r-- | roles/vm/network/templates/netplan.yaml.j2 | 15 |
6 files changed, 11 insertions, 37 deletions
diff --git a/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 index 5fcab0aa..453fb150 100644 --- a/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 +++ b/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 @@ -13,6 +13,7 @@ d-i keyboard-configuration/layoutcode string us d-i hw-detect/load_firmware boolean false +d-i netcfg/do_not_use_netplan boolean true d-i netcfg/choose_interface select {{ install_interface | default(hostvars[hostname].network_cooked.primary.interface) }} {% if 'install_dhcp' in hostvars[hostname] and hostvars[hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false @@ -124,7 +125,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[(hostvars[hostname].apt_repo_provider | default('default'))].ubuntu }} tasksel tasksel/first multiselect -d-i pkgsel/include string openssh-server python python-apt +d-i pkgsel/include string openssh-server python python-apt ifupdown d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false d-i pkgsel/update-policy select none @@ -139,6 +140,7 @@ d-i preseed/late_command string \ lvremove -f {{ hostvars[hostname].host_name }}/dummy; \ in-target bash -c "swapoff -a; sed -e '/^\/swapfile/d' -i /etc/fstab; rm -f /swapfile"; \ in-target bash -c "apt-get update -q && apt-get full-upgrade -y -q"; \ + in-target bash -c "apt-get purge -y -q netplan.io && apt-get autoremove -y -q && rm -rf /etc/netplan"; \ in-target bash -c "passwd -d root && passwd -l root"; \ in-target bash -c "sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces"; \ {% if preseed_force_net_ifnames_policy is defined %} diff --git a/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2 b/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2 index ac4f8bde..4e310a46 100644 --- a/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2 +++ b/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2 @@ -16,6 +16,7 @@ d-i console-setup/ask_detect boolean false d-i hw-detect/load_firmware boolean false +d-i netcfg/do_not_use_netplan boolean true d-i netcfg/choose_interface select {{ install_interface | default(hostvars[hostname].network_cooked.primary.interface) }} {% if 'install_dhcp' in hostvars[hostname] and hostvars[hostname].install_dhcp %} d-i netcfg/disable_dhcp boolean false @@ -126,7 +127,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[(hostvars[hostname].apt_repo_provider | default('default'))].ubuntu }} tasksel tasksel/first multiselect xubuntu-desktop -d-i pkgsel/include string openssh-server python python-apt +d-i pkgsel/include string openssh-server python python-apt ifupdown d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false d-i pkgsel/update-policy select none @@ -145,6 +146,7 @@ d-i preseed/late_command string \ lvremove -f {{ hostvars[hostname].host_name }}/dummy; \ in-target bash -c "swapoff -a; sed -e '/^\/swapfile/d' -i /etc/fstab; rm -f /swapfile"; \ in-target bash -c "apt-get update -q && apt-get full-upgrade -y -q"; \ + in-target bash -c "apt-get purge -y -q netplan.io && apt-get autoremove -y -q && rm -rf /etc/netplan"; \ in-target bash -c "passwd -d root && passwd -l root"; \ in-target bash -c "sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces"; \ {% if preseed_force_net_ifnames_policy is defined %} diff --git a/roles/ubuntu-ws/tasks/main.yml b/roles/ubuntu-ws/tasks/main.yml index 30b77816..66efb6a5 100644 --- a/roles/ubuntu-ws/tasks/main.yml +++ b/roles/ubuntu-ws/tasks/main.yml @@ -70,10 +70,11 @@ autoremove: yes purge: yes -- name: remove netplan config for network-manager - file: - name: /etc/netplan/01-network-manager-all.yaml - state: absent +## TODO: check if we still need to remove this? +# - name: remove netplan config for network-manager +# file: +# name: /etc/netplan/01-network-manager-all.yaml +# state: absent - name: install extra packages apt: diff --git a/roles/vm/host/tasks/network.yml b/roles/vm/host/tasks/network.yml index 16fe9314..343a1b00 100644 --- a/roles/vm/host/tasks/network.yml +++ b/roles/vm/host/tasks/network.yml @@ -1,5 +1,4 @@ --- -## TODO: add support for ubuntu netplan - name: create interface config copy: dest: "/etc/network/interfaces.d/{{ vm_host.network.interface }}" diff --git a/roles/vm/network/tasks/main.yml b/roles/vm/network/tasks/main.yml index 527ccdfa..b17aba8b 100644 --- a/roles/vm/network/tasks/main.yml +++ b/roles/vm/network/tasks/main.yml @@ -25,21 +25,6 @@ src: interfaces.j2 dest: /etc/network/interfaces mode: 0644 - when: ansible_distribution == "Debian" or (ansible_distribution == "Ubuntu" and (ansible_distribution_major_version | int) < 18) - -- block: - - name: remove default netplan config - file: - path: /etc/netplan/01-netcfg.yaml - state: absent - - - name: install basic netplan config - template: - src: netplan.yaml.j2 - dest: "/etc/netplan/01-{{ network.primary.interface }}.yaml" - mode: 0644 - - when: ansible_distribution == "Ubuntu" and (ansible_distribution_major_version | int) >= 18 - name: remove resolvconf package apt: diff --git a/roles/vm/network/templates/netplan.yaml.j2 b/roles/vm/network/templates/netplan.yaml.j2 deleted file mode 100644 index 7725f15f..00000000 --- a/roles/vm/network/templates/netplan.yaml.j2 +++ /dev/null @@ -1,15 +0,0 @@ -# This file describes the network interfaces available on your system -# For more information, see netplan(5). -network: - version: 2 - renderer: networkd - ethernets: - {{ network.primary.interface }}: - addresses: - - {{ (network.primary.ip + '/' + network.primary.mask) | ipaddr('address/prefix') }} -{% if 'prefix6' in network.primary %} - - {{ network.primary.prefix6 }} - gateway6: {{ network.primary.gateway6 }} -{% endif %} - gateway4: {{ network.primary.gateway }} - accept-ra: false |