forked from saratov/infra
Disabled resolv.conf workarounds for 'systemd-networkd'
This commit is contained in:
parent
f63df41138
commit
e2af2cbd43
@ -5,67 +5,8 @@
|
|||||||
when: item not in vars
|
when: item not in vars
|
||||||
with_items: "{{ krb5_cl_required_vars }}"
|
with_items: "{{ krb5_cl_required_vars }}"
|
||||||
|
|
||||||
- name: check if NetworkManager is present (ALTLinux)
|
|
||||||
command: >
|
|
||||||
rpm -q NetworkManager-daemon
|
|
||||||
register: networkmanager_present
|
|
||||||
failed_when: false
|
|
||||||
|
|
||||||
- name: disable resolv.conf management by NM
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/NetworkManager/NetworkManager.conf
|
|
||||||
regexp: '^dns='
|
|
||||||
line: 'dns=none'
|
|
||||||
backrefs: yes
|
|
||||||
state: present
|
|
||||||
register: nm_conf_is
|
|
||||||
notify: Restart NetworkManager
|
|
||||||
when: networkmanager_present.rc == 0
|
|
||||||
|
|
||||||
- name: Add line if not configured
|
|
||||||
lineinfile:
|
|
||||||
state : present
|
|
||||||
dest : /etc/NetworkManager/NetworkManager.conf
|
|
||||||
line : 'dns=none'
|
|
||||||
regexp : ''
|
|
||||||
insertafter: EOF
|
|
||||||
when:
|
|
||||||
- networkmanager_present.rc == 0
|
|
||||||
- nm_conf_is.changed == false
|
|
||||||
notify: Restart NetworkManager
|
|
||||||
|
|
||||||
- name: check if /etc/net/ifaces/eth0 exists
|
|
||||||
stat: path=/etc/net/ifaces/eth0
|
|
||||||
register: ifaces_eth0_st
|
|
||||||
failed_when: false
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
managed_by_etcnet: "{{ ifaces_eth0_st.stat.exists and ifaces_eth0_st.stat.isdir }}"
|
|
||||||
|
|
||||||
- name: enable eth0 (etcnet)
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/net/ifaces/eth0/options
|
|
||||||
regexp: '^DISABLED='
|
|
||||||
line: 'DISABLED=no'
|
|
||||||
backrefs: yes
|
|
||||||
state: present
|
|
||||||
register: net_conf_is
|
|
||||||
changed_when: managed_by_etcnet|bool and net_conf_is.changed
|
|
||||||
when: managed_by_etcnet|bool
|
|
||||||
notify: Restart networking service
|
|
||||||
|
|
||||||
- meta: flush_handlers
|
- meta: flush_handlers
|
||||||
|
|
||||||
- name: update resolver, step 1
|
|
||||||
command: resolvconf -d NetworkManager
|
|
||||||
when: networkmanager_present.rc == 0
|
|
||||||
failed_when: false
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: update resolver, step 2
|
|
||||||
command: resolvconf -u
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: install Kerberos 5 client packages
|
- name: install Kerberos 5 client packages
|
||||||
apt_rpm:
|
apt_rpm:
|
||||||
pkg: "{{ krb5_cl_packages | join(',')}}"
|
pkg: "{{ krb5_cl_packages | join(',')}}"
|
||||||
|
Loading…
Reference in New Issue
Block a user