diff --git a/tasks/disable-static-cfg.yml b/tasks/disable-static-cfg.yml new file mode 100644 index 0000000..c11d441 --- /dev/null +++ b/tasks/disable-static-cfg.yml @@ -0,0 +1,20 @@ +--- +- name: Disable /etc/network/interfaces for {{ if_item.ifname }} + become: true + find: + paths: /etc/network/interfaces.d/,/etc/network + contains: 'iface {{ if_item.ifname }}($|\s)' + register: network_files +- name: Comment static {{ if_item.ifname }} config + become: true + replace: + path: "{{ f_item.path }}" + regexp: '^(?!#)' + replace: '#' + loop: "{{ network_files.files }}" + loop_control: + loop_var: f_item + +# notify: +# - networking changed +# - network-manager configuration changed \ No newline at end of file