Optimize Vagrant setup

- define grains to match optimized gvasalt repository
- define minion configuration in separate file
- drop custome salt/bootstrap.sh
- adapt Vagrantfile to use the custom grains file
- increase memory size of created VM to allow the salt provisioning to
  succeed
This commit is contained in:
Jan Dittberner 2020-03-03 22:11:46 +01:00
parent b54b8577cb
commit 9f662e3afb
4 changed files with 30 additions and 39 deletions

View file

@ -1,38 +0,0 @@
#!/bin/sh -
apt-get update
apt-get install -y python3-cryptography
export salt_bootstrap_url=https://bootstrap.saltstack.com/
# We just download the bootstrap script by default and execute that.
if [ -x /usr/bin/fetch ]; then
/usr/bin/fetch -o - $salt_bootstrap_url | sh -s -- "$@"
elif [ -x /usr/bin/curl ]; then
/usr/bin/curl -L $salt_bootstrap_url | sh -s -- "$@"
else
python3 -c "from urllib.request import urlopen; print(urlopen(\"$salt_bootstrap_url\").read().decode('utf-8'))" | sh -s -- "$@"
fi
mkdir -p /etc/salt
cat >/etc/salt/minion <<EOF
file_client: local
file_roots:
base:
- /srv/salt/
pillar_roots:
base:
- /srv/pillar
log_file: file:///dev/log
EOF
umask 077
cat >/etc/salt/grains <<EOF
roles:
- ldapserver
- gnuviechadmin.gvaldap
EOF

14
salt/grains Normal file
View file

@ -0,0 +1,14 @@
gnuviechadmin:
user: vagrant
group: vagrant
amqpuser: ldap
appname: gvaldap
checkout: /vagrant
fullname: LDAP
giturl: gituser@nextgit.gnuviech-server.de:gnuviech/gvaldap.git
home: /home/vagrant
update_git: False
roles:
- vagrant
- ldapserver
- gnuviechadmin.gvaldap

11
salt/minion Normal file
View file

@ -0,0 +1,11 @@
file_client: local
file_roots:
base:
- /srv/salt/
pillar_roots:
base:
- /srv/pillar
log_file: file:///dev/log