-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVagrantfile
55 lines (44 loc) · 2.28 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-14.04"
config.vm.hostname = "odapper.home.net"
# Setup static ip address to be used with the Atlassian Suite of Application Servers
config.vm.network "private_network", ip: "192.168.50.80"
# Use an inline shell provisioner for basic setup
config.vm.provision 'shell', inline: shell, privileged: false
# Copy phpldapadmin config file
config.vm.provision "file", source: "files/config.php", destination: "/home/vagrant/LDAP_CONFIG/config.php"
# Copy sample set of users to import into OpenLDAP
config.vm.provision "file", source: "files/malcolm.ldif", destination: "/home/vagrant/LDAP_CONFIG/malcolm.ldif"
config.vm.provision "file", source: "files/jayne.ldif", destination: "/home/vagrant/LDAP_CONFIG/jayne.ldif"
config.vm.provision "file", source: "files/inara.ldif", destination: "/home/vagrant/LDAP_CONFIG/inara.ldif"
config.vm.provision "file", source: "files/wash.ldif", destination: "/home/vagrant/LDAP_CONFIG/wash.ldif"
config.vm.provision "file", source: "files/zoe.ldif", destination: "/home/vagrant/LDAP_CONFIG/zoe.ldif"
config.vm.provision "file", source: "files/kaylee.ldif", destination: "/home/vagrant/LDAP_CONFIG/kaylee.ldif"
config.vm.provision "file", source: "files/jfhogarty.ldif", destination: "/home/vagrant/LDAP_CONFIG/jfhogarty.ldif"
# Run provisioning specific to setting up Salt
config.vm.provision "shell", path: 'provisioning/phpldap_provision.sh'
# Support for phpLDAPadmin on port 80
config.vm.network "forwarded_port", guest: 80, host: 3080, id: "phpldapadmin"
config.vm.provider 'virtualbox' do |vb|
vb.memory = 1024
vb.cpus = 1
end
end
def shell
<<-eos
echo Make directory for LDAP Config files
mkdir /home/vagrant/LDAP_CONFIG
echo Installing basic tools
sudo apt-get update
sudo apt-get -y install vim git-core toilet
export DEBIAN_FRONTEND=noninteractive
echo -e " \
slapd slapd/internal/generated_adminpw password openstack
slapd slapd/password2 password openstack
slapd slapd/internal/adminpw password openstack
slapd slapd/password1 password openstack
" | sudo debconf-set-selections
sudo apt-get -y install slapd ldap-utils
sudo apt-get -y install phpldapadmin
eos
end