puppet 3.0.1 → 3.0.2.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (97) hide show
  1. data/Gemfile +17 -3
  2. data/Rakefile +7 -5
  3. data/ext/build_defaults.yaml +1 -1
  4. data/ext/debian/puppet.init +33 -34
  5. data/ext/debian/puppet.logrotate +2 -1
  6. data/ext/debian/puppetmaster.init +1 -2
  7. data/ext/suse/client.init +1 -1
  8. data/ext/suse/puppet.spec +3 -0
  9. data/ext/suse/server.init +1 -1
  10. data/ext/windows/service/daemon.rb +1 -1
  11. data/install.rb +32 -53
  12. data/lib/hiera/backend/puppet_backend.rb +6 -5
  13. data/lib/puppet/agent.rb +3 -3
  14. data/lib/puppet/application/agent.rb +1 -2
  15. data/lib/puppet/application/cert.rb +4 -5
  16. data/lib/puppet/application/kick.rb +3 -0
  17. data/lib/puppet/defaults.rb +15 -2
  18. data/lib/puppet/indirector/exec.rb +1 -1
  19. data/lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +1 -1
  20. data/lib/puppet/parser/functions/hiera_include.rb +6 -4
  21. data/lib/puppet/parser/lexer.rb +38 -1
  22. data/lib/puppet/parser/relationship.rb +3 -1
  23. data/lib/puppet/provider.rb +1 -1
  24. data/lib/puppet/provider/augeas/augeas.rb +1 -1
  25. data/lib/puppet/provider/file/windows.rb +10 -29
  26. data/lib/puppet/provider/group/ldap.rb +1 -1
  27. data/lib/puppet/provider/group/windows_adsi.rb +1 -1
  28. data/lib/puppet/provider/ldap.rb +5 -1
  29. data/lib/puppet/provider/macauthorization/macauthorization.rb +2 -6
  30. data/lib/puppet/provider/package/dpkg.rb +8 -12
  31. data/lib/puppet/provider/package/macports.rb +2 -2
  32. data/lib/puppet/provider/package/msi.rb +2 -2
  33. data/lib/puppet/provider/package/sun.rb +1 -1
  34. data/lib/puppet/provider/package/windows.rb +2 -2
  35. data/lib/puppet/provider/package/yum.rb +5 -1
  36. data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
  37. data/lib/puppet/provider/service/freebsd.rb +1 -1
  38. data/lib/puppet/provider/user/directoryservice.rb +603 -65
  39. data/lib/puppet/provider/user/windows_adsi.rb +1 -1
  40. data/lib/puppet/provider/zpool/zpool.rb +1 -1
  41. data/lib/puppet/run.rb +2 -1
  42. data/lib/puppet/settings.rb +9 -5
  43. data/lib/puppet/ssl/certificate_authority.rb +2 -0
  44. data/lib/puppet/transaction.rb +1 -1
  45. data/lib/puppet/type/cron.rb +4 -4
  46. data/lib/puppet/type/exec.rb +10 -5
  47. data/lib/puppet/type/file.rb +1 -1
  48. data/lib/puppet/type/service.rb +3 -2
  49. data/lib/puppet/type/user.rb +24 -2
  50. data/lib/puppet/util.rb +3 -6
  51. data/lib/puppet/util/adsi.rb +3 -9
  52. data/lib/puppet/util/diff.rb +1 -1
  53. data/lib/puppet/util/execution.rb +13 -6
  54. data/lib/puppet/util/feature.rb +3 -1
  55. data/lib/puppet/util/log/destinations.rb +12 -16
  56. data/lib/puppet/util/selinux.rb +18 -2
  57. data/lib/puppet/util/windows.rb +1 -0
  58. data/lib/puppet/util/windows/security.rb +2 -39
  59. data/lib/puppet/util/windows/sid.rb +96 -0
  60. data/lib/puppet/version.rb +1 -1
  61. data/spec/integration/util/windows/security_spec.rb +3 -23
  62. data/spec/unit/agent_spec.rb +7 -3
  63. data/spec/unit/application/agent_spec.rb +13 -5
  64. data/spec/unit/daemon_spec.rb +2 -1
  65. data/spec/unit/hiera/backend/puppet_backend_spec.rb +49 -42
  66. data/spec/unit/indirector/exec_spec.rb +8 -6
  67. data/spec/unit/parser/functions/hiera_include_spec.rb +11 -4
  68. data/spec/unit/parser/lexer_spec.rb +120 -8
  69. data/spec/unit/parser/relationship_spec.rb +24 -0
  70. data/spec/unit/provider/file/windows_spec.rb +29 -29
  71. data/spec/unit/provider/group/windows_adsi_spec.rb +2 -2
  72. data/spec/unit/provider/nameservice/directoryservice_spec.rb +1 -1
  73. data/spec/unit/provider/package/dpkg_spec.rb +2 -2
  74. data/spec/unit/provider/package/macports_spec.rb +6 -5
  75. data/spec/unit/provider/package/msi_spec.rb +1 -1
  76. data/spec/unit/provider/package/pacman_spec.rb +1 -1
  77. data/spec/unit/provider/package/rpm_spec.rb +1 -1
  78. data/spec/unit/provider/package/sun_spec.rb +4 -4
  79. data/spec/unit/provider/package/windows_spec.rb +1 -1
  80. data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +14 -11
  81. data/spec/unit/provider/user/directoryservice_spec.rb +943 -0
  82. data/spec/unit/provider/user/ldap_spec.rb +22 -8
  83. data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
  84. data/spec/unit/provider_spec.rb +1 -1
  85. data/spec/unit/run_spec.rb +1 -1
  86. data/spec/unit/settings_spec.rb +16 -0
  87. data/spec/unit/ssl/certificate_authority_spec.rb +24 -0
  88. data/spec/unit/util/adsi_spec.rb +4 -8
  89. data/spec/unit/util/diff_spec.rb +2 -2
  90. data/spec/unit/util/execution_spec.rb +78 -20
  91. data/spec/unit/util/feature_spec.rb +12 -1
  92. data/spec/unit/util/selinux_spec.rb +20 -0
  93. data/spec/unit/util/windows/sid_spec.rb +100 -0
  94. data/spec/unit/util_spec.rb +17 -0
  95. metadata +71 -48
  96. data/Gemfile.lock +0 -44
  97. data/lib/puppet/provider/interface/base.rb +0 -0
