mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Vagrant: Make F21 fixup conditional
The default Fedora 21 image requires some manual networking fixup that breaks Fedora 22. This change ensures that the fixup in question is run only for Fedora 21.
This commit is contained in:
@@ -21,15 +21,17 @@ set -e
|
|||||||
# See: https://github.com/mitchellh/vagrant/issues/2430
|
# See: https://github.com/mitchellh/vagrant/issues/2430
|
||||||
hostnamectl set-hostname ${MASTER_NAME}
|
hostnamectl set-hostname ${MASTER_NAME}
|
||||||
|
|
||||||
# Workaround to vagrant inability to guess interface naming sequence
|
if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=21 ]]; then
|
||||||
# Tell system to abandon the new naming scheme and use eth* instead
|
# Workaround to vagrant inability to guess interface naming sequence
|
||||||
rm -f /etc/sysconfig/network-scripts/ifcfg-enp0s3
|
# Tell system to abandon the new naming scheme and use eth* instead
|
||||||
|
rm -f /etc/sysconfig/network-scripts/ifcfg-enp0s3
|
||||||
|
|
||||||
# Disable network interface being managed by Network Manager (needed for Fedora 21+)
|
# Disable network interface being managed by Network Manager (needed for Fedora 21+)
|
||||||
NETWORK_CONF_PATH=/etc/sysconfig/network-scripts/
|
NETWORK_CONF_PATH=/etc/sysconfig/network-scripts/
|
||||||
grep -q ^NM_CONTROLLED= ${NETWORK_CONF_PATH}ifcfg-eth1 || echo 'NM_CONTROLLED=no' >> ${NETWORK_CONF_PATH}ifcfg-eth1
|
grep -q ^NM_CONTROLLED= ${NETWORK_CONF_PATH}ifcfg-eth1 || echo 'NM_CONTROLLED=no' >> ${NETWORK_CONF_PATH}ifcfg-eth1
|
||||||
sed -i 's/^#NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${NETWORK_CONF_PATH}ifcfg-eth1
|
sed -i 's/^#NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${NETWORK_CONF_PATH}ifcfg-eth1
|
||||||
systemctl restart network
|
systemctl restart network
|
||||||
|
fi
|
||||||
|
|
||||||
function release_not_found() {
|
function release_not_found() {
|
||||||
echo "It looks as if you don't have a compiled version of Kubernetes. If you" >&2
|
echo "It looks as if you don't have a compiled version of Kubernetes. If you" >&2
|
||||||
@@ -100,7 +102,7 @@ grains:
|
|||||||
- kubernetes-master
|
- kubernetes-master
|
||||||
runtime_config: '$(echo "$RUNTIME_CONFIG" | sed -e "s/'/''/g")'
|
runtime_config: '$(echo "$RUNTIME_CONFIG" | sed -e "s/'/''/g")'
|
||||||
docker_opts: '$(echo "$DOCKER_OPTS" | sed -e "s/'/''/g")'
|
docker_opts: '$(echo "$DOCKER_OPTS" | sed -e "s/'/''/g")'
|
||||||
master_extra_sans: '$(echo "$MASTER_EXTRA_SANS" | sed -e "s/'/''/g")'
|
master_extra_sans: '$(echo "$MASTER_EXTRA_SANS" | sed -e "s/'/''/g")'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
mkdir -p /srv/salt-overlay/pillar
|
mkdir -p /srv/salt-overlay/pillar
|
||||||
|
@@ -72,15 +72,17 @@ EOF
|
|||||||
# See: https://github.com/mitchellh/vagrant/issues/2430
|
# See: https://github.com/mitchellh/vagrant/issues/2430
|
||||||
hostnamectl set-hostname ${MINION_NAME}
|
hostnamectl set-hostname ${MINION_NAME}
|
||||||
|
|
||||||
# Workaround to vagrant inability to guess interface naming sequence
|
if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=21 ]]; then
|
||||||
# Tell system to abandon the new naming scheme and use eth* instead
|
# Workaround to vagrant inability to guess interface naming sequence
|
||||||
rm -f /etc/sysconfig/network-scripts/ifcfg-enp0s3
|
# Tell system to abandon the new naming scheme and use eth* instead
|
||||||
|
rm -f /etc/sysconfig/network-scripts/ifcfg-enp0s3
|
||||||
|
|
||||||
# Disable network interface being managed by Network Manager (needed for Fedora 21+)
|
# Disable network interface being managed by Network Manager (needed for Fedora 21+)
|
||||||
NETWORK_CONF_PATH=/etc/sysconfig/network-scripts/
|
NETWORK_CONF_PATH=/etc/sysconfig/network-scripts/
|
||||||
grep -q ^NM_CONTROLLED= ${NETWORK_CONF_PATH}ifcfg-eth1 || echo 'NM_CONTROLLED=no' >> ${NETWORK_CONF_PATH}ifcfg-eth1
|
grep -q ^NM_CONTROLLED= ${NETWORK_CONF_PATH}ifcfg-eth1 || echo 'NM_CONTROLLED=no' >> ${NETWORK_CONF_PATH}ifcfg-eth1
|
||||||
sed -i 's/^#NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${NETWORK_CONF_PATH}ifcfg-eth1
|
sed -i 's/^#NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${NETWORK_CONF_PATH}ifcfg-eth1
|
||||||
systemctl restart network
|
systemctl restart network
|
||||||
|
fi
|
||||||
|
|
||||||
# Setup hosts file to support ping by hostname to master
|
# Setup hosts file to support ping by hostname to master
|
||||||
if [ ! "$(cat /etc/hosts | grep $MASTER_NAME)" ]; then
|
if [ ! "$(cat /etc/hosts | grep $MASTER_NAME)" ]; then
|
||||||
|
Reference in New Issue
Block a user