bolt 0.20.5 → 0.20.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bolt-modules/boltlib/lib/puppet/datatypes/target.rb +1 -1
- data/lib/bolt/analytics.rb +160 -0
- data/lib/bolt/cli.rb +14 -4
- data/lib/bolt/executor.rb +15 -2
- data/lib/bolt/pal.rb +3 -1
- data/lib/bolt/puppetdb/config.rb +9 -4
- data/lib/bolt/transport/local.rb +3 -2
- data/lib/bolt/transport/orch.rb +1 -1
- data/lib/bolt/transport/orch/connection.rb +1 -0
- data/lib/bolt/transport/ssh.rb +7 -2
- data/lib/bolt/transport/ssh/connection.rb +39 -19
- data/lib/bolt/transport/winrm.rb +1 -0
- data/lib/bolt/transport/winrm/connection.rb +3 -0
- data/lib/bolt/util.rb +5 -0
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_ext/puppetdb_inventory.rb +2 -1
- data/vendored/puppet/lib/puppet/defaults.rb +15 -1
- data/vendored/puppet/lib/puppet/pops/loader/static_loader.rb +0 -14
- data/vendored/puppet/lib/puppet/pops/pcore.rb +1 -1
- data/vendored/puppet/lib/puppet/type/file/mode.rb +1 -1
- data/vendored/require_vendored.rb +0 -2
- metadata +3 -21
- data/vendored/puppet/lib/puppet/external/nagios.rb +0 -46
- data/vendored/puppet/lib/puppet/external/nagios/base.rb +0 -472
- data/vendored/puppet/lib/puppet/external/nagios/parser.rb +0 -400
- data/vendored/puppet/lib/puppet/provider/naginator.rb +0 -63
- data/vendored/puppet/lib/puppet/type/nagios_command.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_contact.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_contactgroup.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_host.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostdependency.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostescalation.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostextinfo.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_hostgroup.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_service.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_servicedependency.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_serviceescalation.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_serviceextinfo.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_servicegroup.rb +0 -3
- data/vendored/puppet/lib/puppet/type/nagios_timeperiod.rb +0 -3
- data/vendored/puppet/lib/puppet/util/nagios_maker.rb +0 -85
@@ -1,85 +0,0 @@
|
|
1
|
-
require 'puppet/external/nagios'
|
2
|
-
require 'puppet/external/nagios/base'
|
3
|
-
require 'puppet/provider/naginator'
|
4
|
-
|
5
|
-
module Puppet::Util::NagiosMaker
|
6
|
-
# Create a new nagios type, using all of the parameters
|
7
|
-
# from the parser.
|
8
|
-
def self.create_nagios_type(name)
|
9
|
-
name = name.to_sym
|
10
|
-
full_name = ("nagios_#{name}").to_sym
|
11
|
-
|
12
|
-
raise Puppet::DevError, _("No nagios type for %{name}") % { name: name } unless nagtype = Nagios::Base.type(name)
|
13
|
-
|
14
|
-
type = Puppet::Type.newtype(full_name) do
|
15
|
-
|
16
|
-
# Generate a file resource if necessary.
|
17
|
-
#
|
18
|
-
# @see Puppet::Type::File and its properties owner, group and mode.
|
19
|
-
def generate
|
20
|
-
return nil unless self[:owner] or self[:group] or self[:mode]
|
21
|
-
props = { :name => self[:target] }
|
22
|
-
[ :owner, :group, :mode ].each do |prop|
|
23
|
-
props[prop] = self[prop] if self[prop]
|
24
|
-
end
|
25
|
-
Puppet::Type.type(:file).new(props)
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
type.ensurable
|
31
|
-
|
32
|
-
type.newparam(nagtype.namevar, :namevar => true) do
|
33
|
-
desc "The name of this nagios_#{nagtype.name} resource."
|
34
|
-
end
|
35
|
-
|
36
|
-
[ :owner, :group, :mode].each do |fileprop|
|
37
|
-
type.newparam(fileprop) do
|
38
|
-
desc "The desired #{fileprop} of the config file for this nagios_#{nagtype.name} resource.
|
39
|
-
|
40
|
-
NOTE: If the target file is explicitly managed by a file resource in your manifest,
|
41
|
-
this parameter has no effect. If a parent directory of the target is managed by
|
42
|
-
a recursive file resource, this limitation does not apply (i.e., this parameter
|
43
|
-
takes precedence, and if purge is used, the target file is exempt)."
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# We deduplicate the parameters because it makes sense to allow Naginator to have dupes.
|
48
|
-
nagtype.parameters.uniq.each do |param|
|
49
|
-
next if param == nagtype.namevar
|
50
|
-
|
51
|
-
# We can't turn these parameter names into constants, so at least for now they aren't
|
52
|
-
# supported.
|
53
|
-
next if param.to_s =~ /^[0-9]/
|
54
|
-
|
55
|
-
type.newproperty(param) do
|
56
|
-
desc "Nagios configuration file parameter."
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
type.newproperty(:target) do
|
61
|
-
desc 'The target.'
|
62
|
-
|
63
|
-
defaultto do
|
64
|
-
resource.class.defaultprovider.default_target
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
target = "/etc/nagios/#{full_name.to_s}.cfg"
|
69
|
-
provider = type.provide(:naginator, :parent => Puppet::Provider::Naginator, :default_target => target) {}
|
70
|
-
provider.nagios_type
|
71
|
-
|
72
|
-
type.desc "The Nagios type #{name.to_s}. This resource type is autogenerated using the
|
73
|
-
model developed in Naginator, and all of the Nagios types are generated using the
|
74
|
-
same code and the same library.
|
75
|
-
|
76
|
-
This type generates Nagios configuration statements in Nagios-parseable configuration
|
77
|
-
files. By default, the statements will be added to `#{target}`, but
|
78
|
-
you can send them to a different file by setting their `target` attribute.
|
79
|
-
|
80
|
-
You can purge Nagios resources using the `resources` type, but *only*
|
81
|
-
in the default file locations. This is an architectural limitation.
|
82
|
-
|
83
|
-
"
|
84
|
-
end
|
85
|
-
end
|