data/Gemfile CHANGED
@@ -1,10 +1,24 @@
1
1
  source :rubygems
2
2
 
3
- gemspec
3
+ # This is a fake version just to make bundler happy during development
4
+ FAKE_VERSION = '9999.0.0'
5
+
6
+ def location_for(place)
7
+ if place =~ /^(git:[^#]*)#(.*)/
8
+ [{ :git => $1, :branch => $2, :require => false }]
9
+ elsif place =~ /^file:\/\/(.*)/
10
+ [FAKE_VERSION, { :path => File.expand_path($1), :require => false }]
11
+ else
12
+ [place, { :require => false }]
13
+ end
14
+ end
4
15
 
5
16
  group(:development, :test) do
6
- gem "facter", "~> 1.6.4", :require => false
17
+ gem "puppet", *location_for('file://.')
18
+ gem "facter", *location_for(ENV['FACTER_LOCATION'] || '~> 1.6.4')
19
+ gem "hiera", *location_for(ENV['HIERA_LOCATION'] || '~> 1.0.0')
7
20
  gem "rack", "~> 1.4.1", :require => false
21
+ gem "rake", "~> 0.9.2", :require => false
8
22
  gem "rspec", "~> 2.10.0", :require => false
9
23
  gem "mocha", "~> 0.10.5", :require => false
10
24
  end
@@ -17,7 +31,7 @@ platforms :mswin, :mingw do
17
31
  gem "win32-dir", "~> 0.3.7", :require => false
18
32
  gem "win32-eventlog", "~> 0.5.3", :require => false
19
33
  gem "win32-process", "~> 0.6.5", :require => false
20
- gem "win32-security", "~> 0.1.2", :require => false
34
+ gem "win32-security", "~> 0.1.4", :require => false
21
35
  gem "win32-service", "~> 0.7.2", :require => false
22
36
  gem "win32-taskscheduler", "~> 0.2.2", :require => false
23
37
  gem "win32console", "~> 1.3.2", :require => false
data/Rakefile CHANGED
@@ -9,6 +9,8 @@ $LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks')
9
9
  begin
10
10
  require 'rubygems'
11
11
  require 'rubygems/package_task'
12
+ require 'rspec'
13
+ require 'rspec/core/rake_task'
12
14
  rescue LoadError
13
15
  # Users of older versions of Rake (0.8.7 for example) will not necessarily
14
16
  # have rubygems installed, or the newer rubygems package_task for that
@@ -18,8 +20,6 @@ rescue LoadError
18
20
  end
19
21
 
20
22
  require 'rake'
21
- require 'rspec'
22
- require "rspec/core/rake_task"
23
23
 
24
24
  Dir['tasks/**/*.rake'].each { |t| load t }
25
25
  Dir['ext/packaging/tasks/**/*'].sort.each { |t| load t }
@@ -60,7 +60,9 @@ task :default do
60
60
  sh %{rake -T}
61
61
  end
62
62
 
63
- RSpec::Core::RakeTask.new do |t|
64
- t.pattern ='spec/{unit,integration}/**/*.rb'
65
- t.fail_on_error = true
63
+ if defined?(RSpec::Core::RakeTask)
64
+ RSpec::Core::RakeTask.new do |t|
65
+ t.pattern ='spec/{unit,integration}/**/*.rb'
66
+ t.fail_on_error = true
67
+ end
66
68
  end
@@ -2,7 +2,7 @@
2
2
  packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master'
3
3
  packaging_repo: 'packaging'
4
4
  default_cow: 'base-squeeze-i386.cow'
5
- cows: 'base-lucid-i386.cow base-natty-i386.cow base-oneiric-i386.cow base-precise-i386.cow base-sid-i386.cow base-squeeze-i386.cow base-stable-i386.cow base-testing-i386.cow base-unstable-i386.cow base-wheezy-i386.cow'
5
+ cows: 'base-lucid-i386.cow base-natty-i386.cow base-oneiric-i386.cow base-precise-i386.cow base-quantal-i386.cow base-sid-i386.cow base-squeeze-i386.cow base-stable-i386.cow base-testing-i386.cow base-unstable-i386.cow base-wheezy-i386.cow'
6
6
  pbuild_conf: '/etc/pbuilderrc'
7
7
  packager: 'puppetlabs'
8
8
  gpg_name: 'info@puppetlabs.com'
@@ -6,7 +6,7 @@
6
6
  # Should-Start: puppet
7
7
  # Default-Start: 2 3 4 5
8
8
  # Default-Stop: 0 1 6
9
- ### END INIT INFO
9
+ ### END INIT INFO
10
10
 
11
11
  PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
12
12
  DAEMON=/usr/bin/puppet
@@ -23,28 +23,28 @@ test -x $DAEMON || exit 0
23
23
 
24
24
  is_true() {
25
25
  if [ "x$1" = "xtrue" -o "x$1" = "xyes" -o "x$1" = "x0" ] ; then
26
- return 0
26
+ return 0
27
27
  else
28
28
  return 1
29
29
  fi
30
30
  }
31
31
 
32
32
  reload_puppet_agent() {
33
- start-stop-daemon --stop --quiet --signal HUP --pidfile $PIDFILE
33
+ start-stop-daemon --stop --quiet --signal HUP --pidfile $PIDFILE
34
34
  }
35
35
 
36
36
  start_puppet_agent() {
37
37
  if is_true "$START" ; then
38
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
39
- --startas $DAEMON -- $NAME $DAEMON_OPTS
38
+ start-stop-daemon --start --quiet --pidfile $PIDFILE \
39
+ --startas $DAEMON -- $NAME $DAEMON_OPTS
40
40
  else
41
- echo ""
42
- echo "puppet not configured to start, please edit /etc/default/puppet to enable"
41
+ echo ""
42
+ echo "puppet not configured to start, please edit /etc/default/puppet to enable"
43
43
  fi
44
44
  }
45
45
 
46
46
  stop_puppet_agent() {
47
- start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
47
+ start-stop-daemon --stop --retry TERM/10/KILL/5 --quiet --oknodo --pidfile $PIDFILE
48
48
  }
49
49
 
50
50
  status_puppet_agent() {
@@ -53,7 +53,7 @@ status_puppet_agent() {
53
53
  else
54
54
  status_of_proc() {
55
55
  local pidfile daemon name status
56
-
56
+
57
57
  pidfile=
58
58
  OPTIND=1
59
59
  while getopts p: opt ; do
@@ -62,7 +62,7 @@ status_puppet_agent() {
62
62
  esac
63
63
  done
64
64
  shift $(($OPTIND - 1))
65
-
65
+
66
66
  if [ -n "$pidfile" ]; then
67
67
  pidfile="-p $pidfile"
68
68
  fi
@@ -79,40 +79,39 @@ status_puppet_agent() {
79
79
  else
80
80
  log_failure_msg "$name is not running"
81
81
  return $status
82
- fi
82
+ fi
83
83
  }
84
- status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
84
+ status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
85
85
  fi
86
86
  }
87
87
 
88
88
  case "$1" in
89
89
  start)
90
- log_begin_msg "Starting $DESC"
91
- start_puppet_agent
92
- log_end_msg $?
93
- ;;
90
+ log_begin_msg "Starting $DESC"
91
+ start_puppet_agent
92
+ log_end_msg $?
93
+ ;;
94
94
  stop)
95
- log_begin_msg "Stopping $DESC"
96
- stop_puppet_agent
97
- log_end_msg $?
98
- ;;
95
+ log_begin_msg "Stopping $DESC"
96
+ stop_puppet_agent
97
+ log_end_msg $?
98
+ ;;
99
99
  reload)
100
- log_begin_msg "Reloading $DESC"
100
+ log_begin_msg "Reloading $DESC"
101
101
  reload_puppet_agent
102
- log_end_msg $?
103
- ;;
102
+ log_end_msg $?
103
+ ;;
104
104
  status)
105
105
  status_puppet_agent
106
- ;;
106
+ ;;
107
107
  restart|force-reload)
