puppet 2.7.9 → 2.7.11

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 (187) hide show
  1. data/CHANGELOG +413 -0
  2. data/README_DEVELOPER.md +28 -0
  3. data/conf/redhat/puppet.spec +10 -1
  4. data/conf/solaris/pkginfo +1 -1
  5. data/conf/suse/puppet.spec +7 -4
  6. data/ext/envpuppet.bat +13 -0
  7. data/ext/rack/files/apache2.conf +4 -0
  8. data/install.rb +4 -8
  9. data/lib/puppet.rb +1 -1
  10. data/lib/puppet/agent.rb +7 -0
  11. data/lib/puppet/agent/disabler.rb +27 -0
  12. data/lib/puppet/agent/locker.rb +0 -10
  13. data/lib/puppet/application.rb +3 -0
  14. data/lib/puppet/application/agent.rb +13 -3
  15. data/lib/puppet/application/apply.rb +6 -6
  16. data/lib/puppet/application/cert.rb +5 -5
  17. data/lib/puppet/application/instrumentation_data.rb +4 -0
  18. data/lib/puppet/application/instrumentation_listener.rb +4 -0
  19. data/lib/puppet/application/instrumentation_probe.rb +4 -0
  20. data/lib/puppet/configurer.rb +3 -1
  21. data/lib/puppet/configurer/downloader.rb +4 -2
  22. data/lib/puppet/configurer/fact_handler.rb +0 -21
  23. data/lib/puppet/daemon.rb +3 -4
  24. data/lib/puppet/defaults.rb +2 -2
  25. data/lib/puppet/face/instrumentation_data.rb +28 -0
  26. data/lib/puppet/face/instrumentation_listener.rb +96 -0
  27. data/lib/puppet/face/instrumentation_probe.rb +77 -0
  28. data/lib/puppet/face/module/list.rb +64 -0
  29. data/lib/puppet/face/module/uninstall.rb +50 -0
  30. data/lib/puppet/face/node/clean.rb +1 -4
  31. data/lib/puppet/feature/base.rb +1 -0
  32. data/lib/puppet/file_serving/content.rb +1 -1
  33. data/lib/puppet/indirector/facts/facter.rb +20 -7
  34. data/lib/puppet/indirector/facts/inventory_active_record.rb +14 -11
  35. data/lib/puppet/indirector/indirection.rb +7 -0
  36. data/lib/puppet/indirector/instrumentation_data.rb +3 -0
  37. data/lib/puppet/indirector/instrumentation_data/local.rb +19 -0
  38. data/lib/puppet/indirector/instrumentation_data/rest.rb +5 -0
  39. data/lib/puppet/indirector/instrumentation_listener.rb +3 -0
  40. data/lib/puppet/indirector/instrumentation_listener/local.rb +23 -0
  41. data/lib/puppet/indirector/instrumentation_listener/rest.rb +5 -0
  42. data/lib/puppet/indirector/instrumentation_probe.rb +3 -0
  43. data/lib/puppet/indirector/instrumentation_probe/local.rb +24 -0
  44. data/lib/puppet/indirector/instrumentation_probe/rest.rb +5 -0
  45. data/lib/puppet/indirector/rest.rb +1 -1
  46. data/lib/puppet/module.rb +13 -17
  47. data/lib/puppet/module_tool/applications.rb +1 -0
  48. data/lib/puppet/module_tool/applications/uninstaller.rb +33 -0
  49. data/lib/puppet/module_tool/contents_description.rb +1 -1
  50. data/lib/puppet/network/server.rb +2 -3
  51. data/lib/puppet/node/environment.rb +16 -3
  52. data/lib/puppet/parser/ast/leaf.rb +1 -1
  53. data/lib/puppet/parser/functions/create_resources.rb +1 -1
  54. data/lib/puppet/parser/type_loader.rb +1 -1
  55. data/lib/puppet/property.rb +46 -14
  56. data/lib/puppet/provider.rb +13 -4
  57. data/lib/puppet/provider/augeas/augeas.rb +6 -4
  58. data/lib/puppet/provider/group/pw.rb +24 -10
  59. data/lib/puppet/provider/nameservice/directoryservice.rb +146 -37
  60. data/lib/puppet/provider/package/pip.rb +1 -1
  61. data/lib/puppet/provider/package/yum.rb +1 -2
  62. data/lib/puppet/provider/service/debian.rb +14 -0
  63. data/lib/puppet/provider/service/launchd.rb +1 -1
  64. data/lib/puppet/provider/service/smf.rb +2 -2
  65. data/lib/puppet/provider/user/pw.rb +56 -2
  66. data/lib/puppet/provider/user/user_role_add.rb +32 -22
  67. data/lib/puppet/provider/user/windows_adsi.rb +1 -0
  68. data/lib/puppet/rails/benchmark.rb +1 -1
  69. data/lib/puppet/reports/store.rb +8 -1
  70. data/lib/puppet/resource/catalog.rb +5 -1
  71. data/lib/puppet/simple_graph.rb +11 -14
  72. data/lib/puppet/transaction.rb +10 -4
  73. data/lib/puppet/transaction/report.rb +9 -3
  74. data/lib/puppet/type.rb +19 -7
  75. data/lib/puppet/type/exec.rb +1 -1
  76. data/lib/puppet/type/file.rb +4 -1
  77. data/lib/puppet/type/file/ensure.rb +5 -1
  78. data/lib/puppet/type/file/mode.rb +45 -10
  79. data/lib/puppet/type/file/source.rb +4 -0
  80. data/lib/puppet/type/host.rb +17 -3
  81. data/lib/puppet/type/k5login.rb +3 -2
  82. data/lib/puppet/type/schedule.rb +3 -2
  83. data/lib/puppet/util.rb +83 -27
  84. data/lib/puppet/util/anonymous_filelock.rb +36 -0
  85. data/lib/puppet/util/docs.rb +18 -2
  86. data/lib/puppet/util/instrumentation.rb +173 -0
  87. data/lib/puppet/util/instrumentation/data.rb +34 -0
  88. data/lib/puppet/util/instrumentation/indirection_probe.rb +29 -0
  89. data/lib/puppet/util/instrumentation/instrumentable.rb +143 -0
  90. data/lib/puppet/util/instrumentation/listener.rb +60 -0
  91. data/lib/puppet/util/instrumentation/listeners/log.rb +29 -0
  92. data/lib/puppet/util/instrumentation/listeners/performance.rb +30 -0
  93. data/lib/puppet/util/monkey_patches.rb +8 -0
  94. data/lib/puppet/util/pidlock.rb +21 -25
  95. data/lib/puppet/util/rdoc/parser.rb +2 -2
  96. data/lib/puppet/util/reference.rb +8 -23
  97. data/lib/puppet/util/retryaction.rb +48 -0
  98. data/lib/puppet/util/suidmanager.rb +70 -39
  99. data/lib/puppet/util/symbolic_file_mode.rb +140 -0
  100. data/spec/integration/configurer_spec.rb +5 -0
  101. data/spec/integration/indirector/direct_file_server_spec.rb +1 -1
  102. data/spec/integration/indirector/file_content/file_server_spec.rb +7 -7
  103. data/spec/integration/provider/package_spec.rb +7 -0
  104. data/spec/unit/agent/disabler_spec.rb +60 -0
  105. data/spec/unit/agent/locker_spec.rb +0 -12
  106. data/spec/unit/agent_spec.rb +8 -0
  107. data/spec/unit/application/agent_spec.rb +38 -1
  108. data/spec/unit/application/apply_spec.rb +34 -40
  109. data/spec/unit/application/cert_spec.rb +1 -1
  110. data/spec/unit/application_spec.rb +6 -0
  111. data/spec/unit/configurer/downloader_spec.rb +29 -10
  112. data/spec/unit/configurer/fact_handler_spec.rb +5 -29
  113. data/spec/unit/configurer_spec.rb +8 -8
  114. data/spec/unit/daemon_spec.rb +12 -26
  115. data/spec/unit/face/instrumentation_data.rb +7 -0
  116. data/spec/unit/face/instrumentation_listener.rb +38 -0
  117. data/spec/unit/face/instrumentation_probe.rb +21 -0
  118. data/spec/unit/face/node_spec.rb +111 -111
  119. data/spec/unit/file_serving/content_spec.rb +2 -2
  120. data/spec/unit/indirector/facts/facter_spec.rb +25 -3
  121. data/spec/unit/indirector/facts/inventory_active_record_spec.rb +14 -4
  122. data/spec/unit/indirector/instrumentation_data/local_spec.rb +52 -0
  123. data/spec/unit/indirector/instrumentation_data/rest_spec.rb +11 -0
  124. data/spec/unit/indirector/instrumentation_listener/local_spec.rb +65 -0
  125. data/spec/unit/indirector/instrumentation_listener/rest_spec.rb +11 -0
  126. data/spec/unit/indirector/instrumentation_probe/local_spec.rb +65 -0
  127. data/spec/unit/indirector/instrumentation_probe/rest_spec.rb +11 -0
  128. data/spec/unit/module_spec.rb +39 -125
  129. data/spec/unit/module_tool/uninstaller_spec.rb +44 -0
  130. data/spec/unit/network/server_spec.rb +2 -20
  131. data/spec/unit/node/environment_spec.rb +76 -58
  132. data/spec/unit/parser/ast/asthash_spec.rb +1 -2
  133. data/spec/unit/parser/ast/leaf_spec.rb +16 -0
  134. data/spec/unit/property/keyvalue_spec.rb +5 -2
  135. data/spec/unit/property_spec.rb +260 -159
  136. data/spec/unit/provider/augeas/augeas_spec.rb +2 -2
  137. data/spec/unit/provider/group/pw_spec.rb +81 -0
  138. data/spec/unit/provider/nameservice/directoryservice_spec.rb +102 -0
  139. data/spec/unit/provider/package/pip_spec.rb +7 -0
  140. data/spec/unit/provider/package/yum_spec.rb +45 -1
  141. data/spec/unit/provider/service/debian_spec.rb +15 -0
  142. data/spec/unit/provider/service/launchd_spec.rb +48 -43
  143. data/spec/unit/provider/service/smf_spec.rb +3 -3
  144. data/spec/unit/provider/user/pw_spec.rb +183 -0
  145. data/spec/unit/provider/user/user_role_add_spec.rb +46 -39
  146. data/spec/unit/provider/user/windows_adsi_spec.rb +1 -0
  147. data/spec/unit/provider_spec.rb +32 -0
  148. data/spec/unit/reports/store_spec.rb +19 -1
  149. data/spec/unit/simple_graph_spec.rb +34 -19
  150. data/spec/unit/ssl/certificate_factory_spec.rb +3 -3
  151. data/spec/unit/transaction/report_spec.rb +29 -1
  152. data/spec/unit/transaction_spec.rb +32 -46
  153. data/spec/unit/type/file/mode_spec.rb +1 -1
  154. data/spec/unit/type/file/source_spec.rb +28 -3
  155. data/spec/unit/type/file_spec.rb +17 -16
  156. data/spec/unit/type/host_spec.rb +527 -0
  157. data/spec/unit/type/k5login_spec.rb +115 -0
  158. data/spec/unit/type/schedule_spec.rb +6 -6
  159. data/spec/unit/type_spec.rb +51 -0
  160. data/spec/unit/util/anonymous_filelock_spec.rb +78 -0
  161. data/spec/unit/util/execution_stub_spec.rb +2 -1
  162. data/spec/unit/util/instrumentation/data_spec.rb +44 -0
  163. data/spec/unit/util/instrumentation/indirection_probe_spec.rb +19 -0
  164. data/spec/unit/util/instrumentation/instrumentable_spec.rb +186 -0
  165. data/spec/unit/util/instrumentation/listener_spec.rb +100 -0
  166. data/spec/unit/util/instrumentation/listeners/log_spec.rb +34 -0
  167. data/spec/unit/util/instrumentation/listeners/performance_spec.rb +36 -0
  168. data/spec/unit/util/instrumentation_spec.rb +181 -0
  169. data/spec/unit/util/pidlock_spec.rb +208 -0
  170. data/spec/unit/util/rdoc/parser_spec.rb +1 -1
  171. data/spec/unit/util/reference_spec.rb +16 -6
  172. data/spec/unit/util/retryaction_spec.rb +62 -0
  173. data/spec/unit/util/suidmanager_spec.rb +101 -83
  174. data/spec/unit/util/symbolic_file_mode_spec.rb +182 -0
  175. data/spec/unit/util_spec.rb +126 -0
  176. data/tasks/rake/apple.rake +176 -0
  177. data/tasks/rake/templates/prototype.plist.erb +38 -0
  178. metadata +61 -13
  179. data/lib/puppet/application/module.rb +0 -3
  180. data/lib/puppet/face/module.rb +0 -12
  181. data/spec/unit/face/module/build_spec.rb +0 -30
  182. data/spec/unit/face/module/changes_spec.rb +0 -30
  183. data/spec/unit/face/module/clean_spec.rb +0 -30
  184. data/spec/unit/face/module/generate_spec.rb +0 -30
  185. data/spec/unit/face/module/install_spec.rb +0 -75
  186. data/spec/unit/face/module/search_spec.rb +0 -40
  187. data/test/util/pidlock.rb +0 -126
