dev: account for non-vagrant machines on Linux config priv. (#16657)

This commit is contained in:
James Rasell 2023-03-27 17:13:18 +01:00 committed by GitHub
parent 320884b8ee
commit 28c142c1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

2
Vagrantfile vendored
View File

@ -134,7 +134,7 @@ def configureLinuxProvisioners(vmCfg)
vmCfg.vm.provision "shell",
privileged: true,
path: './scripts/vagrant-linux-priv-config.sh'
path: './scripts/linux-priv-config.sh'
vmCfg.vm.provision "shell",
privileged: true,

View File

@ -49,6 +49,8 @@ hostname=$(hostname)
sed -i -e "s/.*nomad.*/${ip} ${hostname}/" /etc/hosts
# Ensure we cd into the working directory on login
if ! grep "cd /opt/gopath/src/github.com/hashicorp/nomad" /home/vagrant/.profile ; then
echo 'cd /opt/gopath/src/github.com/hashicorp/nomad' >> /home/vagrant/.profile
if [ -d /home/vagrant/ ] ; then
if ! grep "cd /opt/gopath/src/github.com/hashicorp/nomad" /home/vagrant/.profile ; then
echo 'cd /opt/gopath/src/github.com/hashicorp/nomad' >> /home/vagrant/.profile
fi
fi

View File

@ -18,8 +18,8 @@ RUN useradd --create-home vagrant \
&& echo 'vagrant ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers
# install priv packages
COPY ./scripts/vagrant-linux-priv-config.sh /tmp/scripts/vagrant-linux-priv-config.sh
RUN /tmp/scripts/vagrant-linux-priv-config.sh
COPY ./scripts/linux-priv-config.sh /tmp/scripts/linux-priv-config.sh
RUN /tmp/scripts/linux-priv-config.sh
COPY ./scripts/vagrant-linux-priv-go.sh /tmp/scripts/vagrant-linux-priv-go.sh
RUN /tmp/scripts/vagrant-linux-priv-go.sh