108
- log_begin_msg "Restarting $DESC"
109
- stop_puppet_agent
110
- sleep 1
111
- start_puppet_agent
112
- log_end_msg $?
113
- ;;
114
- *)
115
- echo "Usage: $0 {start|stop|status|restart|force-reload|reload}" >&2
116
- exit 1
117
- ;;
108
+ log_begin_msg "Restarting $DESC"
109
+ stop_puppet_agent
110
+ start_puppet_agent
111
+ log_end_msg $?
112
+ ;;
113
+ *)
114
+ echo "Usage: $0 {start|stop|status|restart|force-reload|reload}" >&2
115
+ exit 1
116
+ ;;
118
117
  esac
@@ -1,9 +1,10 @@
1
1
  /var/log/puppet/*log {
2
2
  missingok
3
+ sharedscripts
3
4
  create 0644 puppet puppet
4
5
  compress
5
6
  rotate 4
6
-
7
+
7
8
  postrotate
8
9
  pkill -USR2 -u puppet -f 'puppet master' || true
9
10
  [ -e /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1 || true
@@ -58,7 +58,7 @@ start_puppet_master() {
58
58
  }
59
59
 
60
60
  stop_puppet_master() {
61
- start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/puppet/${NAME}.pid
61
+ start-stop-daemon --stop --retry TERM/10/KILL/5 --quiet --oknodo --pidfile /var/run/puppet/${NAME}.pid
62
62
  }
63
63
 
64
64
  status_puppet_master() {
@@ -124,7 +124,6 @@ case "$1" in
124
124
  restart|force-reload)
125
125
  log_begin_msg "Restarting $DESC"
126
126
  stop_puppet_master
127
- sleep 1
128
127
  start_puppet_master
129
128
  log_end_msg $?
130
129
  ;;
data/ext/suse/client.init CHANGED
@@ -17,7 +17,7 @@
17
17
  # Should-Start: puppet
18
18
  # Required-Stop: $local_fs $remote_fs $network $syslog
19
19
  # Should-Stop: puppet
20
- # Default-Start: 3 4 5
20
+ # Default-Start: 3 5
21
21
  # Default-Stop: 0 1 2 6
22
22
  # Short-Description: puppet
23
23
  # Description: Enables periodic system configuration checks through puppet.
data/ext/suse/puppet.spec CHANGED
@@ -16,8 +16,11 @@ PreReq: %{insserv_prereq} %{fillup_prereq}
16
16
  Requires: ruby >= 1.8.7
17
17
  Requires: facter >= 1.6.11
18
18
  Requires: cron
19
+ Requires: logrotate
19
20
  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20
21
  BuildRequires: ruby >= 1.8.7
22
+ BuildRequires: klogd
23
+ BuildRequires: sysconfig
21
24
 
22
25
  %description
23
26
  Puppet lets you centrally manage every important aspect of your system using a
data/ext/suse/server.init CHANGED
@@ -15,7 +15,7 @@
15
15
  # Should-Start: puppetmaster
16
16
  # Required-Stop: $local_fs $remote_fs $network $syslog
17
17
  # Should-Stop: puppetmaster
18
- # Default-Start: 3 4 5
18
+ # Default-Start: 3 5
19
19
  # Default-Stop: 0 1 2 6
20
20
  # Short-Description: puppetmaster
21
21
  # Description: Server for the puppet system management tool.
@@ -45,7 +45,7 @@ class WindowsDaemon < Win32::Daemon
45
45
 
46
46
  log_debug("Using '#{puppet}'")
47
47
  begin
48
- runinterval = %x{ "#{puppet}" config print runinterval }.to_i
48
+ runinterval = %x{ "#{puppet}" agent --configprint runinterval }.to_i
49
49
  if runinterval == 0
50
50
  runinterval = 1800
51
51
  log_err("Failed to determine runinterval, defaulting to #{runinterval} seconds")
data/install.rb CHANGED
@@ -14,20 +14,17 @@
14
14
  #
15
15
  # bin/ # executable files -- "commands"
16
16
  # lib/ # the source of the library
17
- # tests/ # unit tests
18
17
  #
19
18
  # The default behaviour:
20
- # 1) Run all unit test files (ending in .rb) found in all directories under
21
- # tests/.
22
- # 2) Build Rdoc documentation from all files in bin/ (excluding .bat and .cmd),
19
+ # 1) Build Rdoc documentation from all files in bin/ (excluding .bat and .cmd),
23
20
  # all .rb files in lib/, ./README, ./ChangeLog, and ./Install.
24
- # 3) Build ri documentation from all files in bin/ (excluding .bat and .cmd),
21
+ # 2) Build ri documentation from all files in bin/ (excluding .bat and .cmd),
25
22
  # and all .rb files in lib/. This is disabled by default on Microsoft Windows.
26
- # 4) Install commands from bin/ into the Ruby bin directory. On Windows, if a
23
+ # 3) Install commands from bin/ into the Ruby bin directory. On Windows, if a
27
24
  # if a corresponding batch file (.bat or .cmd) exists in the bin directory,
28
25
  # it will be copied over as well. Otherwise, a batch file (always .bat) will
29
26
  # be created to run the specified command.
30
- # 5) Install all library files ending in .rb from lib/ into Ruby's
27
+ # 4) Install all library files ending in .rb from lib/ into Ruby's
31
28
  # site_lib/version directory.
32
29
  #
33
30
  #++
@@ -66,15 +63,6 @@ def glob(list)
66
63
  g
67
64
  end
68
65
 
69
- # Set these values to what you want installed.
70
- configs = glob(%w{conf/auth.conf})
71
- bins = glob(%w{bin/*})
72
- rdoc = glob(%w{bin/* lib/**/*.rb README README-library CHANGELOG TODO Install}).reject { |e| e=~ /\.(bat|cmd)$/ }
73
- ri = glob(%w{bin/*.rb lib/**/*.rb}).reject { |e| e=~ /\.(bat|cmd)$/ }
74
- man = glob(%w{man/man[0-9]/*})
75
- libs = glob(%w{lib/**/*.rb lib/**/*.erb lib/**/*.py lib/puppet/util/command_line/*})
76
- tests = glob(%w{test/**/*.rb})
77
-
78
66
  def do_configs(configs, target, strip = 'conf/')
