Fix gentoo
It didn't work from within vagrant. Now it does.
This commit is contained in:
parent
04b8dfe1dc
commit
466f627852
4 changed files with 20 additions and 23 deletions
|
@ -22,27 +22,17 @@ elif [ ${DISTRIBUTION} = 'centos' -o ${DISTRIBUTION} = 'fedora' ]; then
|
||||||
else
|
else
|
||||||
echo 'Creating vagrant user...'
|
echo 'Creating vagrant user...'
|
||||||
useradd --create-home -s /bin/bash vagrant
|
useradd --create-home -s /bin/bash vagrant
|
||||||
adduser vagrant sudo || useradd vagrant
|
|
||||||
echo -n 'vagrant:vagrant' | chpasswd
|
echo -n 'vagrant:vagrant' | chpasswd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure SSH access
|
# Configure SSH access
|
||||||
if [ -d /home/vagrant/.ssh ]; then
|
mkdir -p /home/vagrant/.ssh
|
||||||
echo 'Skipping vagrant SSH credentials configuration'
|
echo $VAGRANT_KEY > /home/vagrant/.ssh/authorized_keys
|
||||||
else
|
chown -R vagrant /home/vagrant/.ssh
|
||||||
echo 'SSH key has not been set'
|
chmod +x /home/vagrant/.ssh
|
||||||
mkdir -p /home/vagrant/.ssh
|
echo 'SSH credentials configured for the vagrant user.'
|
||||||
echo $VAGRANT_KEY > /home/vagrant/.ssh/authorized_keys
|
|
||||||
chown -R vagrant: /home/vagrant/.ssh
|
|
||||||
echo 'SSH credentials configured for the vagrant user.'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Enable passwordless sudo for the vagrant user
|
# Enable passwordless sudo for the vagrant user
|
||||||
if [ -f /etc/sudoers.d/vagrant ]; then
|
echo "vagrant ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/vagrant
|
||||||
echo 'Skipping sudoers file creation.'
|
chmod 0440 /etc/sudoers.d/vagrant
|
||||||
else
|
echo 'Sudoers file created.'
|
||||||
echo 'Sudoers file was not found'
|
|
||||||
echo "vagrant ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/vagrant
|
|
||||||
chmod 0440 /etc/sudoers.d/vagrant
|
|
||||||
echo 'Sudoers file created.'
|
|
||||||
fi
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed
|
||||||
|
|
||||||
|
# Default console settings
|
||||||
|
lxc.tty = 4
|
||||||
|
lxc.pts = 1024
|
|
@ -5,7 +5,7 @@ source /etc/profile
|
||||||
|
|
||||||
echo 'Installing packages and upgrading'
|
echo 'Installing packages and upgrading'
|
||||||
|
|
||||||
PACKAGES=(vim net-misc/curl wget man-db openssh bash-completion ca-certificates sudo)
|
PACKAGES=(net-misc/curl wget man-db openssh ca-certificates sudo)
|
||||||
|
|
||||||
echo "Installing additional packages: ${ADDPACKAGES}"
|
echo "Installing additional packages: ${ADDPACKAGES}"
|
||||||
PACKAGES+=" ${ADDPACKAGES}"
|
PACKAGES+=" ${ADDPACKAGES}"
|
||||||
|
@ -32,8 +32,10 @@ if [[ $SALT = 1 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# trying to set capabilities on an unprivileged container fails.
|
# trying to set capabilities on an unprivileged container fails.
|
||||||
echo "net-misc/iputils -filecaps" > /etc/portage/package.use/vagrant_overrides
|
echo "*/* -filecaps" > /etc/portage/package.use/vagrant_overrides
|
||||||
|
|
||||||
emerge --sync
|
emerge --sync
|
||||||
emerge --noreplace ${PACKAGES[*]}
|
emerge --noreplace ${PACKAGES[*]}
|
||||||
emerge -uND @world
|
emerge -uND @world
|
||||||
|
|
||||||
|
rc-config add sshd default
|
||||||
|
|
|
@ -30,9 +30,9 @@ SECS=15
|
||||||
log "Sleeping for $SECS seconds..."
|
log "Sleeping for $SECS seconds..."
|
||||||
sleep $SECS
|
sleep $SECS
|
||||||
|
|
||||||
#utils.lxc.runscript gentoo/install-packages.sh
|
utils.lxc.runscript gentoo/install-packages.sh
|
||||||
#utils.lxc.runscript common/prepare-vagrant-user.sh
|
utils.lxc.runscript common/prepare-vagrant-user.sh
|
||||||
#utils.lxc.runscript gentoo/clean.sh
|
utils.lxc.runscript gentoo/clean.sh
|
||||||
utils.lxc.stop
|
utils.lxc.stop
|
||||||
|
|
||||||
./common/package.sh
|
./common/package.sh
|
||||||
|
|
Loading…
Reference in a new issue