chef-provisioning 2.7.4 → 2.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/provider/machine.rb +6 -0
- data/lib/chef/provider/machine_batch.rb +10 -2
- data/lib/chef/provisioning/machine/unix_machine.rb +14 -8
- data/lib/chef/provisioning/version.rb +1 -1
- data/lib/chef/resource/machine.rb +1 -1
- data/lib/chef/resource/machine_batch.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 382aac8438b01f83a92adb659914230b51d5a9cf280dd4b110d388327ae3c47a
|
4
|
+
data.tar.gz: eae6bcdbc36572fab55ec52d12254c92985f1c32585de5c9db547b09f752cfca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52e7e47c41dab2f86a05ee7d1822de21b012e6006c3d157041206856d02db9ab8fb438bc518c8815e2645d22cea72923bae5f9f2fb3a42f69bb5785e52d5be6c
|
7
|
+
data.tar.gz: ec300c793c7a620be16cac9232a7eef8169b1fbd72d7e4d1779647bd7469b49141943bb4b18e505223c523b5e24afde2e897c4f148b257d454840f09d5ce1633
|
@@ -41,6 +41,12 @@ class Machine < Chef::Provider::LWRPBase
|
|
41
41
|
machine
|
42
42
|
end
|
43
43
|
|
44
|
+
action :ready_only do
|
45
|
+
machine = current_driver.ready_machine(action_handler, machine_spec, current_machine_options)
|
46
|
+
machine_spec.save(action_handler)
|
47
|
+
machine
|
48
|
+
end
|
49
|
+
|
44
50
|
action :setup do
|
45
51
|
machine = action_ready
|
46
52
|
begin
|
@@ -38,6 +38,10 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
38
38
|
action :ready do
|
39
39
|
with_ready_machines
|
40
40
|
end
|
41
|
+
|
42
|
+
action :ready_only do
|
43
|
+
with_ready_machines_only
|
44
|
+
end
|
41
45
|
|
42
46
|
action :setup do
|
43
47
|
with_ready_machines do |m|
|
@@ -110,8 +114,8 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
110
114
|
end
|
111
115
|
end
|
112
116
|
|
113
|
-
def with_ready_machines
|
114
|
-
action_allocate
|
117
|
+
def with_ready_machines(ready_only: false)
|
118
|
+
action_allocate unless ready_only
|
115
119
|
parallel_do(by_new_driver) do |driver, specs_and_options|
|
116
120
|
driver.ready_machines(action_handler, specs_and_options, parallelizer) do |machine|
|
117
121
|
machine.machine_spec.save(action_handler)
|
@@ -131,6 +135,10 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
131
135
|
end
|
132
136
|
end
|
133
137
|
|
138
|
+
def with_ready_machines_only
|
139
|
+
with_ready_machines(ready_only: true)
|
140
|
+
end
|
141
|
+
|
134
142
|
def by_id
|
135
143
|
@by_id ||= @machines.inject({}) { |hash,m| hash[m[:spec].id] = m; hash }
|
136
144
|
end
|
@@ -98,16 +98,22 @@ module Provisioning
|
|
98
98
|
|
99
99
|
# Get file attributes { :mode, :owner, :group }
|
100
100
|
def get_attributes(path)
|
101
|
-
|
101
|
+
os = transport.execute('uname -s')
|
102
|
+
result = if os.stdout =~ /darwin/i # macOS
|
103
|
+
transport.execute("stat -f '%Lp %Su %Sg %N' #{path}", read_only: true)
|
104
|
+
else
|
105
|
+
transport.execute("stat -c '%a %U %G %n' #{path}", read_only: true)
|
106
|
+
end
|
107
|
+
|
102
108
|
return nil if result.exitstatus != 0
|
103
109
|
file_info = result.stdout.split(/\s+/)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
110
|
+
|
111
|
+
raise "#{path} does not exist in set_attributes()" if file_info.size <= 1
|
112
|
+
|
113
|
+
{
|
114
|
+
mode: file_info[0],
|
115
|
+
owner: file_info[1],
|
116
|
+
group: file_info[2]
|
111
117
|
}
|
112
118
|
end
|
113
119
|
|
@@ -17,7 +17,7 @@ class Machine < Chef::Resource::LWRPBase
|
|
17
17
|
@machine_options = run_context.chef_provisioning.current_machine_options
|
18
18
|
end
|
19
19
|
|
20
|
-
actions :allocate, :ready, :setup, :converge, :converge_only, :destroy, :stop
|
20
|
+
actions :allocate, :ready, :ready_only, :setup, :converge, :converge_only, :destroy, :stop
|
21
21
|
default_action :converge
|
22
22
|
|
23
23
|
# Driver attributes
|
@@ -15,7 +15,7 @@ class MachineBatch < Chef::Resource::LWRPBase
|
|
15
15
|
@machine_options = run_context.chef_provisioning.current_machine_options
|
16
16
|
end
|
17
17
|
|
18
|
-
actions :allocate, :ready, :setup, :converge, :converge_only, :destroy, :stop
|
18
|
+
actions :allocate, :ready, :setup, :converge, :converge_only, :destroy, :stop, :ready_only
|
19
19
|
default_action :converge
|
20
20
|
|
21
21
|
attribute :machines, :kind_of => [ Array ]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-provisioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Keiser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
version: '0'
|
230
230
|
requirements: []
|
231
231
|
rubyforge_project:
|
232
|
-
rubygems_version: 2.7.
|
232
|
+
rubygems_version: 2.7.6
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: A library for creating machines and infrastructures idempotently in Chef.
|