79
67
  Dir.mkdir(target) unless File.directory? target
80
68
  configs.each do |cf|
@@ -82,7 +70,7 @@ def do_configs(configs, target, strip = 'conf/')
82
70
  if $haveftools
83
71
  File.install(cf, ocf, 0644, true)
84
72
  else
85
- FileUtils.install(cf, ocf, {:mode => 0644, :verbose => true})
73
+ FileUtils.install(cf, ocf, {:mode => 0644, :preserve => true, :verbose => true})
86
74
  end
87
75
  end
88
76
 
@@ -92,7 +80,7 @@ def do_configs(configs, target, strip = 'conf/')
92
80
  if $haveftools
93
81
  File.install(src_dll, dst_dll, 0644, true)
94
82
  else
95
- FileUtils.install(src_dll, dst_dll, {:mode => 0644, :verbose => true})
83
+ FileUtils.install(src_dll, dst_dll, {:mode => 0644, :preserve => true, :verbose => true})
96
84
  end
97
85
 
98
86
  require 'win32/registry'
@@ -128,7 +116,7 @@ def do_libs(libs, strip = 'lib/')
128
116
  else
129
117
  FileUtils.makedirs(op, {:mode => 0755, :verbose => true})
130
118
  FileUtils.chmod(0755, op)
