-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
125 lines (87 loc) · 3.91 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales
#Create needed directories
mkdir /home/vagrant/Desktop
#copy data to the right places
cp /puppet/*.desktop /home/vagrant/Desktop -R -u -b
#setting ownership on directories
chown vagrant:vagrant /home/vagrant/Desktop
#changing mirror location to a nearby location
sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/mirror.nexcess.net/g' /etc/apt/sources.list
#install these packages now
sudo apt-get install unzip git libpango1.0-dev curl wget net-tools -y --force-yes
#install these puppet modules
puppet module install puppetlabs-apt --force
puppet module install puppetlabs-stdlib --force
puppet module install garethr-docker --force
puppet module install jamesnetherton-google_chrome --force
puppet module install maestrodev-wget --force
puppet module install puppetlabs-java --force
puppet module install rtyler/jenkins --force
SCRIPT
$script2 = <<SCRIPT
docker pull ubuntu:14.04
#adding nsenter
docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter
#installing fig for docker
pip install fig
#installing Brackets
#brackURL='https://github.com/adobe/brackets/releases/download/release-1.1%2Beb4/Brackets.1.1.Extract.64-bit.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && sudo dpkg -i $FILE; rm $FILE
#Desktop has been installed change ownership of files
chown vagrant:vagrant -R /home/vagrant/Desktop
#jenkins plugins
//chown jenkins:jenkins /jenkins -R
//cp /jenkins/plugins/* /var/lib/jenkins/plugins/ -R
//chown jenkins:jenkins /var/lib/jenkins -R
#jenkins jobs
//rm /var/lib/jenkins/jobs -rf
//ln -s /jenkins/jobs /var/lib/jenkins/jobs
//sudo chmod a+rw /var/lib/jenkins
sudo chown jenkins:jenkins /var/lib/jenkins -R
//sudo chown jenkins:jenkins /jenkins -R
//sudo chown jenkins:jenkins -R /development
echo '%jenkins ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
echo "Completed Setup!"
echo "Go to http://localhost:8080/ to access jenkins"
SCRIPT
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder "./development", "/development"
config.vm.synced_folder "./puppet", "/puppet", type: "rsync"
config.vm.synced_folder "./jenkins", "/var/lib/jenkins", type: "rsync", owner: "jenkins", group: "jenkins"
config.vm.box = "ubuntuphusion"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.vm.hostname = "DrupalDevEnv"
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 8081, host: 8081
config.vm.provider :virtualbox do |vb, override|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.gui = false
vb.customize ["modifyvm", :id, "--memory", 4098]
vb.customize ["modifyvm", :id, "--cpus", 4]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/puppet", "1"]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/jenkins", "1"]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/development", "1"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
config.vm.provision "shell", privileged: true, inline: $script, args: "#{ENV['FACTER_options']}"
config.vm.provision :puppet do |puppet|
puppet.options = "--verbose --debug"
puppet.manifests_path = "manifests"
puppet.manifest_file = "default.pp"
FACTER_options=ENV['FACTER_options']
puppet.facter = {
"options" => "#{FACTER_options}"
}
end
config.vm.provision "shell", privileged: true, inline: $script2, args: "#{ENV['FACTER_options']}"
end