From 0682b03931f30360bd0a59dd51705b07c176f353 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 3 May 2019 23:51:06 -0400 Subject: [PATCH 1/3] run netplan.yml if Ubuntu 18.04 or higher --- roles/network/tasks/main.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 1d8101a7e..5f2fa02a5 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -100,42 +100,43 @@ - name: Redhat networking include_tasks: ifcfg_mods.yml when: is_redhat -#and not installing + #and not installing tags: - network -- name: Netplan in use on Ubuntu 18 +- name: Netplan in use on Ubuntu 18.04+ include_tasks: netplan.yml - when: is_ubuntu_18 -#and not installing + when: is_ubuntu and not is_ubuntu_16 + #when: is_ubuntu_18 + #and not installing tags: - network - name: NetworkManager in use include_tasks: NM-debian.yml when: is_debuntu and network_manager_active -#and not installing + #and not installing tags: - network - name: systemd-networkd in use include_tasks: sysd-netd-debian.yml when: is_debuntu and systemd_networkd_active -#and not installing + #and not installing tags: - network - name: RPi's have dhcpcd in use include_tasks: rpi_debian.yml when: is_debuntu and is_rpi -#and not installing + #and not installing tags: - network - name: Not RPi, Not NetworkManager, Not systemd-networkd in use include_tasks: debian.yml when: (not is_rpi and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16 -#and not installing + #and not installing tags: - network From 63ab350994087e008122028cc15b952cf2714ba6 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 4 May 2019 00:54:27 -0400 Subject: [PATCH 2/3] Comments tightened up --- roles/network/tasks/netplan.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/network/tasks/netplan.yml b/roles/network/tasks/netplan.yml index 9f5d8837f..c149d9426 100644 --- a/roles/network/tasks/netplan.yml +++ b/roles/network/tasks/netplan.yml @@ -1,5 +1,4 @@ -# netplan.yml -- name: Figure out netplan file name on Ubuntu 18 +- name: Figure out netplan file name shell: ls /etc/netplan register: netplan From 98f682a0e4d88a23e32c392533c7f0e17ec17e26 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 4 May 2019 00:57:44 -0400 Subject: [PATCH 3/3] Ansible file module "path" is equiv to "dest" --- roles/network/tasks/netplan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/netplan.yml b/roles/network/tasks/netplan.yml index c149d9426..b9fd2bd40 100644 --- a/roles/network/tasks/netplan.yml +++ b/roles/network/tasks/netplan.yml @@ -11,7 +11,7 @@ - name: Remove stock netplan template file: state: absent - dest: /etc/netplan/{{ item }} + path: /etc/netplan/{{ item }} with_items: - "{{ netplan.stdout_lines }}" when: netplan.stdout.find("yaml") != -1