forked from sepulworld/aptly-vagrant
/
Vagrantfile
47 lines (43 loc) · 2.02 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
# Update puppet to version 3.7.1 before using puppet provisioning.
config.vm.provision :shell, path: "setup_apt_mirrors.sh"
config.vm.provision :shell, path: "update_puppet.sh"
# Setup Aptly Repo VM
config.vm.define "reposerver" do |buildRepoServer|
buildRepoServer.vm.network "private_network", ip: "192.168.100.110"
buildRepoServer.vm.synced_folder "puppet/modules", "/tmp/vagrant-puppet/puppet/modules"
buildRepoServer.vm.provision "shell", path: "make_vagrant_data.sh"
buildRepoServer.vm.provision "shell", path: "install_build_tools.sh"
buildRepoServer.vm.provision "shell", path: "generate_gpg.sh"
buildRepoServer.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.options = ["--modulepath", "/tmp/vagrant-puppet/puppet/modules"]
puppet.manifest_file = "site.pp"
end
buildRepoServer.vm.network "forwarded_port", guest: 80, host: 8081
buildRepoServer.vm.network "forwarded_port", guest: 8080, host: 8080
buildRepoServer.vm.provision "shell", path: "publish_repos.sh"
end
# Setup server1 which will have Aptly repos in sources.list.d
config.vm.define "server1" do |buildServer1|
buildServer1.vm.network "private_network", ip: "192.168.100.111"
buildServer1.vm.provision :puppet do |puppet2|
puppet2.manifests_path = "puppet/manifests_server"
puppet2.module_path = "puppet/modules"
puppet2.options = ["--modulepath", "/tmp/vagrant/puppet/modules"]
puppet2.manifest_file = "site.pp"
end
buildServer1.vm.provision "shell", inline: "gpg --import /vagrant/vagrant.asc"
buildServer1.vm.provision "shell", path: "add_aptly_repo.sh"
end
end