pauper 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/hosts.rb +2 -2
  2. data/lib/pauper.rb +7 -2
  3. metadata +3 -3
@@ -5,19 +5,19 @@ class Hosts
5
5
  @preamble = ""
6
6
  @postamble = ""
7
7
  @config = {}
8
-
9
8
  parse
10
9
  end
11
10
 
12
11
  attr_reader :config
13
12
 
14
- def save
13
+ def save(dev_domain=nil)
15
14
  File.open('.tmp.hosts','w') do |f|
16
15
  f.write @preamble
17
16
  f.puts BEGIN_LINE
18
17
 
19
18
  @config.each do |ip, host|
20
19
  f.puts "#{ip}\t#{host}"
20
+ f.puts "#{ip}\t#{host}.#{dev_domain}" if dev_domain
21
21
  end
22
22
 
23
23
  f.puts END_LINE
@@ -236,7 +236,7 @@ EOF
236
236
  @pauper_config.config[:nodes].each do |node|
237
237
  hosts.config[node_ip(node)] = node.name
238
238
  end
239
- hosts.save
239
+ hosts.save(@pauper_config.config[:dev_domain])
240
240
  end
241
241
 
242
242
  def write_dhcpd
@@ -1018,7 +1018,8 @@ end
1018
1018
  :run_list => [],
1019
1019
  :shares => [],
1020
1020
  :subnet => '172.16.254',
1021
- :chef_options => {}
1021
+ :chef_options => {},
1022
+ :dev_domain => nil
1022
1023
  }
1023
1024
  instance_eval File.read(pauperfile)
1024
1025
  end
@@ -1035,6 +1036,10 @@ end
1035
1036
  @config[:ssh_password] = pass
1036
1037
  end
1037
1038
 
1039
+ def dev_domain(dev_domain)
1040
+ @config[:dev_domain] = dev_domain
1041
+ end
1042
+
1038
1043
  def subnet(net)
1039
1044
  @config[:subnet] = net
1040
1045
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tyler McMullen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-01-03 00:00:00 -08:00
18
+ date: 2013-02-27 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency