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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9060b24040ec2faae87ec415112744e9b8096343
4
- data.tar.gz: ec42e07ae52eab81c4c98698e3f808f5aea22fe5
3
+ metadata.gz: 83694d23fa025448468c6aa38dbdbc70d242b80b
4
+ data.tar.gz: f4a71ac9acfccc7759711de5a4e88aa4ce1bbd1b
5
5
  SHA512:
6
- metadata.gz: d799f853b9a7690e653d05c914c1ab30056c70b7a90d6fc22b437a29f1be67aac29245668b26b0f7b8471f61f4c5307481ea026497293246b8a137ea74ec523f
7
- data.tar.gz: 7f11e3d6e2d90225ab090a3a2151b537c466b886bcb0e3c9a047adfa0bdc4ddeda74638f05681034e46ce4c7ea77335624d5565f2749a7e9a777e2e3e85b74ce
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'] || {}
@@ -1,4 +1,4 @@
1
1
  # Namespace for our gem
2
2
  module ChefProvisioner
3
- VERSION = '0.1.10'
3
+ VERSION = '0.1.11'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-provisioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel