puppet 5.5.18 → 5.5.19

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -11
  3. data/lib/puppet.rb +5 -2
  4. data/lib/puppet/application/filebucket.rb +13 -0
  5. data/lib/puppet/defaults.rb +60 -33
  6. data/lib/puppet/indirector/catalog/compiler.rb +8 -0
  7. data/lib/puppet/network/http/connection.rb +4 -0
  8. data/lib/puppet/network/http/pool.rb +5 -1
  9. data/lib/puppet/pops/evaluator/access_operator.rb +2 -2
  10. data/lib/puppet/pops/evaluator/evaluator_impl.rb +1 -1
  11. data/lib/puppet/pops/types/type_calculator.rb +24 -0
  12. data/lib/puppet/provider/group/groupadd.rb +19 -19
  13. data/lib/puppet/provider/mailalias/aliases.rb +1 -1
  14. data/lib/puppet/provider/package/apt.rb +14 -3
  15. data/lib/puppet/provider/package/dnfmodule.rb +9 -2
  16. data/lib/puppet/provider/package/dpkg.rb +13 -6
  17. data/lib/puppet/provider/package/fink.rb +20 -3
  18. data/lib/puppet/provider/package/openbsd.rb +13 -1
  19. data/lib/puppet/provider/package/pkg.rb +18 -5
  20. data/lib/puppet/provider/package/yum.rb +9 -5
  21. data/lib/puppet/provider/user/directoryservice.rb +30 -5
  22. data/lib/puppet/provider/user/useradd.rb +5 -6
  23. data/lib/puppet/ssl/certificate.rb +2 -1
  24. data/lib/puppet/ssl/certificate_authority.rb +6 -5
  25. data/lib/puppet/test/test_helper.rb +7 -0
  26. data/lib/puppet/transaction/resource_harness.rb +1 -1
  27. data/lib/puppet/type/file.rb +13 -0
  28. data/lib/puppet/type/package.rb +63 -9
  29. data/lib/puppet/util/plist.rb +6 -0
  30. data/lib/puppet/version.rb +1 -1
  31. data/locales/puppet.pot +100 -92
  32. data/man/man5/puppet.conf.5 +12 -6
  33. data/man/man8/puppet-agent.8 +1 -1
  34. data/man/man8/puppet-apply.8 +1 -1
  35. data/man/man8/puppet-ca.8 +1 -1
  36. data/man/man8/puppet-catalog.8 +1 -1
  37. data/man/man8/puppet-cert.8 +1 -1
  38. data/man/man8/puppet-certificate.8 +1 -1
  39. data/man/man8/puppet-certificate_request.8 +1 -1
  40. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  41. data/man/man8/puppet-config.8 +1 -1
  42. data/man/man8/puppet-describe.8 +1 -1
  43. data/man/man8/puppet-device.8 +1 -1
  44. data/man/man8/puppet-doc.8 +1 -1
  45. data/man/man8/puppet-epp.8 +1 -1
  46. data/man/man8/puppet-facts.8 +1 -1
  47. data/man/man8/puppet-filebucket.8 +16 -1
  48. data/man/man8/puppet-generate.8 +1 -1
  49. data/man/man8/puppet-help.8 +1 -1
  50. data/man/man8/puppet-key.8 +1 -1
  51. data/man/man8/puppet-lookup.8 +1 -1
  52. data/man/man8/puppet-man.8 +1 -1
  53. data/man/man8/puppet-master.8 +1 -1
  54. data/man/man8/puppet-module.8 +1 -1
  55. data/man/man8/puppet-node.8 +1 -1
  56. data/man/man8/puppet-parser.8 +1 -1
  57. data/man/man8/puppet-plugin.8 +1 -1
  58. data/man/man8/puppet-report.8 +1 -1
  59. data/man/man8/puppet-resource.8 +1 -1
  60. data/man/man8/puppet-script.8 +1 -1
  61. data/man/man8/puppet-status.8 +1 -1
  62. data/man/man8/puppet.8 +2 -2
  63. data/spec/fixtures/integration/provider/mailalias/aliases/test1 +1 -0
  64. data/spec/integration/indirector/facts/facter_spec.rb +4 -0
  65. data/spec/unit/application/apply_spec.rb +2 -12
  66. data/spec/unit/configurer/fact_handler_spec.rb +0 -4
  67. data/spec/unit/configurer_spec.rb +0 -3
  68. data/spec/unit/indirector/catalog/compiler_spec.rb +45 -26
  69. data/spec/unit/network/http/connection_spec.rb +17 -1
  70. data/spec/unit/network/http/pool_spec.rb +32 -0
  71. data/spec/unit/node_spec.rb +7 -4
  72. data/spec/unit/provider/group/groupadd_spec.rb +30 -1
  73. data/spec/unit/provider/package/apt_spec.rb +13 -2
  74. data/spec/unit/provider/package/aptitude_spec.rb +1 -0
  75. data/spec/unit/provider/package/dnfmodule_spec.rb +22 -0
  76. data/spec/unit/provider/package/dpkg_spec.rb +20 -4
  77. data/spec/unit/provider/package/openbsd_spec.rb +17 -0
  78. data/spec/unit/provider/package/pkg_spec.rb +13 -1
  79. data/spec/unit/provider/package/yum_spec.rb +50 -0
  80. data/spec/unit/provider/user/directoryservice_spec.rb +41 -0
  81. data/spec/unit/provider/user/useradd_spec.rb +7 -2
  82. data/spec/unit/puppet_pal_2pec.rb +3 -0
  83. data/spec/unit/ssl/certificate_authority_spec.rb +2 -3
  84. data/spec/unit/ssl/certificate_spec.rb +7 -0
  85. data/spec/unit/type/package_spec.rb +8 -0
  86. data/spec/unit/util/plist_spec.rb +20 -0
  87. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5da9776238650bcca14252d209b7f8ba7314e78d0690754a21398db41f795429
4
- data.tar.gz: 1d1fb0ad2f7eba9d2c4ae353cf8140f6f60a8729b6af41c041a26334a7bd5876
3
+ metadata.gz: bc5413f27883bf1004eafe8d43015210b2dfeef6e7e6b78695cdb7f7f24506d1
4
+ data.tar.gz: a8e612c05fe679ecb35c885b12df8df7d9b8e777682660ce05673b5144ca0940
5
5
  SHA512:
6
- metadata.gz: be59c9d47d620b4967c8dc4652b55ee58b5ebe5b0d9363d4e7a8f5261120d8b1a32b7c25a9f6e5ed0a91571067d6b5c16d5d0970b57813b857305c41b001b574
7
- data.tar.gz: 923e8cb7a475b6a7b47d5b3d33458b55d7cafbd70d7da0003c7bbdac4eb7158685d34f5ec2d4e1f4a933105af451c847cb7a11f2c231cb83c7019b6f7784f56d
6
+ metadata.gz: 2a7b1fd9165e74a56765588b67c761f794a11df9727c82ae64859dbadf03ad49234302d4fe1f28a8b5aeae0ec391d24ffa81f33bf70ae547d1961169200702ff
7
+ data.tar.gz: 9e29ab6bb368bcc7fdcd7ef40316935cc9f5a6af24496139d1d59f6a416cdad5a5cf40b4f5842285a3416735def2e16af9254b5445ca9cfeecd12fbcaba151b4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puppet (5.5.18)
4
+ puppet (5.5.19)
5
5
  CFPropertyList (~> 2.2)
6
6
  facter (>= 2.4.0, < 4)
7
7
  fast_gettext (~> 1.1.2)
@@ -25,7 +25,7 @@ GEM
25
25
  csv (3.1.2)
26
26
  diff-lcs (1.3)
27
27
  docopt (0.6.1)
28
- facter (2.5.6)
28
+ facter (2.5.7)
29
29
  fast_gettext (1.1.2)
30
30
  gettext (3.2.9)
31
31
  locale (>= 2.0.5)
@@ -36,7 +36,7 @@ GEM
36
36
  locale
37
37
  hashdiff (0.3.8)
38
38
  hiera (3.6.0)
39
- hiera-eyaml (3.1.1)
39
+ hiera-eyaml (3.2.0)
40
40
  highline (~> 1.6.19)
41
41
  optimist
42
42
  highline (1.6.21)
@@ -44,21 +44,21 @@ GEM
44
44
  hpricot (0.8.6)
45
45
  json-schema (2.8.1)
46
46
  addressable (>= 2.4)
47
- locale (2.1.2)
47
+ locale (2.1.3)
48
48
  memory_profiler (0.9.14)
49
49
  method_source (0.9.2)
50
50
  mocha (1.11.2)
51
- msgpack (1.3.1)
51
+ msgpack (1.3.3)
52
52
  multi_json (1.14.1)
53
53
  mustache (1.1.1)
54
54
  net-ssh (4.2.0)
55
55
  optimist (3.0.0)
56
- packaging (0.99.52)
56
+ packaging (0.99.58)
57
57
  artifactory (~> 2)
58
58
  rake (>= 12.3)
59
59
  release-metrics
60
60
  parallel (1.19.1)
61
- parser (2.7.0.2)
61
+ parser (2.7.0.4)
62
62
  ast (~> 2.4.0)
63
63
  pathspec (0.2.1)
64
64
  powerpack (0.1.2)
@@ -66,7 +66,8 @@ GEM
66
66
  coderay (~> 1.1.0)
67
67
  method_source (~> 0.9.0)
68
68
  puppet-lint (2.4.2)
69
- puppet-syntax (2.6.0)
69
+ puppet-syntax (2.6.1)
70
+ puppet (>= 5)
70
71
  rake
71
72
  puppetlabs_spec_helper (2.14.1)
72
73
  mocha (~> 1.0)
@@ -75,7 +76,7 @@ GEM
75
76
  puppet-syntax (~> 2.0)
76
77
  rspec-puppet (~> 2.0)
77
78
  racc (1.4.9)
78
- rack (1.6.12)
79
+ rack (1.6.13)
79
80
  rainbow (2.1.0)
80
81
  rake (12.3.3)
81
82
  rdiscount (2.2.0.1)
@@ -119,11 +120,11 @@ GEM
119
120
  unicode-display_width (~> 1.0, >= 1.0.1)
120
121
  rubocop-i18n (1.2.0)
121
122
  rubocop (~> 0.49.0)
122
- ruby-prof (1.1.0)
123
+ ruby-prof (1.3.0)
123
124
  ruby-progressbar (1.10.1)
124
125
  safe_yaml (1.0.5)
125
126
  text (1.3.1)
126
- unicode-display_width (1.6.0)
127
+ unicode-display_width (1.6.1)
127
128
  vcr (2.9.3)
128
129
  webmock (1.24.6)
129
130
  addressable (>= 2.3.6)
@@ -22,6 +22,7 @@ require 'puppet/external/pson/common'
22
22
  require 'puppet/external/pson/version'
23
23
  require 'puppet/external/pson/pure'
24
24
  require 'puppet/gettext/config'
25
+ require 'puppet/defaults'
25
26
 
26
27
 
27
28
  #------------------------------------------------------------
@@ -87,6 +88,7 @@ module Puppet
87
88
 
88
89
  # Store a new default value.
89
90
  def self.define_settings(section, hash)
91
+ Puppet.deprecation_warning('The method Puppet.define_settings is deprecated and will be removed in a future release')
90
92
  @@settings.define_settings(section, hash)
91
93
  end
92
94
 
@@ -121,8 +123,9 @@ module Puppet
121
123
  Puppet::Util::RunMode[@@settings.preferred_run_mode]
122
124
  end
123
125
 
124
- # Load all of the settings.
125
- require 'puppet/defaults'
126
+ # Modify the settings with defaults defined in `initialize_default_settings` method in puppet/defaults.rb. This can
127
+ # be used in the initialization of new Puppet::Settings objects in the puppetserver project.
128
+ Puppet.initialize_default_settings!(settings)
126
129
 
127
130
  # Now that settings are loaded we have the code loaded to be able to issue
128
131
  # deprecation warnings. Warn if we're on a deprecated ruby version.
@@ -69,6 +69,19 @@ running as a user with valid Puppet certificates. Alternatively, you can
69
69
  use your local file bucket by specifying '--local', or by specifying
70
70
  '--bucket' with a local path.
71
71
 
72
+ > **Note**: Enabling and using the backup option, and by extension the
73
+ filebucket resource, requires appropriate planning and management to ensure
74
+ that sufficient disk space is available for the file backups. Generally, you
75
+ can implement this using one of the following two options:
76
+ - Use a `find` command and `crontab` entry to retain only the last X days
77
+ of file backups. For example:
78
+
79
+ ```shell
80
+ find /opt/puppetlabs/server/data/puppetserver/bucket -type f -mtime +45 -atime +45 -print0 | xargs -0 rm
81
+ ```
82
+
83
+ - Restrict the directory to a maximum size after which the oldest items are removed.
84
+
72
85
 
73
86
  OPTIONS
74
87
  -------
@@ -39,7 +39,11 @@ module Puppet
39
39
 
