Disable lxc-net on CentOS
The CentOS gate jobs have been plagued by intermittent network connectivity issues, including failures downloading yum metadata and failures resolving DNS records. This is happening because dnsmasq is inaccessible and network paths are broken. The lxc-net service is trampling on the ifup hooks that run lxc-system-manage, which takes care of the routes, iptables rules, and dnsmasq. This patch disables, stops, and masks the lxc-net service on CentOS to match Ubuntu. Closes-Bug: 1715248 Change-Id: I4cd10902e367528f59e58b4cb790131d7fbfb7b5
This commit is contained in:
parent
714448c8b2
commit
1d206a59f7
|
@ -47,15 +47,16 @@
|
|||
- lxc-bridge
|
||||
- lxc-interfaces
|
||||
|
||||
# All Debian installations of LXC use the lxc-net service. This service breaks our network
|
||||
# model and needs to be disabled
|
||||
# NOTE(mhayden): There are ifup hooks that handle the customized LXC container
|
||||
# networking. Starting lxc-net will trample over these hooks and cause
|
||||
# networking issues for containers.
|
||||
- name: Disable and stop lxc-net
|
||||
service:
|
||||
name: lxc-net
|
||||
enabled: no
|
||||
state: stopped
|
||||
when:
|
||||
- ansible_os_family == "Debian"
|
||||
- ansible_os_family in ["Debian", "RedHat"]
|
||||
tags:
|
||||
- lxc-net
|
||||
|
||||
|
@ -66,25 +67,11 @@
|
|||
state: link
|
||||
when:
|
||||
- ansible_service_mgr == 'systemd'
|
||||
- ansible_os_family == "Debian"
|
||||
- ansible_os_family in ["Debian", "RedHat"]
|
||||
tags:
|
||||
- lxc-files
|
||||
- lxc-net
|
||||
|
||||
# CentOS systems need the lxc-net service for LXC containers to boot with a
|
||||
# network interface.
|
||||
- name: Enable the lxc-net service upon reboot (CentOS)
|
||||
service:
|
||||
name: lxc-net
|
||||
enabled: yes
|
||||
state: started
|
||||
retries: 5
|
||||
delay: 2
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
tags:
|
||||
- lxc-net
|
||||
|
||||
# All Debian based systems use the interfaces.d directory for extra network configs
|
||||
# this check ensures the needed source line is in the base config file
|
||||
- name: Ensure networking includes interfaces.d
|
||||
|
|
Loading…
Reference in New Issue