@@ -5,6 +5,24 @@ require 'spec_helper'
5
5
  describe Puppet::Util do
6
6
  include PuppetSpec::Files
7
7
 
8
+ if Puppet.features.microsoft_windows?
9
+ def set_mode(mode, file)
10
+ Puppet::Util::Windows::Security.set_mode(mode, file)
11
+ end
12
+
13
+ def get_mode(file)
14
+ Puppet::Util::Windows::Security.get_mode(file) & 07777
15
+ end
16
+ else
17
+ def set_mode(mode, file)
18
+ File.chmod(mode, file)
19
+ end
20
+
21
+ def get_mode(file)
22
+ File.lstat(file).mode & 07777
23
+ end
24
+ end
25
+
8
26
  def process_status(exitstatus)
9
27
  return exitstatus if Puppet.features.microsoft_windows?
10
28
 
@@ -560,4 +578,112 @@ describe Puppet::Util do
560
578
  expect { Puppet::Util.binread('/path/does/not/exist') }.to raise_error(Errno::ENOENT)
561
579
  end
562
580
  end
581
+
582
+ context "#replace_file" do
583
+ describe "on POSIX platforms", :if => Puppet.features.posix? do
584
+ subject { Puppet::Util }
585
+ it { should respond_to :replace_file }
586
+
587
+ let :target do
588
+ target = Tempfile.new("puppet-util-replace-file")
589
+ target.puts("hello, world")
590
+ target.flush # make sure content is on disk.
591
+ target.fsync rescue nil
592
+ target.close
593
+ target
594
+ end
595
+
596
+ it "should fail if no block is given" do
597
+ expect { subject.replace_file(target.path, 0600) }.to raise_error /block/
598
+ end
599
+
600
+ it "should replace a file when invoked" do
601
+ # Check that our file has the expected content.
602
+ File.read(target.path).should == "hello, world\n"
603
+
604
+ # Replace the file.
605
+ subject.replace_file(target.path, 0600) do |fh|
606
+ fh.puts "I am the passenger..."
607
+ end
608
+
609
+ # ...and check the replacement was complete.
610
+ File.read(target.path).should == "I am the passenger...\n"
611
+ end
612
+
613
+ [0555, 0600, 0660, 0700, 0770].each do |mode|
614
+ it "should copy 0#{mode.to_s(8)} permissions from the target file by default" do
615
+ set_mode(mode, target.path)
616
+
617
+ get_mode(target.path).should == mode
618
+
619
+ subject.replace_file(target.path, 0000) {|fh| fh.puts "bazam" }
620
+
621
+ get_mode(target.path).should == mode
622
+ File.read(target.path).should == "bazam\n"
623
+ end
624
+ end
625
+
626
+ it "should copy the permissions of the source file before yielding" do
627
+ set_mode(0555, target.path)
628
+ inode = File.stat(target.path).ino unless Puppet.features.microsoft_windows?
629
+
630
+ yielded = false
631
+ subject.replace_file(target.path, 0600) do |fh|
632
+ get_mode(fh.path).should == 0555
633
+ yielded = true
634
+ end
635
+ yielded.should be_true
636
+
637
+ # We can't check inode on Windows
638
+ File.stat(target.path).ino.should_not == inode unless Puppet.features.microsoft_windows?
639
+
640
+ get_mode(target.path).should == 0555
641
+ end
642
+
643
+ it "should use the default permissions if the source file doesn't exist" do
644
+ new_target = target.path + '.foo'
645
+ File.should_not be_exist(new_target)
646
+
647
+ begin
648
+ subject.replace_file(new_target, 0555) {|fh| fh.puts "foo" }
649
+ get_mode(new_target).should == 0555
650
+ ensure
651
+ File.unlink(new_target) if File.exists?(new_target)
652
+ end
653
+ end
654
+
655
+ it "should not replace the file if an exception is thrown in the block" do
656
+ yielded = false
657
+ threw = false
658
+
659
+ begin
660
+ subject.replace_file(target.path, 0600) do |fh|
661
+ yielded = true
662
+ fh.puts "different content written, then..."
663
+ raise "...throw some random failure"
664
+ end
665
+ rescue Exception => e
666
+ if e.to_s =~ /some random failure/
667
+ threw = true
668
+ else
669
+ raise
670
+ end
671
+ end
672
+
673
+ yielded.should be_true
674
+ threw.should be_true
675
+
676
+ # ...and check the replacement was complete.
677
+ File.read(target.path).should == "hello, world\n"
678
+ end
679
+ end
680
+
681
+ describe "on Windows platforms" do
682
+ it "should fail and complain" do
683
+ Puppet.features.stubs(:microsoft_windows?).returns true
684
+
685
+ expect { Puppet::Util.replace_file("C:/foo", 0644) {} }.to raise_error(Puppet::DevError, "replace_file is non-functional on Windows")
686
+ end
687
+ end
688
+ end
563
689
  end