40
40
  AS_DURATION = %q{This setting can be a time interval in seconds (30 or 30s), minutes (30m), hours (6h), days (2d), or years (5y).}
41
41
 
42
- define_settings(:main,
42
+ # @api public
43
+ # @param args [Puppet::Settings] the settings object to define default settings for
44
+ # @return void
45
+ def self.initialize_default_settings!(settings)
46
+ settings.define_settings(:main,
43
47
  :confdir => {
44
48
  :default => nil,
45
49
  :type => :directory,
@@ -76,7 +80,7 @@ module Puppet
76
80
  }
77
81
  )
78
82
 
79
- define_settings(:main,
83
+ settings.define_settings(:main,
80
84
  :logdir => {
81
85
  :default => nil,
82
86
  :type => :directory,
@@ -167,7 +171,7 @@ module Puppet
167
171
  }
168
172
  )
169
173
 
170
- define_settings(:main,
174
+ settings.define_settings(:main,
171
175
  :priority => {
172
176
  :default => nil,
173
177
  :type => :priority,
@@ -488,12 +492,12 @@ module Puppet
488
492
  :hiera_config => {
489
493
  :default => lambda do
490
494
  config = nil
491
- codedir = Puppet.settings[:codedir]
495
+ codedir = settings[:codedir]
492
496
  if codedir.is_a?(String)
493
497
  config = File.expand_path(File.join(codedir, 'hiera.yaml'))
494
498
  config = nil unless Puppet::FileSystem.exist?(config)
495
499
  end
496
- config = File.expand_path(File.join(Puppet.settings[:confdir], 'hiera.yaml')) if config.nil?
500
+ config = File.expand_path(File.join(settings[:confdir], 'hiera.yaml')) if config.nil?
497
501
  config
498
502
  end,
499
503
  :desc => "The hiera configuration file. Puppet only reads this file on startup, so you must restart the puppet master every time you edit it.",
@@ -547,7 +551,7 @@ module Puppet
547
551
  :http_proxy_password =>{
548
552
  :default => "none",
549
553
  :hook => proc do |value|
550
- if Puppet.settings[:http_proxy_password] =~ /[@!# \/]/
554
+ if settings[:http_proxy_password] =~ /[@!# \/]/
551
555
  raise "Passwords set in the http_proxy_password setting must be valid as part of a URL, and any reserved characters must be URL-encoded. We received: #{value}"
552
556
  end
553
557
  end,
@@ -677,7 +681,7 @@ module Puppet
677
681
  }
678
682
  )
679
683
 
680
- define_settings(:main,
684
+ settings.define_settings(:main,
681
685
  # Whether the application management feature is on or off - now deprecated and always on.
682
686
  :app_management => {
683
687
  :default => false,
@@ -687,7 +691,7 @@ module Puppet
687
691
  }
688
692
  )
689
693
 
690
- Puppet.define_settings(:module_tool,
694
+ settings.define_settings(:module_tool,
691
695
  :module_repository => {
692
696
  :default => 'https://forgeapi.puppet.com',
693
697
  :desc => "The module repository",
@@ -710,7 +714,7 @@ module Puppet
710
714
  }
711
715
  )
712
716
 
713
- Puppet.define_settings(
717
+ settings.define_settings(
714
718
  :main,
715
719
 
716
720
  # We have to downcase the fqdn, because the current ssl stuff (as opposed to in master) doesn't have good facilities for
@@ -803,13 +807,17 @@ This is useful for embedding a pre-shared key for autosigning policy executables
803
807
  ("challenge password") OID.
804
808
 
805
809
  Extension requests will be permanently embedded in the final certificate.
806
- Extension OIDs must be in the "ppRegCertExt" (`1.3.6.1.4.1.34380.1.1`) or
807
- "ppPrivCertExt" (`1.3.6.1.4.1.34380.1.2`) OID arcs. The ppRegCertExt arc is
810
+ Extension OIDs must be in the "ppRegCertExt" (`1.3.6.1.4.1.34380.1.1`),
811
+ "ppPrivCertExt" (`1.3.6.1.4.1.34380.1.2`), or
812
+ "ppAuthCertExt" (`1.3.6.1.4.1.34380.1.3`) OID arcs. The ppRegCertExt arc is
808
813
  reserved for four of the most common pieces of data to embed: `pp_uuid` (`.1`),
809
814
  `pp_instance_id` (`.2`), `pp_image_name` (`.3`), and `pp_preshared_key` (`.4`)
810
815
  --- in the YAML file, these can be referred to by their short descriptive names
811
816
  instead of their full OID. The ppPrivCertExt arc is unregulated, and can be used
812
- for site-specific extensions.
817
+ for site-specific extensions. The ppAuthCert arc is reserved for two pieces of
818
+ data to embed: `pp_authorization` (`.1`) and `pp_auth_role` (`.13`). As with
819
+ ppRegCertExt, in the YAML file, these can be referred to by their short
820
+ descriptive name instead of their full OID.
813
821
  EOT
814
822
  },
815
823
  :certdir => {
@@ -998,7 +1006,7 @@ EOT
998
1006
  }
999
1007
  )
1000
1008
 
1001
- define_settings(
1009
+ settings.define_settings(
1002
1010
  :ca,
1003
1011
  :ca_name => {
1004
1012
  :default => "Puppet CA: $certname",
@@ -1146,7 +1154,7 @@ EOT
1146
1154
 
1147
1155
  # Define the config default.
1148
1156
 
1149
- define_settings(:application,
1157
+ settings.define_settings(:application,
1150
1158
  :config_file_name => {
1151
1159
  :type => :string,
1152
1160
  :default => Puppet::Settings.default_config_file_name,
@@ -1176,7 +1184,7 @@ EOT
1176
1184
  }
1177
1185
  )
1178
1186
 
1179
- define_settings(:environment,
1187
+ settings.define_settings(:environment,
1180
1188
  :manifest => {
1181
1189
  :default => nil,
1182
1190
  :type => :file_or_directory,
@@ -1219,7 +1227,7 @@ EOT
1219
1227
  }
1220
1228
  )
1221
1229
 
1222
- define_settings(:master,
1230
+ settings.define_settings(:master,
1223
1231
  :user => {
1224
1232
  :default => "puppet",
1225
1233
  :desc => "The user Puppet Server will run as. Used to ensure
@@ -1289,13 +1297,23 @@ EOT
1289
1297
  overridden by more specific settings (see `ca_port`, `report_port`).",
1290
1298
  },
1291
1299
  :node_name => {
1292
- :default => "cert",
1300
+ :default => 'cert',
1301
+ :type => :enum,
1302
+ :values => ['cert', 'facter'],
1303
+ :deprecated => :completely,
1304
+ :hook => proc { |val|
1305
+ if val != 'cert'
1306
+ Puppet.deprecation_warning("The node_name setting is deprecated and will be removed in a future release.")
1307
+ end
1308
+ },
1293
1309
  :desc => "How the puppet master determines the client's identity
1294
1310
  and sets the 'hostname', 'fqdn' and 'domain' facts for use in the manifest,
1295
1311
  in particular for determining which 'node' statement applies to the client.
1296
1312
  Possible values are 'cert' (use the subject's CN in the client's
1297
1313
  certificate) and 'facter' (use the hostname that the client
1298
- reported in its facts)",
1314
+ reported in its facts).
1315
+
1316
+ This setting is deprecated, please use explicit fact matching for classification.",
1299
1317
  },
1300
1318
  :bucketdir => {
1301
1319
  :default => "$vardir/bucket",
@@ -1424,14 +1442,23 @@ EOT
1424
1442
  :desc => "Where the fileserver configuration is stored.",
1425
1443
  },
1426
1444
  :strict_hostname_checking => {
1427
- :default => false,
1445
+ :default => true,
1446
+ :type => :boolean,
1428
1447
  :desc => "Whether to only search for the complete
1429
- hostname as it is in the certificate when searching for node information
1430
- in the catalogs.",
1448
+ hostname as it is in the certificate when searching for node information
1449
+ in the catalogs or to match dot delimited segments of the cert's certname
1450
+ and the hostname, fqdn, and/or domain facts.
1451
+
1452
+ This setting is deprecated and will be removed in a future release.",
1453
+ :hook => proc { |val|
1454
+ if val != true
1455
+ Puppet.deprecation_warning("Setting strict_hostname_checking to false is deprecated and will be removed in a future release. Please use regular expressions in your node declarations or explicit fact matching for classification (though be warned that fact based classification may be considered insecure).")
1456
+ end
1457
+ }
1431
1458
  }
1432
1459
  )
1433
1460
 
1434
- define_settings(:device,
1461
+ settings.define_settings(:device,
1435
1462
  :devicedir => {
1436
1463
  :default => "$vardir/devices",
1437
1464
  :type => :directory,
@@ -1446,7 +1473,7 @@ EOT
1446
1473
  }
1447
1474
  )
1448
1475
 
1449
- define_settings(:agent,
1476
+ settings.define_settings(:agent,
1450
1477
  :node_name_value => {
1451
1478
  :default => "$certname",
1452
1479
  :desc => "The explicit value used for the node name for all requests the agent
@@ -1832,7 +1859,7 @@ EOT
1832
1859
 
1833
1860
  # Plugin information.
1834
1861
 
1835
- define_settings(
1862
+ settings.define_settings(
1836
1863
  :main,
1837
1864
  :plugindest => {
1838
1865
  :type => :directory,
@@ -1886,7 +1913,7 @@ EOT
1886
1913
 
1887
1914
  # Central fact information.
1888
1915
 
1889
- define_settings(
1916
+ settings.define_settings(
1890
1917
  :main,
1891
1918
  :factpath => {
1892
1919
  :type => :path,
@@ -1903,7 +1930,7 @@ EOT
1903
1930
  }
1904
1931
  )
1905
1932
 
1906
- define_settings(
1933
+ settings.define_settings(
1907
1934
  :transaction,
1908
1935
  :tags => {
1909
1936
  :default => "",
@@ -1931,7 +1958,7 @@ EOT
1931
1958
  }
1932
1959
  )
1933
1960
 
1934
- define_settings(
1961
+ settings.define_settings(
1935
1962
  :main,
1936
1963
  :external_nodes => {
1937
1964
  :default => "none",
@@ -1956,7 +1983,7 @@ EOT
1956
1983
  }
1957
1984
  )
1958
1985
 
1959
- define_settings(
1986
+ settings.define_settings(
1960
1987
  :ldap,
1961
1988
  :ldapssl => {
1962
1989
  :default => false,
@@ -2025,7 +2052,7 @@ EOT
2025
2052
  }
2026
2053
  )
2027
2054
 
2028
- define_settings(:master,
2055
+ settings.define_settings(:master,
2029
2056
  :storeconfigs => {
2030
2057
  :default => false,
2031
2058
  :type => :boolean,
@@ -2058,7 +2085,7 @@ EOT
2058
2085
  }
2059
2086
  )
2060
2087
 
2061
- define_settings(:parser,
2088
+ settings.define_settings(:parser,
2062
2089
  :max_errors => {
2063
2090
  :default => 10,
2064
2091
  :desc => <<-'EOT'
@@ -2100,7 +2127,7 @@ EOT
2100
2127
  EOT
2101
2128
  }
2102
2129
  )
2103
- define_settings(:puppetdoc,
2130
+ settings.define_settings(:puppetdoc,
2104
2131
  :document_all => {
2105
2132
  :default => false,
2106
2133
  :type => :boolean,
@@ -2109,7 +2136,7 @@ EOT
2109
2136
  }
2110
2137
  )
2111
2138
 
2112
- define_settings(
2139
+ settings.define_settings(
2113
2140
  :main,
2114
2141
  :rich_data => {
2115
2142
  :default => false,
@@ -2126,5 +2153,5 @@ EOT
2126
2153
  EOT
2127
2154
  }
2128
2155
  )
2129
-
2156
+ end
2130
2157
  end
@@ -387,9 +387,17 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
387
387
 
388
388
  # Initialize our server fact hash; we add these to each client, and they
389
389
  # won't change while we're running, so it's safe to cache the values.
390
+ #
391
+ # See also set_server_facts in Puppet::Server::Compiler in puppetserver.
390
392
  def set_server_facts
391
393
  @server_facts = {}
392
394
 
395
+ # Add our server Puppet Enterprise version, if available.
396
+ pe_version_file = '/opt/puppetlabs/server/pe_version'
397
+ if File.readable?(pe_version_file) and !File.zero?(pe_version_file)
398
+ @server_facts['pe_serverversion'] = File.read(pe_version_file).chomp
399
+ end
400
+
393
401
  # Add our server version to the fact list
394
402
  @server_facts["serverversion"] = Puppet.version.to_s
395
403
 
@@ -198,6 +198,10 @@ module Puppet::Network::HTTP
198
198
  current_request[header] = value
199
199
  end
200
200
  when 429, 503
201
+ if connection.started?
202
+ Puppet.debug("Closing connection for #{current_site}")
203
+ connection.finish
204
+ end
201
205
  response = handle_retry_after(current_response)
202
206
  else
203
207
  response = current_response