bolt 0.21.7 → 0.21.8
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/lib/bolt/transport/ssh/connection.rb +4 -5
- data/lib/bolt/transport/ssh.rb +4 -1
- data/lib/bolt/transport/winrm/connection.rb +3 -4
- data/lib/bolt/transport/winrm.rb +4 -1
- data/lib/bolt/version.rb +1 -1
- data/libexec/apply_catalog.rb +10 -2
- data/vendored/puppet/lib/puppet/application/apply.rb +20 -9
- data/vendored/puppet/lib/puppet/application/cert.rb +3 -1
- data/vendored/puppet/lib/puppet/application/device.rb +22 -5
- data/vendored/puppet/lib/puppet/configurer/fact_handler.rb +5 -1
- data/vendored/puppet/lib/puppet/configurer.rb +15 -2
- data/vendored/puppet/lib/puppet/defaults.rb +36 -25
- data/vendored/puppet/lib/puppet/face/certificate.rb +2 -0
- data/vendored/puppet/lib/puppet/feature/base.rb +0 -3
- data/vendored/puppet/lib/puppet/functions/call.rb +37 -0
- data/vendored/puppet/lib/puppet/functions.rb +5 -0
- data/vendored/puppet/lib/puppet/indirector/ldap.rb +6 -0
- data/vendored/puppet/lib/puppet/node/environment.rb +4 -2
- data/vendored/puppet/lib/puppet/parser/scope.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/adapters.rb +14 -0
- data/vendored/puppet/lib/puppet/pops/evaluator/deferred_resolver.rb +128 -0
- data/vendored/puppet/lib/puppet/pops/evaluator/evaluator_impl.rb +4 -1
- data/vendored/puppet/lib/puppet/pops/functions/dispatch.rb +2 -0
- data/vendored/puppet/lib/puppet/pops/issues.rb +9 -1
- data/vendored/puppet/lib/puppet/pops/loader/static_loader.rb +0 -16
- data/vendored/puppet/lib/puppet/pops/loaders.rb +1 -3
- data/vendored/puppet/lib/puppet/pops/parser/eparser.rb +6 -6
- data/vendored/puppet/lib/puppet/pops/pcore.rb +11 -0
- data/vendored/puppet/lib/puppet/pops/types/type_factory.rb +17 -0
- data/vendored/puppet/lib/puppet/pops/validation/tasks_checker.rb +13 -5
- data/vendored/puppet/lib/puppet/pops.rb +1 -0
- data/vendored/puppet/lib/puppet/provider/service/debian.rb +1 -0
- data/vendored/puppet/lib/puppet/provider/service/smf.rb +2 -3
- data/vendored/puppet/lib/puppet/provider/service/upstart.rb +10 -2
- data/vendored/puppet/lib/puppet/ssl/certificate_authority.rb +6 -84
- data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +11 -3
- data/vendored/puppet/lib/puppet/type/file.rb +3 -0
- data/vendored/puppet/lib/puppet/type/user.rb +17 -3
- data/vendored/puppet/lib/puppet/util/autoload.rb +36 -31
- data/vendored/puppet/lib/puppet/util.rb +2 -0
- metadata +3 -43
- data/vendored/puppet/lib/puppet/indirector/node/write_only_yaml.rb +0 -39
- data/vendored/puppet/lib/puppet/provider/augeas/augeas.rb +0 -573
- data/vendored/puppet/lib/puppet/provider/cisco.rb +0 -9
- data/vendored/puppet/lib/puppet/provider/computer/computer.rb +0 -20
- data/vendored/puppet/lib/puppet/provider/host/parsed.rb +0 -46
- data/vendored/puppet/lib/puppet/provider/interface/cisco.rb +0 -27
- data/vendored/puppet/lib/puppet/provider/macauthorization/macauthorization.rb +0 -298
- data/vendored/puppet/lib/puppet/provider/mcx/mcxcontent.rb +0 -173
- data/vendored/puppet/lib/puppet/provider/mount/parsed.rb +0 -282
- data/vendored/puppet/lib/puppet/provider/mount.rb +0 -76
- data/vendored/puppet/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +0 -590
- data/vendored/puppet/lib/puppet/provider/selboolean/getsetsebool.rb +0 -47
- data/vendored/puppet/lib/puppet/provider/selmodule/semodule.rb +0 -140
- data/vendored/puppet/lib/puppet/provider/ssh_authorized_key/parsed.rb +0 -105
- data/vendored/puppet/lib/puppet/provider/sshkey/parsed.rb +0 -50
- data/vendored/puppet/lib/puppet/provider/vlan/cisco.rb +0 -28
- data/vendored/puppet/lib/puppet/provider/yumrepo/inifile.rb +0 -315
- data/vendored/puppet/lib/puppet/type/augeas.rb +0 -211
- data/vendored/puppet/lib/puppet/type/computer.rb +0 -66
- data/vendored/puppet/lib/puppet/type/host.rb +0 -95
- data/vendored/puppet/lib/puppet/type/interface.rb +0 -121
- data/vendored/puppet/lib/puppet/type/k5login.rb +0 -165
- data/vendored/puppet/lib/puppet/type/macauthorization.rb +0 -167
- data/vendored/puppet/lib/puppet/type/mcx.rb +0 -98
- data/vendored/puppet/lib/puppet/type/mount.rb +0 -314
- data/vendored/puppet/lib/puppet/type/router.rb +0 -17
- data/vendored/puppet/lib/puppet/type/scheduled_task.rb +0 -183
- data/vendored/puppet/lib/puppet/type/selboolean.rb +0 -26
- data/vendored/puppet/lib/puppet/type/selmodule.rb +0 -59
- data/vendored/puppet/lib/puppet/type/ssh_authorized_key.rb +0 -143
- data/vendored/puppet/lib/puppet/type/sshkey.rb +0 -83
- data/vendored/puppet/lib/puppet/type/vlan.rb +0 -26
- data/vendored/puppet/lib/puppet/type/yumrepo.rb +0 -430
- data/vendored/puppet/lib/puppet/util/network_device/cisco/device.rb +0 -285
- data/vendored/puppet/lib/puppet/util/network_device/cisco/facts.rb +0 -72
- data/vendored/puppet/lib/puppet/util/network_device/cisco/interface.rb +0 -94
- data/vendored/puppet/lib/puppet/util/network_device/cisco.rb +0 -4
- data/vendored/puppet/lib/puppet/util/network_device/ipcalc.rb +0 -68
- data/vendored/puppet/lib/puppet/util/network_device/transport/ssh.rb +0 -126
- data/vendored/puppet/lib/puppet/util/network_device/transport/telnet.rb +0 -47
- data/vendored/puppet/lib/puppet/util/windows/taskscheduler.rb +0 -1267
@@ -1,167 +0,0 @@
|
|
1
|
-
Puppet::Type.newtype(:macauthorization) do
|
2
|
-
|
3
|
-
@doc = "Manage the Mac OS X authorization database. See the
|
4
|
-
[Apple developer site](https://developer.apple.com/library/content/documentation/Security/Conceptual/Security_Overview/AuthenticationAndAuthorization/AuthenticationAndAuthorization.html)
|
5
|
-
for more information.
|
6
|
-
|
7
|
-
Note that authorization store directives with hyphens in their names have
|
8
|
-
been renamed to use underscores, as Puppet does not react well to hyphens
|
9
|
-
in identifiers.
|
10
|
-
|
11
|
-
**Autorequires:** If Puppet is managing the `/etc/authorization` file, each
|
12
|
-
macauthorization resource will autorequire it."
|
13
|
-
|
14
|
-
ensurable
|
15
|
-
|
16
|
-
autorequire(:file) do
|
17
|
-
["/etc/authorization"]
|
18
|
-
end
|
19
|
-
|
20
|
-
def munge_boolean(value)
|
21
|
-
case value
|
22
|
-
when true, "true", :true
|
23
|
-
:true
|
24
|
-
when false, "false", :false
|
25
|
-
:false
|
26
|
-
else
|
27
|
-
fail("munge_boolean only takes booleans")
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def munge_integer(value)
|
32
|
-
Integer(value)
|
33
|
-
rescue ArgumentError
|
34
|
-
fail _("munge_integer only takes integers")
|
35
|
-
end
|
36
|
-
|
37
|
-
newparam(:name) do
|
38
|
-
desc "The name of the right or rule to be managed.
|
39
|
-
Corresponds to `key` in Authorization Services. The key is the name
|
40
|
-
of a rule. A key uses the same naming conventions as a right. The
|
41
|
-
Security Server uses a rule's key to match the rule with a right.
|
42
|
-
Wildcard keys end with a '.'. The generic rule has an empty key value.
|
43
|
-
Any rights that do not match a specific rule use the generic rule."
|
44
|
-
|
45
|
-
isnamevar
|
46
|
-
end
|
47
|
-
|
48
|
-
newproperty(:auth_type) do
|
49
|
-
desc "Type --- this can be a `right` or a `rule`. The `comment` type has
|
50
|
-
not yet been implemented."
|
51
|
-
|
52
|
-
newvalue(:right)
|
53
|
-
newvalue(:rule)
|
54
|
-
# newvalue(:comment) # not yet implemented.
|
55
|
-
end
|
56
|
-
|
57
|
-
newproperty(:allow_root, :boolean => true) do
|
58
|
-
desc "Corresponds to `allow-root` in the authorization store. Specifies
|
59
|
-
whether a right should be allowed automatically if the requesting process
|
60
|
-
is running with `uid == 0`. AuthorizationServices defaults this attribute
|
61
|
-
to false if not specified."
|
62
|
-
|
63
|
-
newvalue(:true)
|
64
|
-
newvalue(:false)
|
65
|
-
|
66
|
-
munge do |value|
|
67
|
-
@resource.munge_boolean(value)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
newproperty(:authenticate_user, :boolean => true) do
|
72
|
-
desc "Corresponds to `authenticate-user` in the authorization store."
|
73
|
-
|
74
|
-
newvalue(:true)
|
75
|
-
newvalue(:false)
|
76
|
-
|
77
|
-
munge do |value|
|
78
|
-
@resource.munge_boolean(value)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
newproperty(:auth_class) do
|
83
|
-
desc "Corresponds to `class` in the authorization store; renamed due
|
84
|
-
to 'class' being a reserved word in Puppet."
|
85
|
-
|
86
|
-
newvalue(:user)
|
87
|
-
newvalue(:'evaluate-mechanisms')
|
88
|
-
newvalue(:allow)
|
89
|
-
newvalue(:deny)
|
90
|
-
newvalue(:rule)
|
91
|
-
end
|
92
|
-
|
93
|
-
newproperty(:comment) do
|
94
|
-
desc "The `comment` attribute for authorization resources."
|
95
|
-
end
|
96
|
-
|
97
|
-
newproperty(:group) do
|
98
|
-
desc "A group which the user must authenticate as a member of. This
|
99
|
-
must be a single group."
|
100
|
-
end
|
101
|
-
|
102
|
-
newproperty(:k_of_n) do
|
103
|
-
desc "How large a subset of rule mechanisms must succeed for successful
|
104
|
-
authentication. If there are 'n' mechanisms, then 'k' (the integer value
|
105
|
-
of this parameter) mechanisms must succeed. The most common setting for
|
106
|
-
this parameter is `1`. If `k-of-n` is not set, then every mechanism ---
|
107
|
-
that is, 'n-of-n' --- must succeed."
|
108
|
-
|
109
|
-
munge do |value|
|
110
|
-
@resource.munge_integer(value)
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
newproperty(:mechanisms, :array_matching => :all) do
|
115
|
-
desc "An array of suitable mechanisms."
|
116
|
-
end
|
117
|
-
|
118
|
-
newproperty(:rule, :array_matching => :all) do
|
119
|
-
desc "The rule(s) that this right refers to."
|
120
|
-
end
|
121
|
-
|
122
|
-
newproperty(:session_owner, :boolean => true) do
|
123
|
-
desc "Whether the session owner automatically matches this rule or right.
|
124
|
-
Corresponds to `session-owner` in the authorization store."
|
125
|
-
|
126
|
-
newvalue(:true)
|
127
|
-
newvalue(:false)
|
128
|
-
|
129
|
-
munge do |value|
|
130
|
-
@resource.munge_boolean(value)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
newproperty(:shared, :boolean => true) do
|
135
|
-
desc "Whether the Security Server should mark the credentials used to gain
|
136
|
-
this right as shared. The Security Server may use any shared credentials
|
137
|
-
to authorize this right. For maximum security, set sharing to false so
|
138
|
-
credentials stored by the Security Server for one application may not be
|
139
|
-
used by another application."
|
140
|
-
|
141
|
-
newvalue(:true)
|
142
|
-
newvalue(:false)
|
143
|
-
|
144
|
-
munge do |value|
|
145
|
-
@resource.munge_boolean(value)
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
newproperty(:timeout) do
|
150
|
-
desc "The number of seconds in which the credential used by this rule will
|
151
|
-
expire. For maximum security where the user must authenticate every time,
|
152
|
-
set the timeout to 0. For minimum security, remove the timeout attribute
|
153
|
-
so the user authenticates only once per session."
|
154
|
-
|
155
|
-
munge do |value|
|
156
|
-
@resource.munge_integer(value)
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
newproperty(:tries) do
|
161
|
-
desc "The number of tries allowed."
|
162
|
-
munge do |value|
|
163
|
-
@resource.munge_integer(value)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
end
|
@@ -1,98 +0,0 @@
|
|
1
|
-
Puppet::Type.newtype(:mcx) do
|
2
|
-
|
3
|
-
@doc = "MCX object management using DirectoryService on OS X.
|
4
|
-
|
5
|
-
The default provider of this type merely manages the XML plist as
|
6
|
-
reported by the `dscl -mcxexport` command. This is similar to the
|
7
|
-
content property of the file type in Puppet.
|
8
|
-
|
9
|
-
The recommended method of using this type is to use Work Group Manager
|
10
|
-
to manage users and groups on the local computer, record the resulting
|
11
|
-
puppet manifest using the command `puppet resource mcx`, then deploy it
|
12
|
-
to other machines.
|
13
|
-
|
14
|
-
**Autorequires:** If Puppet is managing the user, group, or computer that these
|
15
|
-
MCX settings refer to, the MCX resource will autorequire that user, group, or computer.
|
16
|
-
"
|
17
|
-
feature :manages_content, \
|
18
|
-
"The provider can manage MCXSettings as a string.",
|
19
|
-
:methods => [:content, :content=]
|
20
|
-
|
21
|
-
ensurable do
|
22
|
-
desc "Create or remove the MCX setting."
|
23
|
-
|
24
|
-
newvalue(:present) do
|
25
|
-
provider.create
|
26
|
-
end
|
27
|
-
|
28
|
-
newvalue(:absent) do
|
29
|
-
provider.destroy
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
newparam(:name) do
|
35
|
-
desc "The name of the resource being managed.
|
36
|
-
The default naming convention follows Directory Service paths:
|
37
|
-
|
38
|
-
/Computers/localhost
|
39
|
-
/Groups/admin
|
40
|
-
/Users/localadmin
|
41
|
-
|
42
|
-
The `ds_type` and `ds_name` type parameters are not necessary if the
|
43
|
-
default naming convention is followed."
|
44
|
-
isnamevar
|
45
|
-
end
|
46
|
-
|
47
|
-
newparam(:ds_type) do
|
48
|
-
|
49
|
-
desc "The DirectoryService type this MCX setting attaches to."
|
50
|
-
|
51
|
-
newvalues(:user, :group, :computer, :computerlist)
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
newparam(:ds_name) do
|
56
|
-
desc "The name to attach the MCX Setting to. (For example, `localhost`
|
57
|
-
when `ds_type => computer`.) This setting is not required, as it can be
|
58
|
-
automatically discovered when the resource name is parseable. (For
|
59
|
-
example, in `/Groups/admin`, `group` will be used as the dstype.)"
|
60
|
-
end
|
61
|
-
|
62
|
-
newproperty(:content, :required_features => :manages_content) do
|
63
|
-
desc "The XML Plist used as the value of MCXSettings in DirectoryService.
|
64
|
-
This is the standard output from the system command:
|
65
|
-
|
66
|
-
dscl localhost -mcxexport /Local/Default/<ds_type>/ds_name
|
67
|
-
|
68
|
-
Note that `ds_type` is capitalized and plural in the dscl command."
|
69
|
-
end
|
70
|
-
|
71
|
-
# JJM Yes, this is not DRY at all. Because of the code blocks
|
72
|
-
# autorequire must be done this way. I think.
|
73
|
-
|
74
|
-
def setup_autorequire(type)
|
75
|
-
# value returns a Symbol
|
76
|
-
ds_type = value(:ds_type)
|
77
|
-
ds_name = value(:ds_name)
|
78
|
-
if ds_type == type
|
79
|
-
rval = [ ds_name.to_s ]
|
80
|
-
else
|
81
|
-
rval = [ ]
|
82
|
-
end
|
83
|
-
rval
|
84
|
-
end
|
85
|
-
|
86
|
-
autorequire(:user) do
|
87
|
-
setup_autorequire(:user)
|
88
|
-
end
|
89
|
-
|
90
|
-
autorequire(:group) do
|
91
|
-
setup_autorequire(:group)
|
92
|
-
end
|
93
|
-
|
94
|
-
autorequire(:computer) do
|
95
|
-
setup_autorequire(:computer)
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
@@ -1,314 +0,0 @@
|
|
1
|
-
require 'puppet/property/boolean'
|
2
|
-
|
3
|
-
module Puppet
|
4
|
-
# We want the mount to refresh when it changes.
|
5
|
-
Type.newtype(:mount, :self_refresh => true) do
|
6
|
-
@doc = "Manages mounted filesystems, including putting mount
|
7
|
-
information into the mount table. The actual behavior depends
|
8
|
-
on the value of the 'ensure' parameter.
|
9
|
-
|
10
|
-
**Refresh:** `mount` resources can respond to refresh events (via
|
11
|
-
`notify`, `subscribe`, or the `~>` arrow). If a `mount` receives an event
|
12
|
-
from another resource **and** its `ensure` attribute is set to `mounted`,
|
13
|
-
Puppet will try to unmount then remount that filesystem.
|
14
|
-
|
15
|
-
**Autorequires:** If Puppet is managing any parents of a mount resource ---
|
16
|
-
that is, other mount points higher up in the filesystem --- the child
|
17
|
-
mount will autorequire them.
|
18
|
-
|
19
|
-
**Autobefores:** If Puppet is managing any child file paths of a mount
|
20
|
-
point, the mount resource will autobefore them."
|
21
|
-
|
22
|
-
feature :refreshable, "The provider can remount the filesystem.",
|
23
|
-
:methods => [:remount]
|
24
|
-
|
25
|
-
# Use the normal parent class, because we actually want to
|
26
|
-
# call code when sync is called.
|
27
|
-
newproperty(:ensure) do
|
28
|
-
desc "Control what to do with this mount. Set this attribute to
|
29
|
-
`unmounted` to make sure the filesystem is in the filesystem table
|
30
|
-
but not mounted (if the filesystem is currently mounted, it will be
|
31
|
-
unmounted). Set it to `absent` to unmount (if necessary) and remove
|
32
|
-
the filesystem from the fstab. Set to `mounted` to add it to the
|
33
|
-
fstab and mount it. Set to `present` to add to fstab but not change
|
34
|
-
mount/unmount status."
|
35
|
-
|
36
|
-
# IS -> SHOULD In Sync Action
|
37
|
-
# ghost -> present NO create
|
38
|
-
# absent -> present NO create
|
39
|
-
# (mounted -> present YES)
|
40
|
-
# (unmounted -> present YES)
|
41
|
-
newvalue(:defined) do
|
42
|
-
provider.create
|
43
|
-
return :mount_created
|
44
|
-
end
|
45
|
-
|
46
|
-
aliasvalue :present, :defined
|
47
|
-
|
48
|
-
# IS -> SHOULD In Sync Action
|
49
|
-
# ghost -> unmounted NO create, unmount
|
50
|
-
# absent -> unmounted NO create
|
51
|
-
# mounted -> unmounted NO unmount
|
52
|
-
newvalue(:unmounted) do
|
53
|
-
case self.retrieve
|
54
|
-
when :ghost # (not in fstab but mounted)
|
55
|
-
provider.create
|
56
|
-
@resource.flush
|
57
|
-
provider.unmount
|
58
|
-
return :mount_unmounted
|
59
|
-
when nil, :absent # (not in fstab and not mounted)
|
60
|
-
provider.create
|
61
|
-
return :mount_created
|
62
|
-
when :mounted # (in fstab and mounted)
|
63
|
-
provider.unmount
|
64
|
-
syncothers # I guess it's more likely that the mount was originally mounted with
|
65
|
-
# the wrong attributes so I sync AFTER the umount
|
66
|
-
return :mount_unmounted
|
67
|
-
else
|
68
|
-
raise Puppet::Error, _("Unexpected change from %{current} to unmounted") % { current: current_value }
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
# IS -> SHOULD In Sync Action
|
73
|
-
# ghost -> absent NO unmount
|
74
|
-
# mounted -> absent NO provider.destroy AND unmount
|
75
|
-
# unmounted -> absent NO provider.destroy
|
76
|
-
newvalue(:absent, :event => :mount_deleted) do
|
77
|
-
current_value = self.retrieve
|
78
|
-
provider.unmount if provider.mounted?
|
79
|
-
provider.destroy unless current_value == :ghost
|
80
|
-
end
|
81
|
-
|
82
|
-
# IS -> SHOULD In Sync Action
|
83
|
-
# ghost -> mounted NO provider.create
|
84
|
-
# absent -> mounted NO provider.create AND mount
|
85
|
-
# unmounted -> mounted NO mount
|
86
|
-
newvalue(:mounted, :event => :mount_mounted) do
|
87
|
-
# Create the mount point if it does not already exist.
|
88
|
-
current_value = self.retrieve
|
89
|
-
currently_mounted = provider.mounted?
|
90
|
-
provider.create if [nil, :absent, :ghost].include?(current_value)
|
91
|
-
|
92
|
-
syncothers
|
93
|
-
|
94
|
-
# The fs can be already mounted if it was absent but mounted
|
95
|
-
provider.property_hash[:needs_mount] = true unless currently_mounted
|
96
|
-
end
|
97
|
-
|
98
|
-
# insync: mounted -> present
|
99
|
-
# unmounted -> present
|
100
|
-
def insync?(is)
|
101
|
-
if should == :defined and [:mounted,:unmounted].include?(is)
|
102
|
-
true
|
103
|
-
else
|
104
|
-
super
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
def syncothers
|
109
|
-
# We have to flush any changes to disk.
|
110
|
-
currentvalues = @resource.retrieve_resource
|
111
|
-
|
112
|
-
# Determine if there are any out-of-sync properties.
|
113
|
-
oos = @resource.send(:properties).find_all do |prop|
|
114
|
-
unless currentvalues.include?(prop)
|
115
|
-
raise Puppet::DevError, _("Parent has property %{name} but it doesn't appear in the current values") % { name: prop.name }
|
116
|
-
end
|
117
|
-
if prop.name == :ensure
|
118
|
-
false
|
119
|
-
else
|
120
|
-
! prop.safe_insync?(currentvalues[prop])
|
121
|
-
end
|
122
|
-
end.each { |prop| prop.sync }.length
|
123
|
-
@resource.flush if oos > 0
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
newproperty(:device) do
|
128
|
-
desc "The device providing the mount. This can be whatever
|
129
|
-
device is supporting by the mount, including network
|
130
|
-
devices or devices specified by UUID rather than device
|
131
|
-
path, depending on the operating system."
|
132
|
-
|
133
|
-
validate do |value|
|
134
|
-
raise Puppet::Error, _("device must not contain whitespace: %{value}") % { value: value } if value =~ /\s/
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
# Solaris specifies two devices, not just one.
|
139
|
-
newproperty(:blockdevice) do
|
140
|
-
desc "The device to fsck. This is property is only valid
|
141
|
-
on Solaris, and in most cases will default to the correct
|
142
|
-
value."
|
143
|
-
|
144
|
-
# Default to the device but with "dsk" replaced with "rdsk".
|
145
|
-
defaultto do
|
146
|
-
if Facter.value(:osfamily) == "Solaris"
|
147
|
-
if device = resource[:device] and device =~ %r{/dsk/}
|
148
|
-
device.sub(%r{/dsk/}, "/rdsk/")
|
149
|
-
elsif fstype = resource[:fstype] and fstype == 'nfs'
|
150
|
-
'-'
|
151
|
-
else
|
152
|
-
nil
|
153
|
-
end
|
154
|
-
else
|
155
|
-
nil
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
validate do |value|
|
160
|
-
raise Puppet::Error, _("blockdevice must not contain whitespace: %{value}") % { value: value } if value =~ /\s/
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
newproperty(:fstype) do
|
165
|
-
desc "The mount type. Valid values depend on the
|
166
|
-
operating system. This is a required option."
|
167
|
-
|
168
|
-
validate do |value|
|
169
|
-
raise Puppet::Error, _("fstype must not contain whitespace: %{value}") % { value: value } if value =~ /\s/
|
170
|
-
raise Puppet::Error, _("fstype must not be an empty string") if value.empty?
|
171
|
-
end
|
172
|
-
end
|
173
|
-
|
174
|
-
newproperty(:options) do
|
175
|
-
desc "A single string containing options for the mount, as they would
|
176
|
-
appear in fstab on Linux. For many platforms this is a comma-delimited
|
177
|
-
string. Consult the fstab(5) man page for system-specific details.
|
178
|
-
AIX options other than dev, nodename, or vfs can be defined here. If
|
179
|
-
specified, AIX options of account, boot, check, free, mount, size,
|
180
|
-
type, vol, log, and quota must be ordered alphabetically at the end of
|
181
|
-
the list."
|
182
|
-
|
183
|
-
validate do |value|
|
184
|
-
raise Puppet::Error, _("options must not contain whitespace: %{value}") % { value: value } if value =~ /\s/
|
185
|
-
raise Puppet::Error, _("options must not be an empty string") if value.empty?
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
|
-
newproperty(:pass) do
|
190
|
-
desc "The pass in which the mount is checked."
|
191
|
-
|
192
|
-
defaultto {
|
193
|
-
if @resource.managed?
|
194
|
-
if Facter.value(:osfamily) == 'Solaris'
|
195
|
-
'-'
|
196
|
-
else
|
197
|
-
0
|
198
|
-
end
|
199
|
-
end
|
200
|
-
}
|
201
|
-
end
|
202
|
-
|
203
|
-
newproperty(:atboot, :parent => Puppet::Property::Boolean) do
|
204
|
-
desc "Whether to mount the mount at boot. Not all platforms
|
205
|
-
support this."
|
206
|
-
|
207
|
-
def munge(value)
|
208
|
-
munged = super
|
209
|
-
if munged
|
210
|
-
:yes
|
211
|
-
else
|
212
|
-
:no
|
213
|
-
end
|
214
|
-
end
|
215
|
-
end
|
216
|
-
|
217
|
-
newproperty(:dump) do
|
218
|
-
desc "Whether to dump the mount. Not all platform support this.
|
219
|
-
Valid values are `1` or `0` (or `2` on FreeBSD). Default is `0`."
|
220
|
-
|
221
|
-
if Facter.value(:operatingsystem) == "FreeBSD"
|
222
|
-
newvalue(%r{(0|1|2)})
|
223
|
-
else
|
224
|
-
newvalue(%r{(0|1)})
|
225
|
-
end
|
226
|
-
|
227
|
-
defaultto {
|
228
|
-
0 if @resource.managed?
|
229
|
-
}
|
230
|
-
end
|
231
|
-
|
232
|
-
newproperty(:target) do
|
233
|
-
desc "The file in which to store the mount table. Only used by
|
234
|
-
those providers that write to disk."
|
235
|
-
|
236
|
-
defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
|
237
|
-
@resource.class.defaultprovider.default_target
|
238
|
-
else
|
239
|
-
nil
|
240
|
-
end
|
241
|
-
}
|
242
|
-
end
|
243
|
-
|
244
|
-
newparam(:name) do
|
245
|
-
desc "The mount path for the mount."
|
246
|
-
|
247
|
-
isnamevar
|
248
|
-
|
249
|
-
validate do |value|
|
250
|
-
raise Puppet::Error, _("name must not contain whitespace: %{value}") % { value: value } if value =~ /\s/
|
251
|
-
end
|
252
|
-
|
253
|
-
munge do |value|
|
254
|
-
value.gsub(/^(.+?)\/*$/, '\1')
|
255
|
-
end
|
256
|
-
end
|
257
|
-
|
258
|
-
newparam(:remounts) do
|
259
|
-
desc "Whether the mount can be remounted `mount -o remount`. If
|
260
|
-
this is false, then the filesystem will be unmounted and remounted
|
261
|
-
manually, which is prone to failure."
|
262
|
-
|
263
|
-
newvalues(:true, :false)
|
264
|
-
defaultto do
|
265
|
-
case Facter.value(:operatingsystem)
|
266
|
-
when "FreeBSD", "Darwin", "DragonFly", "OpenBSD"
|
267
|
-
false
|
268
|
-
when "AIX"
|
269
|
-
if Facter.value(:kernelmajversion) == "5300"
|
270
|
-
false
|
271
|
-
elsif resource[:device] and resource[:device].match(%r{^[^/]+:/})
|
272
|
-
false
|
273
|
-
else
|
274
|
-
true
|
275
|
-
end
|
276
|
-
else
|
277
|
-
true
|
278
|
-
end
|
279
|
-
end
|
280
|
-
end
|
281
|
-
|
282
|
-
def refresh
|
283
|
-
# Only remount if we're supposed to be mounted.
|
284
|
-
provider.remount if self.should(:fstype) != "swap" and provider.mounted?
|
285
|
-
end
|
286
|
-
|
287
|
-
def value(name)
|
288
|
-
name = name.intern
|
289
|
-
if property = @parameters[name]
|
290
|
-
return property.value
|
291
|
-
end
|
292
|
-
end
|
293
|
-
|
294
|
-
# Ensure that mounts higher up in the filesystem are mounted first
|
295
|
-
autorequire(:mount) do
|
296
|
-
dependencies = []
|
297
|
-
Pathname.new(@parameters[:name].value).ascend do |parent|
|
298
|
-
dependencies.unshift parent.to_s
|
299
|
-
end
|
300
|
-
dependencies[0..-2]
|
301
|
-
end
|
302
|
-
|
303
|
-
# Autobefore the mount point's child file paths
|
304
|
-
autobefore(:file) do
|
305
|
-
dependencies = []
|
306
|
-
file_resources = catalog.resources.select { |resource| resource.type == :file }
|
307
|
-
children_file_resources = file_resources.select { |resource| File.expand_path(resource[:path]) =~ %r(^#{self[:name]}/.) }
|
308
|
-
children_file_resources.each do |child|
|
309
|
-
dependencies.push Pathname.new(child[:path])
|
310
|
-
end
|
311
|
-
dependencies
|
312
|
-
end
|
313
|
-
end
|
314
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Manage a router abstraction
|
3
|
-
|
4
|
-
|
5
|
-
module Puppet
|
6
|
-
Type.newtype(:router) do
|
7
|
-
@doc = "Manages connected router."
|
8
|
-
|
9
|
-
newparam(:url) do
|
10
|
-
desc <<-EOT
|
11
|
-
An SSH or telnet URL at which to access the router, in the form
|
12
|
-
`ssh://user:pass:enable@host/` or `telnet://user:pass:enable@host/`.
|
13
|
-
EOT
|
14
|
-
isnamevar
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|