131
- FileUtils.install(lf, olf, {:mode => 0644, :verbose => true})
119
+ FileUtils.install(lf, olf, {:mode => 0644, :preserve => true, :verbose => true})
132
120
  end
133
121
  end
134
122
  end
@@ -144,7 +132,7 @@ def do_man(man, strip = 'man/')
144
132
  else
145
133
  FileUtils.makedirs(om, {:mode => 0755, :verbose => true})
146
134
  FileUtils.chmod(0755, om)
147
- FileUtils.install(mf, omf, {:mode => 0644, :verbose => true})
135
+ FileUtils.install(mf, omf, {:mode => 0644, :preserve => true, :verbose => true})
148
136
  end
149
137
  gzip = %x{which gzip}
150
138
  gzip.chomp!
@@ -365,25 +353,6 @@ def build_ri(files)
365
353
  end
366
354
  end
367
355
 
368
- def run_tests(test_list)
369
- require 'test/unit/ui/console/testrunner'
370
- $LOAD_PATH.unshift "lib"
371
- test_list.each do |test|
372
- next if File.directory?(test)
373
- require test
374
- end
375
-
376
- tests = []
377
- ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
378
- tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
379
- tests.delete_if { |o| o == Test::Unit::TestCase }
380
-
381
- tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
382
- $LOAD_PATH.shift
383
- rescue LoadError
384
- puts "Missing testrunner library; skipping tests"
385
- end
386
-
387
356
  ##
