diff --git a/Vagrantfile b/Vagrantfile index 2bd4900735b..3694e947bcf 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -74,8 +74,8 @@ $kube_provider_boxes = { }, :vmware_desktop => { 'fedora' => { - :box_name => 'kube-fedora20', - :box_url => 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_fedora-20-i386_chef-provisionerless.box' + :box_name => 'kube-fedora21', + :box_url => 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_fedora-21_chef-provisionerless.box' } } } diff --git a/cluster/saltbase/salt/generate-cert/init.sls b/cluster/saltbase/salt/generate-cert/init.sls index 524257b9a39..b697a5ca47d 100644 --- a/cluster/saltbase/salt/generate-cert/init.sls +++ b/cluster/saltbase/salt/generate-cert/init.sls @@ -9,9 +9,6 @@ {% if grains.cloud == 'azure' %} {% set cert_ip='_use_azure_dns_name_' %} {% endif %} - {% if grains.cloud == 'vagrant' %} - {% set cert_ip=grains.ip_interfaces.eth1[0] %} - {% endif %} {% if grains.cloud == 'vsphere' %} {% set cert_ip=grains.ip_interfaces.eth0[0] %} {% endif %} diff --git a/cluster/vagrant/provision-master.sh b/cluster/vagrant/provision-master.sh index 60ed9b0276c..ac2cbc69329 100755 --- a/cluster/vagrant/provision-master.sh +++ b/cluster/vagrant/provision-master.sh @@ -28,11 +28,16 @@ if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=21 ]]; then # Disable network interface being managed by Network Manager (needed for Fedora 21+) 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 - sed -i 's/^#NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${NETWORK_CONF_PATH}ifcfg-eth1 + if_to_edit=$( find ${NETWORK_CONF_PATH}ifcfg-* | xargs grep -l VAGRANT-BEGIN ) + for if_conf in ${if_to_edit}; do + grep -q ^NM_CONTROLLED= ${if_conf} || echo 'NM_CONTROLLED=no' >> ${if_conf} + sed -i 's/#^NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${if_conf} + done; systemctl restart network fi +NETWORK_IF_NAME=`echo ${if_to_edit} | awk -F- '{ print $3 }'` + function release_not_found() { echo "It looks as if you don't have a compiled version of Kubernetes. If you" >&2 echo "are running from a clone of the git repo, please run 'make quick-release'." >&2 @@ -95,7 +100,7 @@ grains: node_ip: '$(echo "$MASTER_IP" | sed -e "s/'/''/g")' publicAddressOverride: '$(echo "$MASTER_IP" | sed -e "s/'/''/g")' network_mode: openvswitch - networkInterfaceName: eth1 + networkInterfaceName: '$(echo "$NETWORK_IF_NAME" | sed -e "s/'/''/g")' api_servers: '$(echo "$MASTER_IP" | sed -e "s/'/''/g")' cloud: vagrant roles: diff --git a/cluster/vagrant/provision-minion.sh b/cluster/vagrant/provision-minion.sh index 7eb4ca1e17f..68c7ad6c0f9 100755 --- a/cluster/vagrant/provision-minion.sh +++ b/cluster/vagrant/provision-minion.sh @@ -79,11 +79,16 @@ if [[ "$(grep 'VERSION_ID' /etc/os-release)" =~ ^VERSION_ID=21 ]]; then # Disable network interface being managed by Network Manager (needed for Fedora 21+) 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 - sed -i 's/^#NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${NETWORK_CONF_PATH}ifcfg-eth1 + if_to_edit=$( find ${NETWORK_CONF_PATH}ifcfg-* | xargs grep -l VAGRANT-BEGIN ) + for if_conf in ${if_to_edit}; do + grep -q ^NM_CONTROLLED= ${if_conf} || echo 'NM_CONTROLLED=no' >> ${if_conf} + sed -i 's/#^NM_CONTROLLED=.*/NM_CONTROLLED=no/' ${if_conf} + done; systemctl restart network fi +NETWORK_IF_NAME=`echo ${if_to_edit} | awk -F- '{ print $3 }'` + # Setup hosts file to support ping by hostname to master if [ ! "$(cat /etc/hosts | grep $MASTER_NAME)" ]; then echo "Adding $MASTER_NAME to hosts file" @@ -142,7 +147,7 @@ grains: network_mode: openvswitch node_ip: '$(echo "$MINION_IP" | sed -e "s/'/''/g")' api_servers: '$(echo "$MASTER_IP" | sed -e "s/'/''/g")' - networkInterfaceName: eth1 + networkInterfaceName: '$(echo "$NETWORK_IF_NAME" | sed -e "s/'/''/g")' roles: - kubernetes-pool cbr-cidr: '$(echo "$CONTAINER_SUBNET" | sed -e "s/'/''/g")'