Permalink
Browse files

bugfixes

  • Loading branch information...
jfryman committed Nov 13, 2012
1 parent b4ee141 commit dc9c9704c82bed091752b67a0684dceb3dc44074
Showing with 20 additions and 15 deletions.
  1. +2 −0 Rakefile
  2. +4 −5 config/autogen_defaults.yml
  3. +2 −2 config/provisioner_puppet.yml
  4. +8 −2 rake/puppet.rb
  5. +4 −6 rake/vagrant.rb
View
@@ -1,6 +1,8 @@
require 'rake'
require 'fileutils'
+NODES_FILE = './config/nodes.yml'
+
Dir.chdir File.dirname(__FILE__)
Dir['rake/*.rb'].each {|f| load f }
@@ -2,22 +2,21 @@
# You should edit this.
default: &default
ip: 192.168.200.1
- orgname: vagrant.test
+ orgname: github.com
vbox: debian-6.0.6-amd64
memory_size: 512
-# Edit puppet_manifests and puppet_modules to point to paths you want
-# the puppetmaster to serve out.
+# But don't edit this unless you know what you're doing.
puppetmaster:
<<: *default
ip: 192.168.200.2
memory_size: 1024
mounts:
puppet_manifests:
guest: /etc/puppet/manifests
- host: ./bootstrap/puppetmaster/manifests
+ host: ~/github/puppet/manifests
puppet_modules:
guest: /etc/puppet/modules
- host: ./bootstrap/puppetmaster/modules
+ host: ~/github/puppet/modules
hitch_config:
guest: /etc/vagrant/hitch
host: ./config
@@ -1,6 +1,6 @@
puppet:
- manifest_file: site.pp
- manifests_path: ./bootstrap/puppetmaster/manifests
+ manifest_file: vagrant.pp
+ manifests_path: ~/github/puppet/manifests
modules:
- ./bootstrap/puppetmaster/modules
options:
View
@@ -1,9 +1,15 @@
+require 'yaml'
+
+nodes = YAML::load(File.open(NODES_FILE))
+modules_path = nodes['puppetmaster']['mounts']['puppet_modules']['host']
+manifests_path = nodes['puppetmaster']['mounts']['puppet_manifests']['host']
+
namespace :puppet do
namespace :generate do
desc "Generate modules.pp while refactoring for autoloading"
task :modules do
- File.open('manifests/modules.pp', 'w') do |file|
- Dir["modules/*/manifests/init.pp"].entries.each do |path|
+ File.open(File.expand_path("#{manifests_path}/modules.pp", 'w')) do |file|
+ Dir[("#{modules_path}/*/manifests/init.pp")].entries.each do |path|
module_name = path.split('/')[1]
file.puts "import '#{module_name}'"
end
View
@@ -8,8 +8,6 @@
require 'yaml'
require 'pp'
-NODES_FILE = './config/nodes.yml'
-
baseboxes = Dir.glob("definitions/*").select { |f| File.directory?(f) }.map! do |e|
e.gsub(/definitions\//, '')
end
@@ -108,6 +106,8 @@
File.open(NODES_FILE, 'w') { |f| f.write(nodes.to_yaml) }
puts "Node #{name} has been added. Open #{NODES_FILE} to further customize"
+
+ Rake::Task['vagrant:puppetmaster:provision'].invoke
else
puts "#{name} is already defined as:"
puts nodes[name].to_yaml
@@ -124,6 +124,8 @@
File.open(NODES_FILE, 'w') { |f| f.write(nodes.to_yaml) }
puts "Node #{name} has been removed from #{NODES_FILE}"
+
+ Rake::Task['vagrant:puppetmaster:provision'].invoke
else
puts "#{name} is not defined"
end
@@ -225,10 +227,6 @@
task "vagrant:basebox:build:all" => 'vagrant:node:initialize'
-['add', 'remove'].each do |t|
- task "vagrant:node:#{t}" => 'vagrant:puppetmaster:reload_dns'
-end
-
# Make sure a nodes.yml exists to be added to
task 'vagrant:node:add' => 'vagrant:node:initialize'

0 comments on commit dc9c970

Please sign in to comment.