Disable selinux during provision

To avoid a reboot when running the kayobe scripts, we disable selinux
before running the scripts. We do this using the provision reload plugin
that allows us to do a vagrant reload while provisioning the VM.
This commit is contained in:
John Garbutt 2017-08-29 11:55:51 +01:00
parent 42605939a4
commit c5a4e46f4b
2 changed files with 15 additions and 0 deletions

14
Vagrantfile vendored
View File

@ -69,6 +69,20 @@ Vagrant.configure("2") do |config|
# documentation for more information about their specific syntax and use.
#
# Set privileged: false to run as vagrant user.
# Disable selinux, then reboot to apply the change
config.vm.provision "shell", inline: <<-SHELL
echo "cat > /etc/selinux/config << EOF
SELINUX=disabled
SELINUXTYPE=targeted
EOF" | sudo -s
cat /etc/selinux/config
SHELL
# NOTE: Reboot to apply selinux change, requires the reload plugin:
# vagrant plugin install vagrant-reload
config.vm.provision :reload
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo ifup eth1

View File

@ -12,6 +12,7 @@ First, ensure that Vagrant is installed and correctly configured to use
virtual box. Also install the following vagrant plugins:
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-reload
Note: if using Ubuntu 16.04 LTS, you may be unable to install any plugins. To
work around this install the upstream version from www.virtualbox.org.