388
357
  # Install file(s) from ./bin to RbConfig::CONFIG['bindir']. Patch it on the way
389
358
  # to insert a #! line; on a Unix install, the command is named as expected
@@ -411,12 +380,12 @@ def install_binfile(from, op_file, target)
411
380
  installed_wrapper = false
412
381
 
413
382
  if File.exists?("#{from}.bat")
414
- FileUtils.install("#{from}.bat", File.join(target, "#{op_file}.bat"), :mode => 0755, :verbose => true)
383
+ FileUtils.install("#{from}.bat", File.join(target, "#{op_file}.bat"), :mode => 0755, :preserve => true, :verbose => true)
415
384
  installed_wrapper = true
416
385
  end
417
386
 
418
387
  if File.exists?("#{from}.cmd")
419
- FileUtils.install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), :mode => 0755, :verbose => true)
388
+ FileUtils.install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), :mode => 0755, :preserve => true, :verbose => true)
420
389
  installed_wrapper = true
421
390
  end
422
391
 
@@ -430,23 +399,33 @@ set RUBY_BIN=%RUBY_BIN:\\=/%
430
399
  "%RUBY_BIN%ruby.exe" -x "%RUBY_BIN%puppet" %*
431
400
  EOS
432
401
  File.open(tmp_file2.path, "w") { |cw| cw.puts cwv }