@@ -0,0 +1,176 @@
1
+ # Title: Rake task to build Apple packages for Puppet.
2
+ # Author: Gary Larizza
3
+ # Date: 12/5/2011
4
+ # Description: This task will create a DMG-encapsulated package that will
5
+ # install Puppet on OS X systems. This happens by building
6
+ # a directory tree of files that will then be fed to the
7
+ # packagemaker binary (can be installed by installing the
8
+ # XCode Tools) which will create the .pkg file.
9
+ #
10
+ require 'fileutils'
11
+ require 'erb'
12
+ require 'find'
13
+ require 'pathname'
14
+
15
+ # Path to Binaries (Constants)
16
+ TAR = '/usr/bin/tar'
17
+ CP = '/bin/cp'
18
+ INSTALL = '/usr/bin/install'
19
+ DITTO = '/usr/bin/ditto'
20
+ PACKAGEMAKER = '/Developer/usr/bin/packagemaker'
21
+ SED = '/usr/bin/sed'
22
+
23
+ # Setup task to populate all the variables
24
+ task :setup do
25
+ @version = `git describe`.chomp
26
+ @title = "puppet-#{@version}"
27
+ @reverse_domain = 'com.puppetlabs.puppet'
28
+ @package_major_version = @version.split('.')[0]
29
+ @package_minor_version = @version.split('.')[1] +
30
+ @version.split('.')[2].split('-')[0].split('rc')[0]
31
+ @pm_restart = 'None'
32
+ @build_date = Time.new.strftime("%Y-%m-%dT%H:%M:%SZ")
33
+ end
34
+
35
+ # method: make_directory_tree
36
+ # description: This method sets up the directory structure that packagemaker
37
+ # needs to build a package. A prototype.plist file (holding
38
+ # package-specific options) is built from an ERB template located
39
+ # in the tasks/rake/templates directory.
40
+ def make_directory_tree
41
+ puppet_tmp = '/tmp/puppet'
42
+ @scratch = "#{puppet_tmp}/#{@title}"
43
+ @working_tree = {
44
+ 'scripts' => "#{@scratch}/scripts",
45
+ 'resources' => "#{@scratch}/resources",
46
+ 'working' => "#{@scratch}/root",
47
+ 'payload' => "#{@scratch}/payload",
48
+ }
49
+ puts "Cleaning Tree: #{puppet_tmp}"
50
+ FileUtils.rm_rf(puppet_tmp)
51
+ @working_tree.each do |key,val|
52
+ puts "Creating: #{val}"
53
+ FileUtils.mkdir_p(val)
54
+ end
55
+ File.open("#{@scratch}/#{'prototype.plist'}", "w+") do |f|
56
+ f.write(ERB.new(File.read('tasks/rake/templates/prototype.plist.erb')).result())
57
+ end
58
+ end
59
+
60
+ # method: build_dmg
61
+ # description: This method builds a package from the directory structure in
62
+ # /tmp/puppet and puts it in the
63
+ # /tmp/puppet/puppet-#{version}/payload directory. A DMG is
64
+ # created, using hdiutil, based on the contents of the
65
+ # /tmp/puppet/puppet-#{version}/payload directory. The resultant
66
+ # DMG is placed in the pkg/apple directory.
67
+ #
68
+ def build_dmg
69
+ # Local Variables
70
+ dmg_format_code = 'UDZO'
71
+ zlib_level = '9'
72
+ dmg_format_option = "-imagekey zlib-level=#{zlib_level}"
73
+ dmg_format = "#{dmg_format_code} #{dmg_format_option}"
74
+ dmg_file = "#{@title}.dmg"
75
+ package_file = "#{@title}.pkg"
76
+ pm_extra_args = '--verbose --no-recommend --no-relocate'
77
+ package_target_os = '10.4'
78
+
79
+ # Build .pkg file
80
+ system("sudo #{PACKAGEMAKER} --root #{@working_tree['working']} \
81
+ --id #{@reverse_domain} \
82
+ --filter DS_Store \
83
+ --target #{package_target_os} \
84
+ --title #{@title} \
85
+ --info #{@scratch}/prototype.plist \
86
+ --scripts #{@working_tree['scripts']} \
87
+ --resources #{@working_tree['resources']} \
88
+ --version #{@version} \
89
+ #{pm_extra_args} --out #{@working_tree['payload']}/#{package_file}")
90
+
91
+ # Build .dmg file
92
+ system("sudo hdiutil create -volname #{@title} \
93
+ -srcfolder #{@working_tree['payload']} \
94
+ -uid 99 \
95
+ -gid 99 \
96
+ -ov \
97
+ -format #{dmg_format} \
98
+ #{dmg_file}")
99
+
100
+ if File.directory?("#{Pathname.pwd}/pkg/apple")
101
+ FileUtils.mv("#{Pathname.pwd}/#{dmg_file}", "#{Pathname.pwd}/pkg/apple/#{dmg_file}")
102
+ puts "moved: #{dmg_file} has been moved to #{Pathname.pwd}/pkg/apple/#{dmg_file}"
103
+ else
104
+ FileUtils.mkdir_p("#{Pathname.pwd}/pkg/apple")
105
+ FileUtils.mv(dmg_file, "#{Pathname.pwd}/pkg/apple/#{dmg_file}")
106
+ puts "moved: #{dmg_file} has been moved to #{Pathname.pwd}/pkg/apple/#{dmg_file}"
107
+ end
108
+ end
109
+
110
+ # method: pack_puppet_source
111
+ # description: This method copies the puppet source into a directory
112
+ # structure in /tmp/puppet/puppet-#{version}/root mirroring the
113
+ # structure on the target system for which the package will be
114
+ # installed. Anything installed into /tmp/puppet/root will be
115
+ # installed as the package's payload.
116
+ #
117
+ def pack_puppet_source
118
+ work = "#{@working_tree['working']}"
119
+ puppet_source = Pathname.pwd
120
+
121
+ # Make all necessary directories
122
+ directories = ["#{work}/private/etc/puppet/",
123
+ "#{work}/usr/bin",
124
+ "#{work}/usr/sbin",
125
+ "#{work}/usr/share/doc/puppet",
126
+ "#{work}/usr/share/man/man5",
127
+ "#{work}/usr/share/man/man8",
128
+ "#{work}/usr/lib/ruby/site_ruby/1.8/puppet"]
129
+ FileUtils.mkdir_p(directories)
130
+
131
+ # Install necessary files
132
+ system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/conf/auth.conf #{work}/private/etc/puppet/auth.conf")
133
+ system("#{DITTO} #{puppet_source}/bin/ #{work}/usr/bin")
134
+ system("#{DITTO} #{puppet_source}/sbin/ #{work}/usr/sbin")
135
+ system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/man/man5/puppet.conf.5 #{work}/usr/share/man/man5/")
136
+ system("#{DITTO} #{puppet_source}/man/man8/ #{work}/usr/share/man/man8")
137
+ system("#{DITTO} #{puppet_source}/lib/ #{work}/usr/lib/ruby/site_ruby/1.8/")
138
+
139
+ # Setup a preflight script and replace variables in the files with
140
+ # the correct paths.
141
+ system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/conf/osx/preflight #{@working_tree['scripts']}")
142
+ system("#{SED} -i '' \"s\#{SITELIBDIR}\#/usr/lib/ruby/site_ruby/1.8\#g\" #{@working_tree['scripts']}/preflight")
143
+ system("#{SED} -i '' \"s\#{BINDIR}\#/usr/bin\#g\" #{@working_tree['scripts']}/preflight")
144
+
145
+ # Install documentation (matching for files with capital letters)
146
+ Dir.foreach("#{puppet_source}") do |file|
147
+ system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/#{file} #{work}/usr/share/doc/puppet") if file =~ /^[A-Z][A-Z]/
148
+ end
149
+
150
+ # Set Permissions
151
+ executable_directories = [ "#{work}/usr/bin",
152
+ "#{work}/usr/sbin",
153
+ "#{work}/usr/share/man/man8"]
154
+ FileUtils.chmod_R(0755, executable_directories)
155
+ FileUtils.chown_R('root', 'wheel', directories)
156
+ FileUtils.chmod_R(0644, "#{work}/usr/lib/ruby/site_ruby/1.8/")
157
+ FileUtils.chown_R('root', 'wheel', "#{work}/usr/lib/ruby/site_ruby/1.8/")
158
+ Find.find("#{work}/usr/lib/ruby/site_ruby/1.8/") do |dir|
159
+ FileUtils.chmod(0755, dir) if File.directory?(dir)
160
+ end
161
+ end
162
+
163
+ namespace :package do
164
+ desc "Task for building an Apple Package"
165
+ task :apple => [:setup] do
166
+ # Test for Root and Packagemaker binary
167
+ raise "Please run rake as root to build Apple Packages" unless Process.uid == 0
168
+ raise "Packagemaker must be installed. Please install XCode Tools" unless \
169
+ File.exists?('/Developer/usr/bin/packagemaker')
170
+
171
+ make_directory_tree
172
+ pack_puppet_source
173
+ build_dmg
174
+ FileUtils.chmod_R(0775, "#{Pathname.pwd}/pkg")
175
+ end
176
+ end
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleIdentifier</key>
6
+ <string><%= @title %></string>
7
+ <key>CFBundleShortVersionString</key>
8
+ <string><%= @version %></string>
9
+ <key>IFMajorVersion</key>
10
+ <integer><%= @package_major_version %></integer>
11
+ <key>IFMinorVersion</key>
12
+ <integer><%= @package_minor_version %></integer>
13
+ <key>IFPkgBuildDate</key>
14
+ <date><%= @build_date %></date>
15
+ <key>IFPkgFlagAllowBackRev</key>
16
+ <false/>
17
+ <key>IFPkgFlagAuthorizationAction</key>
18
+ <string>RootAuthorization</string>
19
+ <key>IFPkgFlagDefaultLocation</key>
20
+ <string>/</string>
21
+ <key>IFPkgFlagFollowLinks</key>
22
+ <true/>
23
+ <key>IFPkgFlagInstallFat</key>
24
+ <false/>
25
+ <key>IFPkgFlagIsRequired</key>
26
+ <false/>
27
+ <key>IFPkgFlagOverwritePermissions</key>
28
+ <false/>
29
+ <key>IFPkgFlagRelocatable</key>
30
+ <false/>
31
+ <key>IFPkgFlagRestartAction</key>
32
+ <string><%= @pm_restart %></string>
33
+ <key>IFPkgFlagRootVolumeOnly</key>
34
+ <true/>
35
+ <key>IFPkgFlagUpdateInstalledLanguages</key>
36
+ <false/>
37
+ </dict>
38
+ </plist>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 7
9
- - 9
10
- version: 2.7.9
9
+ - 11
10
+ version: 2.7.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Puppet Labs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-10 00:00:00 Z
18
+ date: 2012-02-23 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: facter
@@ -63,6 +63,7 @@ files:
63
63
  - bin/puppet
64
64
  - bin/puppetdoc
65
65
  - bin/ralsh
66
+ - lib/puppet/agent/disabler.rb
66
67
  - lib/puppet/agent/locker.rb
67
68
  - lib/puppet/agent.rb
68
69
  - lib/puppet/application/agent.rb
@@ -84,11 +85,13 @@ files:
84
85
  - lib/puppet/application/help.rb
85
86
  - lib/puppet/application/indirection_base.rb
86
87
  - lib/puppet/application/inspect.rb
88
+ - lib/puppet/application/instrumentation_data.rb
89
+ - lib/puppet/application/instrumentation_listener.rb
90
+ - lib/puppet/application/instrumentation_probe.rb
87
91
  - lib/puppet/application/key.rb
88
92
  - lib/puppet/application/kick.rb
89
93
  - lib/puppet/application/man.rb
90
94
  - lib/puppet/application/master.rb
91
- - lib/puppet/application/module.rb
92
95
  - lib/puppet/application/node.rb
93
96
  - lib/puppet/application/parser.rb
94
97
  - lib/puppet/application/plugin.rb
@@ -142,6 +145,9 @@ files:
142
145
  - lib/puppet/face/help/global.erb
143
146
  - lib/puppet/face/help/man.erb
144
147
  - lib/puppet/face/help.rb
148
+ - lib/puppet/face/instrumentation_data.rb
149
+ - lib/puppet/face/instrumentation_listener.rb
150
+ - lib/puppet/face/instrumentation_probe.rb
145
151
  - lib/puppet/face/key.rb
146
152
  - lib/puppet/face/man.rb
147
153
  - lib/puppet/face/module/build.rb
@@ -149,8 +155,9 @@ files:
149
155
  - lib/puppet/face/module/clean.rb
150
156
  - lib/puppet/face/module/generate.rb
151
157
  - lib/puppet/face/module/install.rb
158
+ - lib/puppet/face/module/list.rb
152
159
  - lib/puppet/face/module/search.rb
153
- - lib/puppet/face/module.rb
160
+ - lib/puppet/face/module/uninstall.rb
154
161
  - lib/puppet/face/node/clean.rb
155
162
  - lib/puppet/face/node.rb
156
163
  - lib/puppet/face/parser.rb
@@ -237,6 +244,15 @@ files:
237
244
  - lib/puppet/indirector/file_metadata.rb
238
245
  - lib/puppet/indirector/file_server.rb
239
246
  - lib/puppet/indirector/indirection.rb
247
+ - lib/puppet/indirector/instrumentation_data/local.rb
248
+ - lib/puppet/indirector/instrumentation_data/rest.rb
249
+ - lib/puppet/indirector/instrumentation_data.rb
250
+ - lib/puppet/indirector/instrumentation_listener/local.rb
251
+ - lib/puppet/indirector/instrumentation_listener/rest.rb
252
+ - lib/puppet/indirector/instrumentation_listener.rb
253
+ - lib/puppet/indirector/instrumentation_probe/local.rb
254
+ - lib/puppet/indirector/instrumentation_probe/rest.rb
255
+ - lib/puppet/indirector/instrumentation_probe.rb
240
256
  - lib/puppet/indirector/inventory/yaml.rb
241
257
  - lib/puppet/indirector/key/ca.rb
242
258
  - lib/puppet/indirector/key/file.rb
@@ -292,6 +308,7 @@ files:
292
308
  - lib/puppet/module_tool/applications/generator.rb
293
309
  - lib/puppet/module_tool/applications/installer.rb
294
310
  - lib/puppet/module_tool/applications/searcher.rb
311
+ - lib/puppet/module_tool/applications/uninstaller.rb
295
312
  - lib/puppet/module_tool/applications/unpacker.rb
296
313
  - lib/puppet/module_tool/applications.rb
297
314
  - lib/puppet/module_tool/cache.rb
@@ -672,6 +689,7 @@ files:
672
689
  - lib/puppet/type/zpool.rb
673
690
  - lib/puppet/type.rb
674
691
  - lib/puppet/util/adsi.rb
692
+ - lib/puppet/util/anonymous_filelock.rb
675
693
  - lib/puppet/util/autoload/file_cache.rb
676
694
  - lib/puppet/util/autoload.rb
677
695
  - lib/puppet/util/backups.rb
@@ -693,6 +711,13 @@ files:
693
711
  - lib/puppet/util/inifile.rb
694
712
  - lib/puppet/util/inline_docs.rb
695
713
  - lib/puppet/util/instance_loader.rb
714
+ - lib/puppet/util/instrumentation/data.rb
715
+ - lib/puppet/util/instrumentation/indirection_probe.rb
716
+ - lib/puppet/util/instrumentation/instrumentable.rb
717
+ - lib/puppet/util/instrumentation/listener.rb
718
+ - lib/puppet/util/instrumentation/listeners/log.rb
719
+ - lib/puppet/util/instrumentation/listeners/performance.rb
720
+ - lib/puppet/util/instrumentation.rb
696
721
  - lib/puppet/util/ldap/connection.rb
697
722
  - lib/puppet/util/ldap/generator.rb
698
723
  - lib/puppet/util/ldap/manager.rb
@@ -738,6 +763,7 @@ files:
738
763
  - lib/puppet/util/rdoc.rb
739
764
  - lib/puppet/util/reference.rb
740
765
  - lib/puppet/util/resource_template.rb
766
+ - lib/puppet/util/retryaction.rb
741
767
  - lib/puppet/util/run_mode.rb
742
768
  - lib/puppet/util/selinux.rb
743
769
  - lib/puppet/util/settings/boolean_setting.rb
@@ -747,6 +773,7 @@ files:
747
773
  - lib/puppet/util/storage.rb
748
774
  - lib/puppet/util/subclass_loader.rb
749
775
  - lib/puppet/util/suidmanager.rb
776
+ - lib/puppet/util/symbolic_file_mode.rb
750
777
  - lib/puppet/util/tagging.rb
751
778
  - lib/puppet/util/user_attr.rb
752
779
  - lib/puppet/util/warnings.rb
@@ -879,6 +906,7 @@ files:
879
906
  - ext/emacs/puppet-mode-init.el
880
907
  - ext/emacs/puppet-mode.el
881
908
  - ext/envpuppet
909
+ - ext/envpuppet.bat
882
910
  - ext/ldap/puppet.schema
883
911
  - ext/logcheck/puppet
884
912
  - ext/nagios/check_puppet.rb
@@ -905,6 +933,7 @@ files:
905
933
  - ext/vim/README
906
934
  - ext/vim/syntax/puppet.vim
907
935
  - ext/yaml_nodes.rb
936
+ - tasks/rake/apple.rake
908
937
  - tasks/rake/changelog.rake
909
938
  - tasks/rake/ci.rake
910
939
  - tasks/rake/dailybuild.rake
@@ -913,6 +942,7 @@ files:
913
942
  - tasks/rake/manpages.rake
914
943
  - tasks/rake/metrics.rake
915
944
  - tasks/rake/sign.rake
945
+ - tasks/rake/templates/prototype.plist.erb
916
946
  - tasks/rake/testbranch.rake
917
947
  - tasks/rake/yard.rake
918
948
  - test/data/failers/badclassnoparam
@@ -1097,7 +1127,6 @@ files:
1097
1127
  - test/util/log.rb
1098
1128
  - test/util/metrics.rb
1099
1129
  - test/util/package.rb
1100
- - test/util/pidlock.rb
1101
1130
  - test/util/settings.rb
1102
1131
  - test/util/storage.rb
1103
1132
  - test/util/subclass_loader.rb
@@ -1271,6 +1300,7 @@ files:
1271
1300
  - spec/shared_behaviours/things_that_declare_options.rb
1272
1301
  - spec/spec.opts
1273
1302
  - spec/spec_helper.rb
1303
+ - spec/unit/agent/disabler_spec.rb
1274
1304
  - spec/unit/agent/locker_spec.rb
1275
1305
  - spec/unit/agent_spec.rb
1276
1306
  - spec/unit/application/agent_spec.rb
@@ -1308,13 +1338,10 @@ files:
1308
1338
  - spec/unit/face/facts_spec.rb
1309
1339
  - spec/unit/face/file_spec.rb
1310
1340
  - spec/unit/face/help_spec.rb
1341
+ - spec/unit/face/instrumentation_data.rb
1342
+ - spec/unit/face/instrumentation_listener.rb
1343
+ - spec/unit/face/instrumentation_probe.rb
1311
1344
  - spec/unit/face/key_spec.rb
1312
- - spec/unit/face/module/build_spec.rb
1313
- - spec/unit/face/module/changes_spec.rb
1314
- - spec/unit/face/module/clean_spec.rb
1315
- - spec/unit/face/module/generate_spec.rb
1316
- - spec/unit/face/module/install_spec.rb
1317
- - spec/unit/face/module/search_spec.rb
1318
1345
  - spec/unit/face/module_spec.rb
1319
1346
  - spec/unit/face/node_spec.rb
1320
1347
  - spec/unit/face/plugin_spec.rb
@@ -1381,6 +1408,12 @@ files:
1381
1408
  - spec/unit/indirector/file_metadata/rest_spec.rb
1382
1409
  - spec/unit/indirector/file_server_spec.rb
1383
1410
  - spec/unit/indirector/indirection_spec.rb
1411
+ - spec/unit/indirector/instrumentation_data/local_spec.rb
1412
+ - spec/unit/indirector/instrumentation_data/rest_spec.rb
1413
+ - spec/unit/indirector/instrumentation_listener/local_spec.rb
1414
+ - spec/unit/indirector/instrumentation_listener/rest_spec.rb
1415
+ - spec/unit/indirector/instrumentation_probe/local_spec.rb
1416
+ - spec/unit/indirector/instrumentation_probe/rest_spec.rb
1384
1417
  - spec/unit/indirector/inventory/yaml_spec.rb
1385
1418
  - spec/unit/indirector/key/ca_spec.rb
1386
1419
  - spec/unit/indirector/key/file_spec.rb
@@ -1427,6 +1460,7 @@ files:
1427
1460
  - spec/unit/module_tool/application_spec.rb
1428
1461
  - spec/unit/module_tool/metadata_spec.rb
1429
1462
  - spec/unit/module_tool/repository_spec.rb
1463
+ - spec/unit/module_tool/uninstaller_spec.rb
1430
1464
  - spec/unit/module_tool_spec.rb
1431
1465
  - spec/unit/network/authconfig_spec.rb
1432
1466
  - spec/unit/network/authstore_spec.rb
@@ -1538,6 +1572,7 @@ files:
1538
1572
  - spec/unit/provider/file/windows_spec.rb
1539
1573
  - spec/unit/provider/group/groupadd_spec.rb
1540
1574
  - spec/unit/provider/group/ldap_spec.rb
1575
+ - spec/unit/provider/group/pw_spec.rb
1541
1576
  - spec/unit/provider/group/windows_adsi_spec.rb
1542
1577
  - spec/unit/provider/host/parsed_spec.rb
1543
1578
  - spec/unit/provider/interface/cisco_spec.rb
@@ -1586,6 +1621,7 @@ files:
1586
1621
  - spec/unit/provider/sshkey/parsed_spec.rb
1587
1622
  - spec/unit/provider/user/hpux_spec.rb
1588
1623
  - spec/unit/provider/user/ldap_spec.rb
1624
+ - spec/unit/provider/user/pw_spec.rb
1589
1625
  - spec/unit/provider/user/user_role_add_spec.rb
1590
1626
  - spec/unit/provider/user/useradd_spec.rb
1591
1627
  - spec/unit/provider/user/windows_adsi_spec.rb
@@ -1655,6 +1691,7 @@ files:
1655
1691
  - spec/unit/type/group_spec.rb
1656
1692
  - spec/unit/type/host_spec.rb
1657
1693
  - spec/unit/type/interface_spec.rb
1694
+ - spec/unit/type/k5login_spec.rb
1658
1695
  - spec/unit/type/macauthorization_spec.rb
1659
1696
  - spec/unit/type/maillist_spec.rb
1660
1697
  - spec/unit/type/mcx_spec.rb
@@ -1680,6 +1717,7 @@ files:
1680
1717
  - spec/unit/type/zpool_spec.rb
1681
1718
  - spec/unit/type_spec.rb
1682
1719
  - spec/unit/util/adsi_spec.rb
1720
+ - spec/unit/util/anonymous_filelock_spec.rb
1683
1721
  - spec/unit/util/autoload/file_cache_spec.rb
1684
1722
  - spec/unit/util/autoload_spec.rb
1685
1723
  - spec/unit/util/backups_spec.rb
@@ -1695,6 +1733,13 @@ files:
1695
1733
  - spec/unit/util/file_locking_spec.rb
1696
1734
  - spec/unit/util/filetype_spec.rb
1697
1735
  - spec/unit/util/inline_docs_spec.rb
1736
+ - spec/unit/util/instrumentation/data_spec.rb
1737
+ - spec/unit/util/instrumentation/indirection_probe_spec.rb
1738
+ - spec/unit/util/instrumentation/instrumentable_spec.rb
1739
+ - spec/unit/util/instrumentation/listener_spec.rb
1740
+ - spec/unit/util/instrumentation/listeners/log_spec.rb
1741
+ - spec/unit/util/instrumentation/listeners/performance_spec.rb
1742
+ - spec/unit/util/instrumentation_spec.rb
1698
1743
  - spec/unit/util/ldap/connection_spec.rb
1699
1744
  - spec/unit/util/ldap/generator_spec.rb
1700
1745
  - spec/unit/util/ldap/manager_spec.rb
@@ -1715,6 +1760,7 @@ files:
1715
1760
  - spec/unit/util/network_device/transport/telnet_spec.rb
1716
1761
  - spec/unit/util/network_device_spec.rb
1717
1762
  - spec/unit/util/package_spec.rb
1763
+ - spec/unit/util/pidlock_spec.rb
1718
1764
  - spec/unit/util/posix_spec.rb
1719
1765
  - spec/unit/util/pson_spec.rb
1720
1766
  - spec/unit/util/queue/stomp_spec.rb
@@ -1724,12 +1770,14 @@ files:
1724
1770
  - spec/unit/util/reference_serializer_spec.rb
1725
1771
  - spec/unit/util/reference_spec.rb
1726
1772
  - spec/unit/util/resource_template_spec.rb
1773
+ - spec/unit/util/retryaction_spec.rb
1727
1774
  - spec/unit/util/run_mode_spec.rb
1728
1775
  - spec/unit/util/selinux_spec.rb
1729
1776
  - spec/unit/util/settings/file_setting_spec.rb
1730
1777
  - spec/unit/util/settings_spec.rb
1731
1778
  - spec/unit/util/storage_spec.rb
1732
1779
  - spec/unit/util/suidmanager_spec.rb
1780
+ - spec/unit/util/symbolic_file_mode_spec.rb
1733
1781
  - spec/unit/util/tagging_spec.rb
1734
1782
  - spec/unit/util/user_attr_spec.rb
1735
1783
  - spec/unit/util/warnings_spec.rb