2018-12-13 16:10:36 +00:00
|
|
|
- name: Disable cloud-init the easy way
|
2018-12-13 13:34:29 +00:00
|
|
|
shell: touch /etc/cloud/cloud-init.disabled
|
2020-04-22 17:59:47 +00:00
|
|
|
when: item|trim == "50-cloud-init.yaml"
|
2018-12-13 16:43:11 +00:00
|
|
|
with_items:
|
2018-12-29 17:47:18 +00:00
|
|
|
- "{{ netplan.stdout_lines }}"
|
2018-12-13 11:40:36 +00:00
|
|
|
|
2020-04-30 06:00:58 +00:00
|
|
|
- name: Moving 50-cloud-init.yaml to 02-iiab-config.yaml
|
|
|
|
shell: mv /etc/netplan/50-cloud-init.yaml /etc/netplan/02-iiab-config.yaml
|
|
|
|
when: netplan.stdout.find("yaml") != -1 and item|trim == "50-cloud-init.yaml"
|
2018-12-13 16:43:11 +00:00
|
|
|
with_items:
|
2018-12-29 17:47:18 +00:00
|
|
|
- "{{ netplan.stdout_lines }}"
|
2018-12-13 11:07:08 +00:00
|
|
|
|
2018-12-29 20:14:56 +00:00
|
|
|
- name: Cheap way to do systemd unmask
|
|
|
|
file:
|
|
|
|
state: absent
|
|
|
|
dest: /etc/systemd/system/systemd-networkd-wait-online.service
|
|
|
|
|
2018-12-16 13:52:50 +00:00
|
|
|
- name: Ensure systemd-networkd-wait-online is enabled
|
2018-12-13 16:10:36 +00:00
|
|
|
systemd:
|
|
|
|
name: "{{ item }}"
|
|
|
|
enabled: yes
|
|
|
|
with_items:
|
2018-12-16 12:26:55 +00:00
|
|
|
- systemd-networkd-wait-online
|
2020-10-16 20:46:19 +00:00
|
|
|
when: systemd_networkd_active
|
2018-12-13 11:07:08 +00:00
|
|
|
|
2020-12-07 04:06:18 +00:00
|
|
|
# Moved to NM-debian.yml 2020-12-07
|
|
|
|
#- name: Unmask and enable the systemd-networkd service for br0
|
|
|
|
# systemd:
|
|
|
|
# name: systemd-networkd
|
|
|
|
# enabled: yes
|
|
|
|
# masked: no
|
|
|
|
# when: network_manager_active and iiab_lan_iface == "br0"
|
|
|
|
|
|
|
|
# Moved to NM-debian.yml 2020-12-07
|
|
|
|
#- name: Ensure systemd-networkd gets enabled for br0
|
|
|
|
# set_fact:
|
|
|
|
# systemd_networkd_active: True
|
|
|
|
# when: network_manager_active and iiab_lan_iface == "br0"
|
2020-04-30 06:00:58 +00:00
|
|
|
|
2018-12-13 11:07:08 +00:00
|
|
|
# ICO will always set gui_static_wan_ip away from the default of 'unset' while
|
|
|
|
# gui_static_wan turns dhcp on/off through wan_ip in computed_network and
|
|
|
|
# overrides gui_static_wan_ip that is present. Changing wan_ip in local_vars
|
|
|
|
# is a oneway street to static.
|
2020-05-01 00:33:00 +00:00
|
|
|
#- name: Static IP computing CIDR
|
|
|
|
# shell: netmask {{ wan_ip }}/{{ wan_netmask }} | awk -F "/" '{print $2}'
|
|
|
|
# register: CIDR
|
|
|
|
# when: wan_ip != "dhcp"
|
2018-12-13 11:07:08 +00:00
|
|
|
|
2020-05-01 00:33:00 +00:00
|
|
|
#- name: Static IP setting CIDR
|
|
|
|
# set_fact:
|
|
|
|
# wan_cidr: "{{ CIDR.stdout }}"
|
|
|
|
# when: wan_ip != "dhcp"
|
2018-12-13 11:07:08 +00:00
|
|
|
|
2020-04-30 06:00:58 +00:00
|
|
|
- name: Remove stock netplan template
|
|
|
|
file:
|
|
|
|
state: absent
|
|
|
|
path: /etc/netplan/{{ item }}
|
|
|
|
when: netplan.stdout.find("yaml") != -1 and item|trim != "02-iiab-config.yaml" and wan_ip != "dhcp"
|
|
|
|
with_items:
|
|
|
|
- "{{ netplan.stdout_lines }}"
|
|
|
|
|
2022-06-30 14:29:08 +00:00
|
|
|
# 2022-06-30: Ubuntu Groovy (20.10) is ancient history but this code might now
|
|
|
|
# help Linux Mint ?
|
|
|
|
#
|
|
|
|
# 2022-05-29: @jvonau wrote on #3106 "networkd-dispatcher has a traceback,
|
|
|
|
# I suspect the cause is the same as found #2645, need to confirm the package
|
|
|
|
# version installed with apt list networkd-dispatcher before suggesting the
|
|
|
|
# workaround be extended to LinuxMint"
|
|
|
|
#
|
|
|
|
# - name: Replace networkd-dispatcher #2585 for "groovy"
|
|
|
|
# get_url:
|
|
|
|
# url: https://gitlab.com/craftyguy/networkd-dispatcher/-/raw/2.1/networkd-dispatcher
|
|
|
|
# dest: /usr/bin/networkd-dispatcher
|
|
|
|
# timeout: "{{ download_timeout }}"
|
|
|
|
# when: iiab_stage|int < 9 and fix_dispatcher and ansible_distribution_release == "groovy"
|
|
|
|
# # 2021-08-29 context from @jvonau: Fix is 'Groovy' specific, 21.04 and later
|
|
|
|
# # should have the fix baked into a newer apt package installed by default.
|
2020-11-24 01:31:43 +00:00
|
|
|
|
2020-04-30 06:00:58 +00:00
|
|
|
#- name: Supply netplan template
|
|
|
|
# template:
|
|
|
|
# dest: /etc/netplan/01-iiab-config.yaml
|
|
|
|
# src: network/netplan.j2
|
|
|
|
# backup: no
|
|
|
|
# when: iiab_wan_iface != discovered_wireless_iface and wan_ip != "dhcp"
|
2018-12-13 11:07:08 +00:00
|
|
|
|
2018-12-16 13:52:50 +00:00
|
|
|
# should blow up here if we messed up the yml file
|
2018-12-14 19:54:46 +00:00
|
|
|
#- name: Generate netplan config
|
|
|
|
# shell: netplan generate --debug
|
2018-12-13 11:07:08 +00:00
|
|
|
|
2018-12-14 19:54:46 +00:00
|
|
|
#- name: Stopping services
|
|
|
|
# include_tasks: down-debian.yml
|
2018-12-13 11:40:36 +00:00
|
|
|
|
|
|
|
# wants a controlling terminal for the ENTER key, so it fails
|
2018-12-14 19:54:46 +00:00
|
|
|
#- name: Test netplan config
|
|
|
|
# shell: netplan try --debug --timeout=2
|
|
|
|
# register: test-netplan
|
|
|
|
# ignore_errors: True
|
2018-12-13 11:07:08 +00:00
|
|
|
|
2018-12-13 11:40:36 +00:00
|
|
|
# and does not apply the generated config until rebooted
|
|
|
|
# or ignore the above test - on the fence atm...
|
2018-12-14 19:54:46 +00:00
|
|
|
#- name: Reload netplan
|
|
|
|
# shell: netplan apply
|
|
|
|
# when: not no_net_restart and test-netplan == "Configuration accepted"
|