Skip to content

Commit f3bbc44

Browse files
committed
Added option for setting static IPs in config, needs a more elegant solution
1 parent 1f53ae8 commit f3bbc44

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

Vagrantfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ Vagrant.configure("2") do |config|
44
config.vm.hostname = "ci"
55

66
config.vm.network :private_network, ip: "192.168.2.200"
7-
config.ssh.forward_agent = true
7+
#config.vm.network :public_network
8+
9+
config.ssh.forward_agent = true
810

911
config.vm.provider :virtualbox do |v|
1012
v.customize ["modifyvm", :id, '--chipset', 'ich9'] # solves kernel panic issue on some host machines
11-
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
1213
v.customize ["modifyvm", :id, "--memory", 1024] #1024mb memory
1314
v.customize ["modifyvm", :id, "--ioapic", "on"]
1415
v.gui = true

manifests/config.pp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
11
class config {
22

3+
4+
service { "networking":
5+
ensure => running,
6+
enable => true,
7+
hasrestart => true
8+
}
9+
10+
#set a static ip to a public bridged connection
11+
#enable config.vm.network :public_network
12+
# in the vagrant file
13+
14+
/*
15+
augeas { "static_ip_bridged" :
16+
context => "/files/etc/network/interfaces/iface[last()]",
17+
changes => [
18+
"rm post-up",
19+
"rm #comment",
20+
"set method static",
21+
"set address IP",
22+
"set netmask MASK",
23+
"set network IP",
24+
"set gateway IP"
25+
],
26+
notify => Service['networking']
27+
}
28+
*/
329
}

0 commit comments

Comments
 (0)