Index: manifests/vagrant.pp |
=================================================================== |
--- a/manifests/vagrant.pp |
+++ b/manifests/vagrant.pp |
@@ -1,18 +1,30 @@ |
-node default { |
- class {'hosts': |
- hosts => { |
- 'localhost' => '127.0.0.1', |
- "${hostname}" => '127.0.0.1', |
- 'www.adblockplus.org' => '10.8.0.97', |
- 'monitoring.adblockplus.org' => '10.8.0.98', |
- 'server_1.adblockplus.org' => '10.8.0.105', |
- 'server_3.adblockplus.org' => '10.8.0.99', |
- 'server_4.adblockplus.org' => '10.8.0.98', |
- 'server_5.adblockplus.org' => '10.8.0.100', |
- 'server_6.adblockplus.org' => '10.8.0.101', |
- 'server_7.adblockplus.org' => '10.8.0.102', |
- 'server_8.adblockplus.org' => '10.8.0.103', |
- 'server_9.adblockplus.org' => '10.8.0.104' |
- } |
+define hostentry ( |
+ $host = $title['host'], |
+ $ip = $title['ip'] |
+) { |
+ host {$host: |
+ ensure => present, |
+ ip => $ip, |
+ name => $host |
} |
} |
+ |
+node default { |
+ |
+ $hosts = [ |
+ {host => 'localhost', ip => '127.0.0.1'}, |
+ {host => $hostname, ip => '127.0.0.1'}, |
+ {host => 'www.adblockplus.org', ip => '10.8.0.97'}, |
+ {host => 'monitoring.adblockplus.org', ip => '10.8.0.98'}, |
+ {host => 'server_1.adblockplus.org', ip => '10.8.0.105'}, |
+ {host => 'server_3.adblockplus.org', ip => '10.8.0.99'}, |
+ {host => 'server_4.adblockplus.org', ip => '10.8.0.98'}, |
+ {host => 'server_5.adblockplus.org', ip => '10.8.0.100'}, |
+ {host => 'server_6.adblockplus.org', ip => '10.8.0.101'}, |
+ {host => 'server_7.adblockplus.org', ip => '10.8.0.102'}, |
+ {host => 'server_8.adblockplus.org', ip => '10.8.0.103'}, |
+ {host => 'server_9.adblockplus.org', ip => '10.8.0.104'} |
+ ] |
+ |
+ hostentry { $hosts: } |
+} |