Merge commit '9eb580b8415b7b1d70bf9cb7d5de68922411440d'
# Conflicts: # handlers/main.yml # tasks/main.yml
This commit is contained in:
20
tasks/disable-static-cfg.yml
Normal file
20
tasks/disable-static-cfg.yml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user