433
- FileUtils.install(tmp_file2.path, File.join(target, "#{op_file}.bat"), :mode => 0755, :verbose => true)
402
+ FileUtils.install(tmp_file2.path, File.join(target, "#{op_file}.bat"), :mode => 0755, :preserve => true, :verbose => true)
434
403
 
435
404
  tmp_file2.unlink
436
405
  installed_wrapper = true
437
406
  end
438
407
  end
439
- FileUtils.install(tmp_file.path, File.join(target, op_file), :mode => 0755, :verbose => true)
408
+ FileUtils.install(tmp_file.path, File.join(target, op_file), :mode => 0755, :preserve => true, :verbose => true)
440
409
  tmp_file.unlink
441
410
  end
442
411
 
443
- check_prereqs
444
- prepare_installation
445
-
446
- #run_tests(tests) if InstallOptions.tests
447
- #build_rdoc(rdoc) if InstallOptions.rdoc
448
- #build_ri(ri) if InstallOptions.ri
449
- do_configs(configs, InstallOptions.config_dir) if InstallOptions.configs
450
- do_bins(bins, InstallOptions.bin_dir)
451
- do_libs(libs)
452
- do_man(man) unless $operatingsystem == "windows"
412
+ # Change directory into the puppet root so we don't get the wrong files for install.
413
+ FileUtils.cd File.dirname(__FILE__) do
414
+ # Set these values to what you want installed.
415
+ configs = glob(%w{conf/auth.conf})
416
+ bins = glob(%w{bin/*})
417
+ rdoc = glob(%w{bin/* lib/**/*.rb README* }).reject { |e| e=~ /\.(bat|cmd)$/ }
418
+ ri = glob(%w{bin/*.rb lib/**/*.rb}).reject { |e| e=~ /\.(bat|cmd)$/ }
419
+ man = glob(%w{man/man[0-9]/*})
420
+ libs = glob(%w{lib/**/*.rb lib/**/*.erb lib/**/*.py lib/puppet/util/command_line/*})
421
+
422
+ check_prereqs
423
+ prepare_installation
424
+
425
+ #build_rdoc(rdoc) if InstallOptions.rdoc
426
+ #build_ri(ri) if InstallOptions.ri
427
+ do_configs(configs, InstallOptions.config_dir) if InstallOptions.configs
428
+ do_bins(bins, InstallOptions.bin_dir)
429
+ do_libs(libs)
430
+ do_man(man) unless $operatingsystem == "windows"
431
+ end
@@ -1,3 +1,5 @@
1
+ require 'hiera/backend'
2
+
1
3
  class Hiera
2
4
  module Backend
3
5
  class Puppet_backend
@@ -71,9 +73,10 @@ class Hiera
71
73
  temp_answer = scope[varname]
72
74
  end
73
75
 
74
- next if temp_answer == :undefined
75
-
76
- if temp_answer
76
+ # Note that temp_answer might be define but false.
77
+ if temp_answer.nil?
78
+ next
79
+ else
77
80
  # For array resolution we just append to the array whatever we
78
81
  # find, we then go onto the next file and keep adding to the array.
79
82
  #
@@ -92,8 +95,6 @@ class Hiera
92
95
  end
93
96
  end
94
97
 
95
- answer = nil if answer == :undefined
96
-
97
98
  answer
98
99
  end
99
100
  end