Skip to content

Commit a1a8924

Browse files
author
Yvonne Lam
committed
[CLOUD-261][CLOUD-262] Update to packer 1.1.0:
* [CLOUD-262] packer > 0.10.1 uses its own `azure-arm` builder, obsoleting use of the `packer-azure` plugin. This requires new azure builder attributes in the `publishing_credentials.json` file. * packer >= 1.0.1 supports alicloud, enabling #43. Signed-off-by: Yvonne Lam <[email protected]>
1 parent 998ba20 commit a1a8924

File tree

4 files changed

+19
-32
lines changed

4 files changed

+19
-32
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,10 @@ hash for each cloud. If you wish to run these builders you'll need to create a
102102
{
103103
"id": "publishing_credentials",
104104
"azure": {
105-
"publish_settings": {
106-
"schema_version": "2.0",
107-
"publish_method": "AzureServiceManagementAPI",
108-
"service_management_url": "https://management.core.windows.net",
109-
"subscription_id": "1XXXXXX-XXXX-XXXX-XXXXXXXXXX",
110-
"subscription_name": "Partner Engineering",
111-
"management_certificate": "MIIKDAIXXXXXXX....."
112-
}
105+
"subscription_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
106+
"subscription_name": "XXXXXXXXXXXXXXXXXXXX",
107+
"client_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
108+
"client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
113109
},
114110
"gce": {
115111
"account": {

attributes/azure.rb

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
# frozen_string_literal: true
2-
cred_dir = ::File.expand_path(::File.join('~', '.azure'))
3-
publish_settings_path = ::File.join(cred_dir, 'marketplace.publish_settings')
4-
5-
default['marketplace_image']['azure']['cred_dir'] = cred_dir
6-
default['marketplace_image']['azure']['publish_settings_path'] = publish_settings_path
72

83
default['marketplace_image']['azure']['automate']['enabled'] = false
94
default['marketplace_image']['azure']['compliance']['enabled'] = false
@@ -21,18 +16,24 @@
2116
'free_node_count' => 5,
2217
}
2318

19+
creds = Chef::DataBagItem.load('marketplace_image', 'publishing_credentials')
20+
2421
azure_builder_config = {
2522
'name' => 'azure_automate_BYOL',
26-
'type' => 'azure',
27-
'publish_settings_path' => publish_settings_path,
28-
'subscription_name' => 'Partner Engineering',
29-
'storage_account' => 'ampimages',
30-
'storage_account_container' => 'images',
23+
'type' => 'azure-arm',
24+
'subscription_id' => "#{creds['azure']['subscription_id']}",
25+
'client_id' => "#{creds['azure']['client_id']}",
26+
'client_secret' => "#{creds['azure']['client_secret']}",
27+
'resource_group_name' => 'publish-marketplace-images',
28+
'storage_account' => 'marketplaceimages',
29+
'capture_container_name' => 'vhds',
3130
'os_type' => 'Linux',
32-
'os_image_label' => 'Ubuntu Server 14.04 LTS',
31+
'image_publisher' => 'Canonical',
32+
'image_offer' => 'UbuntuServer',
33+
'image_sku' => '14.04.5-LTS',
3334
'location' => 'East US',
34-
'instance_size' => 'Large',
35-
'user_image_label' => 'Chef_Automate_BYOL_{{timestamp}}',
35+
'vm_size' => 'Standard_D3_v2',
36+
'capture_name_prefix' => 'Chef_Automate_BYOL',
3637
}
3738

3839
default['marketplace_image']['azure']['automate'] = {

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
chef_version '>=12.19'
1111

12-
depends 'packman'
12+
depends 'packman' '>=0.2.0'

recipes/_packer.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@
1212

1313
creds = data_bag_item('marketplace_image', 'publishing_credentials')
1414

15-
if creds['azure']
16-
directory node['marketplace_image']['azure']['cred_dir']
17-
18-
template node['marketplace_image']['azure']['publish_settings_path'] do
19-
sensitive true
20-
source 'azure_publish_settings.xml.erb'
21-
variables creds['azure']['publish_settings']
22-
end
23-
end
24-
2515
if creds['aws']
2616
directory node['marketplace_image']['aws']['cred_dir']
2717

0 commit comments

Comments
 (0)