chef-provisioner 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef-provisioner/bootstrap.rb +4 -4
- data/lib/chef-provisioner/chef.rb +4 -3
- data/lib/chef-provisioner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83694d23fa025448468c6aa38dbdbc70d242b80b
|
4
|
+
data.tar.gz: f4a71ac9acfccc7759711de5a4e88aa4ce1bbd1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7012783e4b8715160b13444a95f7605d86f7ec2f5b2f410efe2d3720b4a369f17fccbc3f810a3c05937d9510e186e8b1a40e601aa22adf2fd9089fdf997e1854
|
7
|
+
data.tar.gz: a4b66de397dfe48d7686d9cd936efe4f4c4fb7ad8c3e69d2680c0aeab37b90cbf56c0bf30f88e65cab9cf7cace795f9381e482d7e6ae373001073086287a7cf1
|
@@ -15,8 +15,8 @@ module ChefProvisioner
|
|
15
15
|
run_list = first_boot[:run_list] if first_boot[:run_list] # FIXME - symbolize keys instead of the dup here
|
16
16
|
run_list = first_boot['run_list'] if first_boot['run_list']
|
17
17
|
first_boot.merge!( fqdn: node_name, chef_client: {config: {chef_server_url: server}} )
|
18
|
-
client_pem = get_client_key(node_name, run_list, force, retries)
|
19
|
-
render(node_name: node_name, client_pem: client_pem, chef_version: chef_version, environment: environment, server: server, first_boot: first_boot, reinstall: reinstall, audit: audit, profile: profile)
|
18
|
+
client_pem = get_client_key(node_name, environment, run_list, force, retries)
|
19
|
+
render(node_name: node_name, client_pem: client_pem, chef_version: chef_version, environment: environment, server: server, first_boot: first_boot, reinstall: reinstall, audit: audit, chef_cmd: chef_cmd, profile: profile)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -25,11 +25,11 @@ module ChefProvisioner
|
|
25
25
|
ERB.new(BOOTSTRAP_TEMPLATE).result(OpenStruct.new(**kwargs).instance_eval { binding })
|
26
26
|
end
|
27
27
|
|
28
|
-
def get_client_key(node_name, run_list, force, retries)
|
28
|
+
def get_client_key(node_name, environment, run_list, force, retries)
|
29
29
|
client_pem = ''
|
30
30
|
attempts = 0
|
31
31
|
while client_pem.empty? && attempts < retries
|
32
|
-
client_pem = ChefProvisioner::Chef.init_server(node_name, run_list: (run_list || []), force: force)
|
32
|
+
client_pem = ChefProvisioner::Chef.init_server(node_name, environment: environment, run_list: (run_list || []), force: force)
|
33
33
|
attempts += 1
|
34
34
|
sleep(5)
|
35
35
|
end
|
@@ -16,10 +16,10 @@ module ChefProvisioner
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def init_server(name, attributes:{}, run_list:[], force: false)
|
19
|
+
def init_server(name, environment: '_default', attributes:{}, run_list:[], force: false)
|
20
20
|
nuke(name) if force
|
21
21
|
key = create_client(name) || ''
|
22
|
-
create_node(name, attributes: attributes, run_list: run_list) unless key.empty?
|
22
|
+
create_node(name, environment, attributes: attributes, run_list: run_list) unless key.empty?
|
23
23
|
key
|
24
24
|
end
|
25
25
|
|
@@ -31,8 +31,9 @@ module ChefProvisioner
|
|
31
31
|
puts e.message
|
32
32
|
end
|
33
33
|
|
34
|
-
def create_node(name, attributes:{}, run_list:[])
|
34
|
+
def create_node(name, environment, attributes:{}, run_list:[])
|
35
35
|
node = ChefAPI::Resource::Node.create(name: name, run_list: run_list)
|
36
|
+
node.chef_environment = environment
|
36
37
|
node.automatic = attributes['automatic'] || {}
|
37
38
|
node.default = attributes['default'] || {}
|
38
39
|
node.normal = attributes['normal'] || {}
|