| Path: | ext/ec2demo/start-mcollective-demo.rb |
| Last Update: | Wed Feb 16 14:36:30 -0500 2011 |
# File ext/ec2demo/start-mcollective-demo.rb, line 35
35: def configure_activemq(mcollective_password)
36: templ = File.readlines("/etc/activemq/activemq.xml.templ")
37:
38: File.open("/etc/activemq/activemq.xml", "w") do |f|
39: templ.each do |l|
40: l.gsub!("@@mcollective_password@@", mcollective_password)
41:
42: f.puts l
43: end
44: end
45: end
# File ext/ec2demo/start-mcollective-demo.rb, line 10
10: def configure_mcollective(server, mcollective_password, psk=nil)
11: unless psk
12: pw = Passmakr.new(:phonemic, 8)
13: psk = pw.password[:string]
14: end
15:
16:
17: ["server", "client"].each do |cfgfile|
18: templ = File.readlines("/etc/mcollective/#{cfgfile}.cfg.templ")
19:
20: File.open("/etc/mcollective/#{cfgfile}.cfg", "w") do |f|
21: templ.each do |l|
22: l.gsub!("@@hostname@@", @facts["hostname"])
23: l.gsub!("@@server@@", server)
24: l.gsub!("@@psk@@", psk)
25: l.gsub!("@@mcollective_password@@", mcollective_password)
26:
27: f.puts l
28: end
29: end
30: end
31:
32: puts("mcollective_psk=#{psk}") if @facts["mcollective"] == "server"
33: end