chef-provisioning-azurerm 0.2.13 → 0.2.14

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: 3bc8954f652b4e9e0c187af25e826b9697a481b9
4
- data.tar.gz: 7d31389186510e55772e288295a3c49dd7db0c72
3
+ metadata.gz: 5ce684d583f8223fed12875b2a5c20f5d7d2469f
4
+ data.tar.gz: 03fa0cb67a11529b6e6283260cb1a10450b5cf5d
5
5
  SHA512:
6
- metadata.gz: 7d75d0088713568db277278775e8266ac292361e283ec6f7c58cfa739615246819b31ac9f7a31c25c8511a2ad6a927a036fcb24913a37bf299dcd0f8c3a44db7
7
- data.tar.gz: 2d620e0b6f9e95024ab99bb7b4902cfbbd0a349b9c5e16157f0f8e494808894244cf641304fb3f09898d29c84ce803d006dc8ad3a79ba4764caacbeb171618b4
6
+ metadata.gz: 649403838de5e0117c036b720285f9044c5b346dab7fc858f27c0f50c33cb7047e94f94e2afbb700eb53d576bde0e82bbcfcb62386c2186586ccdb6a73c1a04c
7
+ data.tar.gz: e5de378badabaf21b4c20868f48b7b9246674492b70b3768cc5c284445826962c9286eb7ff7e797643414c0cab187cb82e66f02481cd1af9343e611e986b5351
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
- # Change Log
2
- ## [0.2.13] 2015-08-20
1
+ # chef-provisioning-azurerm Changelog
2
+
3
+ ## [0.2.14] - 2015-08-21
4
+ ### Changed
5
+ - Minimize logging to info, favour action_handler.report_progress
6
+
7
+ ## [0.2.13] - 2015-08-20
3
8
  ### Changed
4
9
  - chef_extension parameters are now required if the Chef VM Extension is to be added to compute resources.
5
10
  - Updated README to include explanation of valid chef_extension parameters
@@ -8,5 +13,3 @@
8
13
  ### Added
9
14
  - Updated examples and README
10
15
  - Rubocop compliance
11
-
12
- ## [0.2.11] - 2015-08
@@ -21,7 +21,7 @@ class Chef
21
21
  if new_resource.chef_extension
22
22
  machines = template['resources'].select { |h| h['type'] == 'Microsoft.Compute/virtualMachines' }
23
23
  machines.each do |machine|
24
- Chef::Log.info("[Azure] Found a compute resource with name value: #{machine['name']} and location #{machine['location']}, adding a Chef VM Extension to it.")
24
+ action_handler.report_progress "Found a compute resource with name: #{machine['name']} and location: #{machine['location']}, adding a Chef VM Extension to it."
25
25
  extension = chef_vm_extension(machine['name'], machine['location'])
26
26
  template['resources'] << JSON.parse(extension)
27
27
  end
@@ -48,7 +48,6 @@ class Chef
48
48
  end
49
49
 
50
50
  def chef_vm_extension(machine_name, location)
51
- Chef::Log.debug("[Azure] Config: #{Chef::Config.inspect}")
52
51
  chef_server_url = Chef::Config[:chef_server_url]
53
52
  validation_client_name = Chef::Config[:validation_client_name]
54
53
  validation_key_content = ::File.read(Chef::Config[:validation_key])
@@ -85,7 +84,13 @@ class Chef
85
84
  url = "https://management.azure.com/subscriptions/#{new_resource.subscription_id}/resourcegroups/" \
86
85
  "#{new_resource.resource_group}/providers/microsoft.resources/deployments/#{new_resource.name}" \
87
86
  '?api-version=2015-01-01'
88
- azure_call(:put, url, doc.to_json)
87
+ action_handler.report_progress "Posting Resource Template to #{url}.\n"
88
+ response = azure_call(:put, url, doc.to_json)
89
+ if response.code.to_i == 200 || response.code.to_i == 201
90
+ action_handler.report_progress "Accepted Resource Template #{new_resource.name} for deployment.\n"
91
+ else
92
+ fail "#{response.body}" if response.body
93
+ end
89
94
  end
90
95
 
91
96
  def validate_template_deployment(doc)
@@ -109,6 +114,7 @@ class Chef
109
114
 
110
115
  until end_provisioning_state_reached
111
116
  response = azure_call(:get, url, '')
117
+ Chef::Log.debug("Response body: #{response.body}") if response.body
112
118
  deployment_operations = JSON.parse(response.body)
113
119
  deployment_operations['value'].each do |val|
114
120
  resource_provisioning_state = val['properties']['provisioningState']
@@ -116,7 +122,7 @@ class Chef
116
122
  resource_type = val['properties']['targetResource']['resourceType']
117
123
  end_operation_state_reached = end_operation_states.split(',').include?(resource_provisioning_state)
118
124
  unless end_operation_state_reached
119
- Chef::Log.info("[Azure] Resource #{resource_type} '#{resource_name}' provisioning status is #{resource_provisioning_state}")
125
+ action_handler.report_progress "Resource #{resource_type} '#{resource_name}' provisioning status is #{resource_provisioning_state}\n"
120
126
  end
121
127
  end
122
128
  sleep 5
@@ -124,7 +130,7 @@ class Chef
124
130
  Chef::Log.debug("[Azure] Resource Template deployment is in a state of '#{provisioning_state}'")
125
131
  end_provisioning_state_reached = end_provisioning_states.split(',').include?(provisioning_state)
126
132
  end
127
- Chef::Log.info("[Azure] Resource Template deployment reached end state of '#{provisioning_state}'")
133
+ action_handler.report_progress "Resource Template deployment reached end state of '#{provisioning_state}'."
128
134
  end
129
135
 
130
136
  def retrieve_provisioning_state
@@ -2,10 +2,8 @@ require 'chef/provisioning'
2
2
  require 'chef/provisioning/version'
3
3
  require 'chef/provisioning/azurerm/driver'
4
4
  require 'chef/provisioning/azurerm/version'
5
- Chef::Log.info(' __ _ _____ _ _ __ ___ ')
6
- Chef::Log.info(" / _` |_ / | | | '__/ _ \\ chef-client #{Chef::VERSION}")
7
- Chef::Log.info("| (_| |/ /| |_| | | | __/ chef-provisioning-azurerm #{Chef::Provisioning::AzureRM::VERSION}")
8
- Chef::Log.info(" \\__,_/___|\\__,_|_| \\___| chef-provisioning #{Chef::Provisioning::VERSION}")
5
+ Chef::Log.info("chef-provisioning-azurerm #{Chef::Provisioning::AzureRM::VERSION}")
6
+ Chef::Log.info("chef-provisioning #{Chef::Provisioning::VERSION}")
9
7
 
10
8
  resources = %w(resource_group resource_template storage_account)
11
9
  resources.each do |r|
@@ -37,7 +37,7 @@ class Chef
37
37
  end
38
38
  response
39
39
  end
40
-
40
+
41
41
  # Wraps a call to the Azure REST API with retry and timeout capability.
42
42
  def azure_call_until_expected_response(method, url, data, success_codes, wait_time)
43
43
  time_elapsed = 0
@@ -1,7 +1,7 @@
1
1
  class Chef
2
2
  module Provisioning
3
3
  module AzureRM
4
- VERSION = '0.2.13'
4
+ VERSION = '0.2.14'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-provisioning-azurerm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Preston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-20 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef