Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
vagrantfile: Move IPv6 enabler to the setup script
Browse files Browse the repository at this point in the history
The code that enable IPv6 was moved from the Vagrantfile to
.ci/setup_env_ubuntu.sh so that the environment can be setup
correctly even if not on a vagrant box.

The following line was dropped because I don't think it's worth to
change the developer's environment permanently:

`sudo sed -i 's/\(net.ipv6.conf.all.disable_ipv6\).*/\1=0/' /etc/sysctl.conf`

Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
  • Loading branch information
wainersm committed Sep 1, 2021
1 parent 8693c3e commit 2abd3dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .ci/setup_env_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ main()
pkgs_to_install+=" ${rust_agent_pkgs[@]}"
fi

# The redis-server package fails to install if IPv6 is disabled. Let's
# check if that's the case and then enable it.
if [[ $(sudo sysctl -n net.ipv6.conf.all.disable_ipv6) -eq 1 ]]; then
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
fi

chronic sudo -E apt -y install $pkgs_to_install

[ "$setup_type" = "minimal" ] && exit 0
Expand Down
12 changes: 0 additions & 12 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ EOF
echo "cd $kata_tests_repo_dir" >> #{guest_home_dir}/.bashrc
sudo -E PATH=$PATH -u #{guest_user} \
echo "source $env_file" >> #{guest_home_dir}/.bashrc
distro=$(source /etc/os-release; echo $ID)
case "$distro" in
"ubuntu")
# TODO: redis-server package fails to install if IPv6 is disabled. Move this
# code to the setup script.
if [[ $(sysctl -n net.ipv6.conf.all.disable_ipv6) -eq 1 ]]; then
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
sudo sed -i 's/\(net.ipv6.conf.all.disable_ipv6\).*/\1=0/' /etc/sysctl.conf
fi
;;
esac
SHELL

config.vm.define "fedora", autostart: false do |fedora|
Expand Down

0 comments on commit 2abd3dd

Please sign in to comment.