foreman_azure_rm 2.0.8 → 2.1.0

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
  SHA256:
3
- metadata.gz: a2d29d9fff7cb29f082a0c008cd3d9b79bf57f393db10f361abf90fbbd6509d5
4
- data.tar.gz: 40bd288f1f3767674748b10db7592c1dfaab600dcd1d0ff87a858a63787a5690
3
+ metadata.gz: cca0d2f188d4731dbf29f7875aad1000fc3f176306dda4083caf2d053093f55f
4
+ data.tar.gz: d316ee9bb58752babbeb553ab24b9d1e62e496b1596dc0477b7ed839f45d3fc1
5
5
  SHA512:
6
- metadata.gz: f602a038538c724ca912136bc02f6d6800b113eae462fdf860bcb24823af283767d95fae75811f76b622191b374dc8ebb5bb17c02656c2acf93aa2ef909fc47d
7
- data.tar.gz: daf44548c0678ceb8ca3f00c7e5b7ad66f7f66ad337c2e09c2dd0b4ad697fa0ca935a0d559f3b0e39ea3b77d375315e100dfd3f5c547e60ef85eb8d76b2e23b8
6
+ metadata.gz: 9cef189f01b675262daed8b5a42b9a2324ad0952cda775a6484b3d45c45ff89b0742558c4a6f5d166a52bb3d5b749870a40d65d1a8e92de709e9615e2eb693de
7
+ data.tar.gz: b7c2a5d6fc6e5bb6b0127eb0a52a307e93abb7fafbd419d09064e8fe15e3c0d7b4e9e4c14fd7c83feff5b55687021084a25d4a6ee74bc581885aa4266ba645fe
@@ -0,0 +1,13 @@
1
+ module AzureComputeResourceHelper
2
+ def regions_list(azurerm_cr, f)
3
+ begin
4
+ regions = azurerm_cr.regions || []
5
+ rescue StandardError
6
+ #do nothing
7
+ regions = []
8
+ rescue Exception => ex
9
+ return information_box("Regions could not be loaded due to exception: #{ex}")
10
+ end
11
+ selectable_f(f, :url, regions, {}, {:label => _('Azure Region'), :disabled => regions.empty?, :required => true, :help_inline_permanent => load_button_f(f, regions.present?, _("Load Regions")) })
12
+ end
13
+ end
@@ -13,19 +13,7 @@ module ForemanAzureRm
13
13
  os_disk.name = "#{vm_name}-osdisk"
14
14
  os_disk.os_type = platform
15
15
  os_disk.create_option = ComputeModels::DiskCreateOptionTypes::FromImage
16
- os_disk.caching = if os_disk_caching.present?
17
- case os_disk_caching
18
- when 'None'
19
- ComputeModels::CachingTypes::None
20
- when 'ReadOnly'
21
- ComputeModels::CachingTypes::ReadOnly
22
- when 'ReadWrite'
23
- ComputeModels::CachingTypes::ReadWrite
24
- end
25
- else
26
- # ARM best practices stipulate RW caching on the OS disk
27
- ComputeModels::CachingTypes::ReadWrite
28
- end
16
+ os_disk.caching = disk_caching(os_disk_caching)
29
17
  managed_disk_params.storage_account_type = if premium_os_disk == 'true'
30
18
  ComputeModels::StorageAccountTypes::PremiumLRS
31
19
  else
@@ -33,10 +21,44 @@ module ForemanAzureRm
33
21
  end
34
22
  os_disk.managed_disk = managed_disk_params
35
23
  storage_profile.os_disk = os_disk
36
-
37
24
  storage_profile
38
25
  end
39
26
 
27
+ def disk_caching(disk_type_caching)
28
+ case disk_type_caching
29
+ when 'None'
30
+ ComputeModels::CachingTypes::None
31
+ when 'ReadOnly'
32
+ ComputeModels::CachingTypes::ReadOnly
33
+ when 'ReadWrite'
34
+ ComputeModels::CachingTypes::ReadWrite
35
+ when nil, ""
36
+ nil
37
+ else
38
+ raise RuntimeError, "Disk caching value must be either 'None', 'ReadOnly' or 'ReadWrite'."
39
+ end
40
+ end
41
+
42
+ def define_data_disks(vm_name, data_disks)
43
+ unless data_disks.nil?
44
+ disks = []
45
+ disk_count = 0
46
+ data_disks.each do |disk_num, attrs|
47
+ managed_data_disk = ComputeModels::ManagedDiskParameters.new
48
+ disk = ComputeModels::DataDisk.new
49
+ disk.name = "#{vm_name}-data-disk#{disk_count}"
50
+ disk.caching = disk_caching(attrs[:data_disk_caching])
51
+ disk.disk_size_gb = attrs[:disk_size_gb]
52
+ disk.create_option = ComputeModels::DiskCreateOption::Empty
53
+ disk.lun = disk_count + 1
54
+ disk.managed_disk = managed_data_disk
55
+ disk_count += 1
56
+ disks << disk
57
+ end
58
+ disks
59
+ end
60
+ end
61
+
40
62
  def marketplace_image_reference(publisher, offer, sku, version)
41
63
  image_reference = ComputeModels::ImageReference.new
42
64
  image_reference.publisher = publisher
@@ -46,26 +68,25 @@ module ForemanAzureRm
46
68
  image_reference
47
69
  end
48
70
 
49
- def define_image(image_id)
50
- # If image UUID begins with / it is a custom managed image
51
- # Otherwise it is a marketplace URN
52
- unless image_id.start_with?('/')
71
+ def define_image(rg_name, image)
72
+ image_type, image_id = image.split('://')
73
+ case image_type
74
+ when 'marketplace'
53
75
  urn = image_id.split(':')
54
76
  publisher = urn[0]
55
77
  offer = urn[1]
56
78
  sku = urn[2]
57
79
  version = urn[3]
58
- image_id = nil
59
- end
60
-
61
- if image_id.nil?
62
- # For marketplace image
63
80
  image_reference = marketplace_image_reference(publisher, offer, sku, version)
81
+ when 'custom'
82
+ custom_image = sdk.get_custom_image(rg_name, image_id)
83
+ image_reference = ComputeModels::ImageReference.new
84
+ image_reference.id = custom_image.id
85
+ when 'gallery'
86
+ image_reference = ComputeModels::ImageReference.new
87
+ image_reference.id = sdk.fetch_gallery_image_id(rg_name, image_id)
64
88
  else
65
- # For custom managed image
66
- image_ref = ComputeModels::ImageReference.new
67
- image_ref.id = image_id
68
- image_reference = image_ref
89
+ image_reference = nil
69
90
  end
70
91
  image_reference
71
92
  end
@@ -189,7 +210,8 @@ module ForemanAzureRm
189
210
  def create_managed_virtual_machine(vm_hash)
190
211
  vm_params = initialize_vm(vm_hash)
191
212
  vm_params.network_profile = define_network_profile(vm_hash[:network_interface_card_ids])
192
- vm_params.storage_profile.image_reference = define_image(vm_hash[:image_id])
213
+ vm_params.storage_profile.image_reference = define_image(vm_hash[:resource_group], vm_hash[:image_id])
214
+ vm_params.storage_profile.data_disks = define_data_disks(vm_hash[:name], vm_hash[:data_disks])
193
215
  sdk.create_or_update_vm(vm_hash[:resource_group], vm_hash[:name], vm_params)
194
216
  end
195
217
 
@@ -12,12 +12,14 @@ module ForemanAzureRm
12
12
  alias_attribute :region, :url
13
13
  alias_attribute :tenant, :uuid
14
14
 
15
- validates :user, :password, :url, :uuid, :app_ident, :presence => true
15
+ validates :user, :password, :uuid, :app_ident, :presence => true
16
16
 
17
17
  has_one :key_pair, :foreign_key => :compute_resource_id, :dependent => :destroy
18
18
 
19
19
  before_create :test_connection, :setup_key_pair
20
20
 
21
+ validate :ensure_attributes_and_values
22
+
21
23
  class VMContainer
22
24
  attr_accessor :virtualmachines
23
25
  delegate :each, to: :virtualmachines
@@ -47,6 +49,15 @@ module ForemanAzureRm
47
49
  "#{name} (#{provider_friendly_name})"
48
50
  end
49
51
 
52
+ def ensure_attributes_and_values
53
+ validate_region
54
+ end
55
+
56
+ def validate_region
57
+ return unless regions.present?
58
+ errors.add(:region, "is not valid, must be lowercase eg. 'eastus'. No special characters allowed.") unless regions.collect(&:second).include?(region)
59
+ end
60
+
50
61
  def self.model_name
51
62
  ComputeResource.model_name
52
63
  end
@@ -56,81 +67,35 @@ module ForemanAzureRm
56
67
  end
57
68
 
58
69
  def capabilities
59
- [:image]
60
- end
61
-
62
- def self.regions
63
- [
64
- ['West Europe', 'westeurope'],
65
- ['Central US', 'centralus'],
66
- ['South Central US', 'southcentralus'],
67
- ['North Central US', 'northcentralus'],
68
- ['West Central US', 'westcentralus'],
69
- ['East US', 'eastus'],
70
- ['East US 2', 'eastus2'],
71
- ['West US', 'westus'],
72
- ['West US 2', 'westus2'],
73
- ['Canada Central', 'canadacentral'],
74
- ['Canada East', 'canadaeast'],
75
- ['Brazil South', 'brazilsouth'],
76
- ['North Europe', 'northeurope'],
77
- ['France Central', 'francecentral'],
78
- ['France South', 'francesouth'],
79
- ['UK South', 'uksouth'],
80
- ['UK West', 'ukwest'],
81
- ['Germany Central', 'germanycentral'],
82
- ['Germany Northeast', 'germanynortheast'],
83
- ['Germany West Central', 'germanywestcentral'],
84
- ['Germany North', 'germanynorth'],
85
- ['Switzerland North', 'switzerlandnorth'],
86
- ['Switzerland West', 'switzerlandwest'],
87
- ['Norway West', 'norwaywest'],
88
- ['Norway East', 'norwayeast'],
89
- ['East Asia', 'eastasia'],
90
- ['Southeast Asia', 'southeastasia'],
91
- ['Australia Central', 'australiacentral'],
92
- ['Australia Central 2', 'australiacentral2'],
93
- ['Australia East', 'australiaeast'],
94
- ['Australia Southeast', 'australiasoutheast'],
95
- ['China East', 'chinaeast'],
96
- ['China North', 'chinanorth'],
97
- ['China East 2', 'chinaeast2'],
98
- ['China North 2', 'chinanorth2'],
99
- ['Central India', 'centralindia'],
100
- ['South India', 'southindia'],
101
- ['West India', 'westindia'],
102
- ['Japan East', 'japaneast'],
103
- ['Japan West', 'japanwest'],
104
- ['Korea Central', 'koreacentral'],
105
- ['Korea South', 'koreasouth'],
106
- ['South Africa North', 'southafricanorth'],
107
- ['South Africa West', 'southafricawest'],
108
- ['UAE Central', 'uaecentral'],
109
- ['UAE North', 'uaenorth']
110
- ]
111
- end
112
-
113
- validates :region, inclusion: { in: regions.collect(&:second),
114
- message: "%{value} must be lowercase eg. 'eastus'. No special characters allowed." }
70
+ [:image, :new_volume]
71
+ end
72
+
73
+ def regions
74
+ return unless sub_id.present?
75
+ sdk.list_regions(sub_id).value.map { |loc| [loc.display_name, loc.name] }
76
+ end
115
77
 
116
78
  def resource_groups
117
79
  sdk.rgs
118
80
  end
119
81
 
120
82
  def test_connection(options = {})
121
- sdk.rgs.each do |rg|
122
- puts "#{rg}"
123
- end
124
- super(options)
83
+ super
84
+ errors[:user].empty? && errors[:password].empty? && errors[:uuid].empty? && errors[:app_ident].empty? && regions
85
+ rescue StandardError => e
86
+ errors[:base] << e.message
87
+ rescue Excon::Error::Socket => e
88
+ errors[:base] << e.message
125
89
  end
126
90
 
127
91
  def new_vm(args = {})
128
92
  return AzureRmCompute.new(sdk: sdk) if args.empty?
129
93
  opts = vm_instance_defaults.merge(args.to_h).deep_symbolize_keys
130
94
  # convert rails nested_attributes into a plain hash
131
- nested_args = opts.delete(:interfaces_attributes)
132
- opts[:interfaces] = nested_attributes_for(:interfaces, nested_args) if nested_args
133
-
95
+ [:interfaces, :volumes].each do |collection|
96
+ nested_args = opts.delete("#{collection}_attributes".to_sym)
97
+ opts[collection] = nested_attributes_for(collection, nested_args) if nested_args
98
+ end
134
99
  opts.reject! { |k, v| v.nil? }
135
100
 
136
101
  raw_vm = initialize_vm(location: region,
@@ -149,13 +114,54 @@ module ForemanAzureRm
149
114
  ifaces << new_interface(iface_attrs)
150
115
  end
151
116
  end
152
- AzureRmCompute.new(azure_vm: raw_vm ,sdk: sdk, resource_group: opts[:resource_group], nics: ifaces, script_command: opts[:script_command], script_uris: opts[:script_uris])
117
+
118
+ vols = opts.fetch(:volumes, []).map { |vols_attrs| new_volume(vols_attrs) } if opts[:volumes].present?
119
+
120
+ AzureRmCompute.new(azure_vm: raw_vm ,sdk: sdk, resource_group: opts[:resource_group], nics: ifaces, volumes: vols, script_command: opts[:script_command], script_uris: opts[:script_uris])
153
121
  end
154
122
 
155
123
  def provided_attributes
156
124
  super.merge({ :ip => :provisioning_ip_address })
157
125
  end
158
126
 
127
+ def image_exists?(image)
128
+ image_type, image_id = image.split('://')
129
+ case image_type
130
+ when 'marketplace'
131
+ begin
132
+ urn = image_id.split(':')
133
+ publisher = urn[0]
134
+ offer = urn[1]
135
+ sku = urn[2]
136
+ version = urn[3]
137
+ if version == "latest"
138
+ all_versions = sdk.list_versions(region, publisher, offer, sku).map(&:name)
139
+ return true if all_versions.any?
140
+ end
141
+ sdk.get_marketplace_image(region, publisher, offer, sku, version).present?
142
+ rescue StandardError => e
143
+ return false
144
+ end
145
+ when 'gallery'
146
+ gallery_images_list = sdk.list_resources(filter: "resourceType eq 'Microsoft.Compute/galleries/images'")
147
+ gallery_image = gallery_images_list.detect { |gal_img| gal_img.id.split('/')[-1] == image_id }
148
+ if gallery_image.present?
149
+ rg_name = gallery_image.id.split('/')[4]
150
+ gallery_name = gallery_image.name.split('/')[0]
151
+ image_versions = sdk.list_gallery_image_versions(rg_name, gallery_name, image_id)
152
+ target_regions = image_versions.map do |image_version|
153
+ image_version.publishing_profile.target_regions.map(&:name)
154
+ end.flatten.uniq.map { |tgt_reg| tgt_reg.gsub(/\s+/, '').downcase }
155
+ return true if target_regions.include? region
156
+ end
157
+ when 'custom'
158
+ custom_image = sdk.list_custom_images.detect { |custom_img| custom_img.name == image_id && custom_img.location == region }
159
+ return custom_image.present?
160
+ else
161
+ false
162
+ end
163
+ end
164
+
159
165
  def available_vnets(attr = {})
160
166
  virtual_networks
161
167
  end
@@ -188,6 +194,11 @@ module ForemanAzureRm
188
194
  true
189
195
  end
190
196
 
197
+ def new_volume(attrs = {})
198
+ args = { :disk_size_gb => 0, :data_disk_caching => "", 'persisted?' => false }.merge(attrs.to_h)
199
+ OpenStruct.new(args)
200
+ end
201
+
191
202
  def vm_sizes
192
203
  sdk.list_vm_sizes(region)
193
204
  end
@@ -198,7 +209,8 @@ module ForemanAzureRm
198
209
 
199
210
  def vm_instance_defaults
200
211
  super.deep_merge(
201
- interfaces: [new_interface]
212
+ interfaces: [new_interface],
213
+ volumes: [new_volume]
202
214
  )
203
215
  end
204
216
 
@@ -212,6 +224,10 @@ module ForemanAzureRm
212
224
  ifaces
213
225
  end
214
226
 
227
+ def vm_disks(vm)
228
+ vm.storage_profile.data_disks
229
+ end
230
+
215
231
  def vms(attrs = {})
216
232
  container = VMContainer.new
217
233
  # Load all vms of the region
@@ -276,6 +292,7 @@ module ForemanAzureRm
276
292
  image_id: args[:image_id],
277
293
  os_disk_caching: args[:os_disk_caching],
278
294
  premium_os_disk: args[:premium_os_disk],
295
+ data_disks: args[:volumes_attributes],
279
296
  custom_data: args[:user_data],
280
297
  script_command: args[:script_command],
281
298
  script_uris: args[:script_uris],
@@ -283,7 +300,7 @@ module ForemanAzureRm
283
300
  logger.debug "Virtual Machine #{args[:vm_name]} Created Successfully."
284
301
  create_vm_extension(region, args)
285
302
  # return the vm object using azure_vm
286
- AzureRmCompute.new(azure_vm: vm, sdk: sdk, resource_group: args[:resource_group], nics: vm_nics(vm), script_command: user_command, script_uris: args[:script_uris])
303
+ AzureRmCompute.new(azure_vm: vm, sdk: sdk, resource_group: args[:resource_group], nics: vm_nics(vm), volumes: vm_disks(vm), script_command: user_command, script_uris: args[:script_uris])
287
304
  rescue RuntimeError => e
288
305
  Foreman::Logging.exception('Unhandled AzureRm error', e)
289
306
  destroy_vm vm.id if vm
@@ -310,10 +327,8 @@ module ForemanAzureRm
310
327
  end
311
328
  end
312
329
  end
313
- if os_disk.present?
314
- sdk.delete_disk(rg_name, os_disk.name)
315
- end
316
-
330
+ sdk.delete_disk(rg_name, os_disk.name) if os_disk.present?
331
+ data_disks.each { |data_disk| sdk.delete_disk(rg_name, data_disk.name) } if data_disks.present?
317
332
  true
318
333
  rescue ActiveRecord::RecordNotFound
319
334
  logger.info "Could not find the selected vm."
@@ -5,6 +5,7 @@ module ForemanAzureRm
5
5
  attr_accessor :resource_group
6
6
  attr_accessor :nics
7
7
  attr_accessor :script_command, :script_uris
8
+ attr_accessor :volumes
8
9
 
9
10
  delegate :name, to: :azure_vm, allow_nil: true
10
11
 
@@ -12,6 +13,7 @@ module ForemanAzureRm
12
13
  sdk: sdk,
13
14
  resource_group: azure_vm.resource_group,
14
15
  nics: [],
16
+ volumes: [],
15
17
  script_command: nil,
16
18
  script_uris: nil)
17
19
 
@@ -19,6 +21,7 @@ module ForemanAzureRm
19
21
  @sdk = sdk
20
22
  @resource_group ||= resource_group
21
23
  @nics ||= nics
24
+ @volumes ||= volumes
22
25
  @script_command ||= script_command
23
26
  @script_uris ||= script_uris
24
27
  @azure_vm.hardware_profile ||= ComputeModels::HardwareProfile.new
@@ -119,6 +122,20 @@ module ForemanAzureRm
119
122
  []
120
123
  end
121
124
 
125
+ def data_disks
126
+ @data_disks ||= @azure_vm.storage_profile.data_disks || []
127
+ end
128
+
129
+ def volumes
130
+ return @volumes if data_disks.empty?
131
+ volumes = data_disks.map do |disk|
132
+ OpenStruct.new(:disk => disk, :persisted? => true)
133
+ end
134
+ end
135
+
136
+ def volumes_attributes=(attrs)
137
+ end
138
+
122
139
  def identity
123
140
  @azure_vm.name
124
141
  end
@@ -169,7 +186,17 @@ module ForemanAzureRm
169
186
  def image_uuid
170
187
  image = @azure_vm.storage_profile.image_reference
171
188
  return nil unless image
172
- "#{image.publisher}:#{image.offer}:#{image.sku}:#{image.version}"
189
+ if image.id.nil?
190
+ return "marketplace://#{image.publisher}:#{image.offer}:#{image.sku}:#{image.version}"
191
+ else
192
+ image_rg = image.id.split('/')[4]
193
+ image_name = image.id.split('/')[-1]
194
+ if sdk.list_custom_images.find { |custom_img| custom_img.name == image_name }
195
+ return "custom://#{image_name}"
196
+ elsif sdk.fetch_gallery_image_id(image_rg, image_name)
197
+ return "gallery://#{image_name}"
198
+ end
199
+ end
173
200
  end
174
201
 
175
202
  alias_method :image_id, :image_uuid
@@ -3,8 +3,4 @@
3
3
  <%= text_f f, :user, :label => _('Subscription ID'), :required => true %>
4
4
  <%= text_f f, :uuid, :label => _('Tenant ID'), :required => true %>
5
5
 
6
- <%= selectable_f(f, :url, f.object.class.regions, {}, {:label => _('Azure Region'), :label_help => _("Some of the listed regions might not be supported for your subscription. Please verify on Azure portal."), :required => true }) %>
7
-
8
- <div class="col-md-offset-2">
9
- <%= test_connection_button_f(f, true) %>
10
- </div>
6
+ <%= regions_list(@compute_resource, f) %>
@@ -155,7 +155,7 @@
155
155
  %>
156
156
 
157
157
  <%= selectable_f f, :os_disk_caching, %w(None ReadOnly ReadWrite),
158
- { :include_blank => _('Please select OS Disk Caching method') },
158
+ { :include_blank => _("Azure's Default") },
159
159
  {
160
160
  :label => _('OS Disk Caching'),
161
161
  :label_help => _("Default ReadWrite"),
@@ -0,0 +1,20 @@
1
+ <%= number_f f, :disk_size_gb,
2
+ {
3
+ :class => "col-md-2",
4
+ :label => _("Size (GB)"), :label_size => "col-md-2",
5
+ :required => true,
6
+ :min => 0,
7
+ :value => f.object.disk_size_gb || f.object.disk.disk_size_gb,
8
+ :help_inline => _("Additional number of disks can be added based on VM Size. For more details, please refer to Microsoft Azure's documentation")
9
+ }
10
+ %>
11
+
12
+ <%= selectable_f f, :data_disk_caching, options_for_select(["None", "ReadOnly", "ReadWrite"],
13
+ :selected => f.object.data_disk_caching || f.object.disk.caching),
14
+ { :include_blank => _("Azure's default") },
15
+ {
16
+ :class => "col-md-2",
17
+ :label => _('Data Disk Caching'),
18
+ :required => true
19
+ }
20
+ %>
@@ -2,5 +2,5 @@
2
2
  :help_inline => _("The user that will be used to SSH into the VM for completion")
3
3
  %>
4
4
  <%= password_f f, :password, :keep_value => true, :help_inline => _("Password to authenticate with - used for SSH finish step.") %>
5
- <%= image_field(f, :label => _("Marketplace Image URN"), :help_inline => _("Marketplace URN (e.g. OpenLogic:CentOS:7.5:latest)")) %>
5
+ <%= image_field(f, :label => _("Azure Image Name"), :help_inline => _("For custom or shared gallery image prefix the uuid with 'custom://' or 'gallery://'. For public image, prefix the uuid with 'marketplace://'.' (e.g. 'marketplace://OpenLogic:CentOS:7.5:latest' or 'custom://image-name')")) %>
6
6
  <%= checkbox_f f, :user_data, :help_inline => _("Does this image support user data input?") %>
@@ -0,0 +1,8 @@
1
+ class FixImageUuidPrefix < ActiveRecord::Migration[5.2]
2
+ def up
3
+ Image.where(compute_resource: ForemanAzureRm::AzureRm.unscoped.all).update_all("uuid = concat('marketplace://', uuid)")
4
+ end
5
+
6
+ def down
7
+ end
8
+ end
@@ -3,15 +3,18 @@ require 'azure_mgmt_resources'
3
3
  require 'azure_mgmt_network'
4
4
  require 'azure_mgmt_storage'
5
5
  require 'azure_mgmt_compute'
6
+ require 'azure_mgmt_subscriptions'
6
7
 
7
8
  module ForemanAzureRm
8
9
  Storage = Azure::Storage::Profiles::Latest::Mgmt
9
10
  Network = Azure::Network::Profiles::Latest::Mgmt
10
11
  Compute = Azure::Compute::Profiles::Latest::Mgmt
11
12
  Resources = Azure::Resources::Profiles::Latest::Mgmt
13
+ Subscriptions = Azure::Subscriptions::Profiles::Latest::Mgmt
12
14
 
13
15
  StorageModels = Storage::Models
14
16
  NetworkModels = Network::Models
15
17
  ComputeModels = Compute::Models
16
18
  ResourceModels = Resources::Models
19
+ SubscriptionModels = Subscriptions::Models
17
20
  end
@@ -23,6 +23,10 @@ module ForemanAzureRm
23
23
  @storage_client ||= Storage::Client.new(azure_credentials)
24
24
  end
25
25
 
26
+ def subscription_client
27
+ @subscription_client ||= Subscriptions::Client.new(azure_credentials)
28
+ end
29
+
26
30
  def azure_credentials
27
31
  provider = MsRestAzure::ApplicationTokenProvider.new(
28
32
  @tenant,
@@ -37,6 +41,14 @@ module ForemanAzureRm
37
41
  }
38
42
  end
39
43
 
44
+ def list_regions(subscription_id)
45
+ subscription_client.subscriptions.list_locations(subscription_id)
46
+ end
47
+
48
+ def list_resources(filter)
49
+ resource_client.resources.list(filter)
50
+ end
51
+
40
52
  def rgs
41
53
  rgs = resource_client.resource_groups.list
42
54
  rgs.map(&:name)
@@ -58,6 +70,10 @@ module ForemanAzureRm
58
70
  network_client.network_interfaces.get(rg_name, nic_name)
59
71
  end
60
72
 
73
+ def vm_disk(rg_name, disk_name)
74
+ compute_client.disks.get(rg_name, disk_name)
75
+ end
76
+
61
77
  def get_vm_extension(rg_name, vm_name, vm_extension_name)
62
78
  compute_client.virtual_machine_extensions.get(rg_name, vm_name, vm_extension_name)
63
79
  end
@@ -77,6 +93,38 @@ module ForemanAzureRm
77
93
  compute_client.virtual_machines.get(rg_name, vm_name)
78
94
  end
79
95
 
96
+ def get_marketplace_image(location, publisher_name, offer, skus, version)
97
+ compute_client.virtual_machine_images.get(location, publisher_name, offer, skus, version)
98
+ end
99
+
100
+ def list_versions(location, publisher_name, offer, skus)
101
+ compute_client.virtual_machine_images.list(location, publisher_name, offer, skus)
102
+ end
103
+
104
+ def list_custom_images
105
+ compute_client.images.list
106
+ end
107
+
108
+ def get_custom_image(rg_name, image_name)
109
+ compute_client.images.get(rg_name, image_name)
110
+ end
111
+
112
+ def list_galleries
113
+ compute_client.galleries.list
114
+ end
115
+
116
+ def list_gallery_images(rg_name, gallery_name)
117
+ compute_client.gallery_images.list_by_gallery(rg_name, gallery_name)
118
+ end
119
+
120
+ def get_gallery_image(rg_name, gallery_name, gallery_image_name)
121
+ compute_client.gallery_images.get(rg_name, gallery_name, gallery_image_name)
122
+ end
123
+
124
+ def list_gallery_image_versions(rg_name, gallery_name, gallery_image_name)
125
+ compute_client.gallery_image_versions.list_by_gallery_image(rg_name, gallery_name, gallery_image_name)
126
+ end
127
+
80
128
  def get_storage_accts
81
129
  result = storage_client.storage_accounts.list
82
130
  result.value
@@ -113,8 +161,8 @@ module ForemanAzureRm
113
161
  compute_client.virtual_machines.delete(rg_name, vm_name)
114
162
  end
115
163
 
116
- def delete_disk(rg_name, osdisk_name)
117
- compute_client.disks.delete(rg_name, osdisk_name)
164
+ def delete_disk(rg_name, disk_name)
165
+ compute_client.disks.delete(rg_name, disk_name)
118
166
  end
119
167
 
120
168
  def check_vm_status(rg_name, vm_name)
@@ -141,5 +189,23 @@ module ForemanAzureRm
141
189
  compute_client.virtual_machines.power_off(rg_name, vm_name)
142
190
  compute_client.virtual_machines.deallocate(rg_name, vm_name)
143
191
  end
192
+
193
+ def self.gallery_caching(rg_name)
194
+ @gallery_caching ||= {}
195
+ @gallery_caching[rg_name] ||= {}
196
+ end
197
+
198
+ def actual_gallery_image_id(rg_name, image_id)
199
+ gallery_names = list_galleries.map(&:name)
200
+ gallery_names.each do |gallery|
201
+ gallery_image = list_gallery_images(rg_name, gallery).detect { |image| image.name == image_id }
202
+ return gallery_image&.id
203
+ end
204
+ nil
205
+ end
206
+
207
+ def fetch_gallery_image_id(rg_name, image_id)
208
+ AzureSdkAdapter.gallery_caching(rg_name)[image_id] ||= actual_gallery_image_id(rg_name, image_id)
209
+ end
144
210
  end
145
211
  end
@@ -5,6 +5,7 @@ module ForemanAzureRm
5
5
  #autoloading all files inside lib dir
6
6
  config.eager_load_paths += Dir["#{config.root}/lib"]
7
7
  config.eager_load_paths += Dir["#{config.root}/app/models/concerns/foreman_azure_rm/vm_extensions/"]
8
+ config.eager_load_paths += Dir["#{config.root}/app/helpers/"]
8
9
 
9
10
  initializer 'foreman_azure_rm.register_plugin', :before => :finisher_hook do
10
11
  Foreman::Plugin.register :foreman_azure_rm do
@@ -38,6 +39,11 @@ module ForemanAzureRm
38
39
  require 'azure_mgmt_network'
39
40
  require 'azure_mgmt_storage'
40
41
  require 'azure_mgmt_compute'
42
+ require 'azure_mgmt_subscriptions'
43
+
44
+ # Add format validation for azure images
45
+ ::Image.validates :uuid, format: { with: /\A((marketplace|custom|gallery):\/\/)[^:]+(:[^:]+:[^:]+:[^:]+)?\z/,
46
+ message: "Incorrect UUID format" }, if: -> (image){ image.compute_resource.is_a? ForemanAzureRm::AzureRm }
41
47
 
42
48
  # Use excon as default so that HTTP Proxy settings of foreman works
43
49
  Faraday::default_adapter=:excon
@@ -1,3 +1,3 @@
1
1
  module ForemanAzureRm
2
- VERSION = '2.0.8'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
@@ -0,0 +1,61 @@
1
+ #
2
+ # Makefile for PO merging and MO generation. More info in the README.
3
+ #
4
+ # make all-mo (default) - generate MO files
5
+ # make check - check translations using translate-tool
6
+ # make tx-update - download and merge translations from Transifex
7
+ # make clean - clean everything
8
+ #
9
+ DOMAIN = foreman_azure_rm
10
+ VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load(Dir.glob("../*.gemspec")[0]);puts spec.version')
11
+ POTFILE = $(DOMAIN).pot
12
+ MOFILE = $(DOMAIN).mo
13
+ POFILES = $(shell find . -name '$(DOMAIN).po')
14
+ MOFILES = $(patsubst %.po,%.mo,$(POFILES))
15
+ POXFILES = $(patsubst %.po,%.pox,$(POFILES))
16
+ EDITFILES = $(patsubst %.po,%.edit.po,$(POFILES))
17
+
18
+ %.mo: %.po
19
+ mkdir -p $(shell dirname $@)/LC_MESSAGES
20
+ msgfmt -o $(shell dirname $@)/LC_MESSAGES/$(MOFILE) $<
21
+
22
+ # Generate MO files from PO files
23
+ all-mo: $(MOFILES)
24
+
25
+ # Check for malformed strings
26
+ %.pox: %.po
27
+ msgfmt -c $<
28
+ pofilter --nofuzzy -t variables -t blank -t urls -t emails -t long -t newlines \
29
+ -t endwhitespace -t endpunc -t puncspacing -t options -t printf -t validchars --gnome $< > $@
30
+ cat $@
31
+ ! grep -q msgid $@
32
+
33
+ %.edit.po:
34
+ touch $@
35
+
36
+ check: $(POXFILES)
37
+
38
+ # Unify duplicate translations
39
+ uniq-po:
40
+ for f in $(shell find ./ -name "*.po") ; do \
41
+ msguniq $$f -o $$f ; \
42
+ done
43
+
44
+ tx-pull: $(EDITFILES)
45
+ tx pull -f
46
+ for f in $(EDITFILES) ; do \
47
+ sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
48
+ done
49
+
50
+ tx-update: tx-pull
51
+ @echo
52
+ @echo Run rake plugin:gettext[$(DOMAIN)] from the Foreman installation, then make -C locale mo-files to finish
53
+ @echo
54
+
55
+ mo-files: $(MOFILES)
56
+ git add $(POFILES) $(POTFILE) ../locale/*/LC_MESSAGES
57
+ git commit -m "i18n - pulling from tx"
58
+ @echo
59
+ @echo Changes commited!
60
+ @echo
61
+
@@ -0,0 +1,171 @@
1
+ # English translations for foreman_azure_rm package.
2
+ # Copyright (C) 2020 THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the foreman_azure_rm package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2020.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: foreman_azure_rm 1.0.0\n"
9
+ "Report-Msgid-Bugs-To: \n"
10
+ "PO-Revision-Date: 2020-04-08 06:57-0400\n"
11
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12
+ "Language-Team: English\n"
13
+ "Language: en\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
18
+ "\n"
19
+
20
+ msgid "%{vm_size} VM Size"
21
+ msgstr ""
22
+
23
+ msgid "Actions"
24
+ msgstr ""
25
+
26
+ msgid "Additional number of disks can be added based on VM Size. For more details, please refer to Microsoft Azure's documentation"
27
+ msgstr ""
28
+
29
+ msgid "Azure Region"
30
+ msgstr ""
31
+
32
+ msgid "Azure Resource Manager as a compute resource for Foreman"
33
+ msgstr ""
34
+
35
+ msgid "Azure Subnet"
36
+ msgstr ""
37
+
38
+ msgid "Azure's Default"
39
+ msgstr ""
40
+
41
+ msgid "Azure's default"
42
+ msgstr ""
43
+
44
+ msgid "Client ID"
45
+ msgstr ""
46
+
47
+ msgid "Client ID for AzureRm"
48
+ msgstr ""
49
+
50
+ msgid "Client Secret"
51
+ msgstr ""
52
+
53
+ msgid "Client Secret for AzureRm"
54
+ msgstr ""
55
+
56
+ msgid "Comma seperated file URIs"
57
+ msgstr ""
58
+
59
+ msgid "Custom Script Command"
60
+ msgstr ""
61
+
62
+ msgid "Data Disk Caching"
63
+ msgstr ""
64
+
65
+ msgid "Default ReadWrite"
66
+ msgstr ""
67
+
68
+ msgid "Does this image support user data input?"
69
+ msgstr ""
70
+
71
+ msgid "Image"
72
+ msgstr ""
73
+
74
+ msgid "Marketplace Image URN"
75
+ msgstr ""
76
+
77
+ msgid "Marketplace URN (e.g. OpenLogic:CentOS:7.5:latest)"
78
+ msgstr ""
79
+
80
+ msgid "Name"
81
+ msgstr ""
82
+
83
+ msgid "OS Disk Caching"
84
+ msgstr ""
85
+
86
+ msgid "Password"
87
+ msgstr ""
88
+
89
+ msgid "Password to authenticate with - used for SSH finish step."
90
+ msgstr ""
91
+
92
+ msgid "Platform"
93
+ msgstr ""
94
+
95
+ msgid "Please select a Resource Group"
96
+ msgstr ""
97
+
98
+ msgid "Please select a VM Size"
99
+ msgstr ""
100
+
101
+ msgid "Please select an image"
102
+ msgstr ""
103
+
104
+ msgid "Premium OS Disk"
105
+ msgstr ""
106
+
107
+ msgid "Properties"
108
+ msgstr ""
109
+
110
+ msgid "Public IP"
111
+ msgstr ""
112
+
113
+ msgid "Region"
114
+ msgstr ""
115
+
116
+ msgid "Reload Images, Sizes, vNets"
117
+ msgstr ""
118
+
119
+ msgid "Resource Group"
120
+ msgstr ""
121
+
122
+ msgid "SSH Key"
123
+ msgstr ""
124
+
125
+ msgid "Select"
126
+ msgstr ""
127
+
128
+ msgid "Size"
129
+ msgstr ""
130
+
131
+ msgid "Size (GB)"
132
+ msgstr ""
133
+
134
+ msgid "Some of the listed regions might not be supported for your subscription. Please verify on Azure portal."
135
+ msgstr ""
136
+
137
+ msgid "State"
138
+ msgstr ""
139
+
140
+ msgid "Static Private IP"
141
+ msgstr ""
142
+
143
+ msgid "Subscription ID"
144
+ msgstr ""
145
+
146
+ msgid "Subscription ID for AzureRm"
147
+ msgstr ""
148
+
149
+ msgid "Tenant ID"
150
+ msgstr ""
151
+
152
+ msgid "The region you selected has no sizes associated with it"
153
+ msgstr ""
154
+
155
+ msgid "The selected image has no associated compute resource"
156
+ msgstr ""
157
+
158
+ msgid "The selected region has no subnets"
159
+ msgstr ""
160
+
161
+ msgid "The user that will be used to SSH into the VM for completion"
162
+ msgstr ""
163
+
164
+ msgid "To perform commands as root, prefix it with 'sudo'"
165
+ msgstr ""
166
+
167
+ msgid "Username"
168
+ msgstr ""
169
+
170
+ msgid "VM Size"
171
+ msgstr ""
@@ -0,0 +1,234 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the foreman_azure_rm package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: foreman_azure_rm 1.0.0\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2020-04-08 06:57-0400\n"
12
+ "PO-Revision-Date: 2020-04-08 06:57-0400\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "Language: \n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=UTF-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20
+
21
+ #:
22
+ #: ../app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb:10
23
+ msgid "Client ID for AzureRm"
24
+ msgstr ""
25
+
26
+ #:
27
+ #: ../app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb:11
28
+ msgid "Client Secret for AzureRm"
29
+ msgstr ""
30
+
31
+ #:
32
+ #: ../app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb:12
33
+ msgid "Subscription ID for AzureRm"
34
+ msgstr ""
35
+
36
+ #:
37
+ #: ../app/controllers/foreman_azure_rm/concerns/hosts_controller_extensions.rb:11
38
+ msgid "The region you selected has no sizes associated with it"
39
+ msgstr ""
40
+
41
+ #:
42
+ #: ../app/controllers/foreman_azure_rm/concerns/hosts_controller_extensions.rb:23
43
+ msgid "The selected region has no subnets"
44
+ msgstr ""
45
+
46
+ #:
47
+ #: ../app/controllers/foreman_azure_rm/concerns/hosts_controller_extensions.rb:27
48
+ msgid "The selected image has no associated compute resource"
49
+ msgstr ""
50
+
51
+ #: ../app/models/foreman_azure_rm/azure_rm_compute.rb:148
52
+ msgid "%{vm_size} VM Size"
53
+ msgstr ""
54
+
55
+ #: ../app/views/compute_resources/form/_azurerm.html.erb:1
56
+ msgid "Client ID"
57
+ msgstr ""
58
+
59
+ #: ../app/views/compute_resources/form/_azurerm.html.erb:2
60
+ msgid "Client Secret"
61
+ msgstr ""
62
+
63
+ #: ../app/views/compute_resources/form/_azurerm.html.erb:3
64
+ msgid "Subscription ID"
65
+ msgstr ""
66
+
67
+ #: ../app/views/compute_resources/form/_azurerm.html.erb:4
68
+ msgid "Tenant ID"
69
+ msgstr ""
70
+
71
+ #: ../app/views/compute_resources/form/_azurerm.html.erb:6
72
+ msgid "Azure Region"
73
+ msgstr ""
74
+
75
+ #: ../app/views/compute_resources/form/_azurerm.html.erb:6
76
+ msgid ""
77
+ "Some of the listed regions might not be supported for your subscription. Pleas"
78
+ "e verify on Azure portal."
79
+ msgstr ""
80
+
81
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:91
82
+ msgid "Please select a Resource Group"
83
+ msgstr ""
84
+
85
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:94
86
+ #: ../app/views/compute_resources_vms/index/_azurerm.html.erb:6
87
+ msgid "Resource Group"
88
+ msgstr ""
89
+
90
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:97
91
+ msgid "Reload Images, Sizes, vNets"
92
+ msgstr ""
93
+
94
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:109
95
+ msgid "Please select a VM Size"
96
+ msgstr ""
97
+
98
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:111
99
+ msgid "VM Size"
100
+ msgstr ""
101
+
102
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:120
103
+ msgid "Platform"
104
+ msgstr ""
105
+
106
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:127
107
+ msgid "Username"
108
+ msgstr ""
109
+
110
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:134
111
+ msgid "Password"
112
+ msgstr ""
113
+
114
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:144
115
+ msgid "SSH Key"
116
+ msgstr ""
117
+
118
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:150
119
+ msgid "Premium OS Disk"
120
+ msgstr ""
121
+
122
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:158
123
+ msgid "Azure's Default"
124
+ msgstr ""
125
+
126
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:160
127
+ msgid "OS Disk Caching"
128
+ msgstr ""
129
+
130
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:161
131
+ msgid "Default ReadWrite"
132
+ msgstr ""
133
+
134
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:168
135
+ msgid "Custom Script Command"
136
+ msgstr ""
137
+
138
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:169
139
+ msgid "To perform commands as root, prefix it with 'sudo'"
140
+ msgstr ""
141
+
142
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:175
143
+ msgid "Comma seperated file URIs"
144
+ msgstr ""
145
+
146
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:181
147
+ msgid "Please select an image"
148
+ msgstr ""
149
+
150
+ #: ../app/views/compute_resources_vms/form/azurerm/_base.html.erb:184
151
+ msgid "Image"
152
+ msgstr ""
153
+
154
+ #: ../app/views/compute_resources_vms/form/azurerm/_network.html.erb:5
155
+ msgid "Select"
156
+ msgstr ""
157
+
158
+ #: ../app/views/compute_resources_vms/form/azurerm/_network.html.erb:7
159
+ msgid "Azure Subnet"
160
+ msgstr ""
161
+
162
+ #: ../app/views/compute_resources_vms/form/azurerm/_network.html.erb:18
163
+ msgid "Public IP"
164
+ msgstr ""
165
+
166
+ #: ../app/views/compute_resources_vms/form/azurerm/_network.html.erb:25
167
+ msgid "Static Private IP"
168
+ msgstr ""
169
+
170
+ #: ../app/views/compute_resources_vms/form/azurerm/_volume.html.erb:4
171
+ msgid "Size (GB)"
172
+ msgstr ""
173
+
174
+ #: ../app/views/compute_resources_vms/form/azurerm/_volume.html.erb:8
175
+ msgid ""
176
+ "Additional number of disks can be added based on VM Size. For more details, pl"
177
+ "ease refer to Microsoft Azure's documentation"
178
+ msgstr ""
179
+
180
+ #: ../app/views/compute_resources_vms/form/azurerm/_volume.html.erb:14
181
+ msgid "Azure's default"
182
+ msgstr ""
183
+
184
+ #: ../app/views/compute_resources_vms/form/azurerm/_volume.html.erb:17
185
+ msgid "Data Disk Caching"
186
+ msgstr ""
187
+
188
+ #: ../app/views/compute_resources_vms/index/_azurerm.html.erb:4
189
+ msgid "Name"
190
+ msgstr ""
191
+
192
+ #: ../app/views/compute_resources_vms/index/_azurerm.html.erb:5
193
+ msgid "Size"
194
+ msgstr ""
195
+
196
+ #: ../app/views/compute_resources_vms/index/_azurerm.html.erb:7
197
+ msgid "Region"
198
+ msgstr ""
199
+
200
+ #: ../app/views/compute_resources_vms/index/_azurerm.html.erb:8
201
+ msgid "State"
202
+ msgstr ""
203
+
204
+ #: ../app/views/compute_resources_vms/index/_azurerm.html.erb:9
205
+ msgid "Actions"
206
+ msgstr ""
207
+
208
+ #: ../app/views/compute_resources_vms/show/_azurerm.html.erb:5
209
+ msgid "Properties"
210
+ msgstr ""
211
+
212
+ #: ../app/views/images/form/_azurerm.html.erb:2
213
+ msgid "The user that will be used to SSH into the VM for completion"
214
+ msgstr ""
215
+
216
+ #: ../app/views/images/form/_azurerm.html.erb:4
217
+ msgid "Password to authenticate with - used for SSH finish step."
218
+ msgstr ""
219
+
220
+ #: ../app/views/images/form/_azurerm.html.erb:5
221
+ msgid "Marketplace Image URN"
222
+ msgstr ""
223
+
224
+ #: ../app/views/images/form/_azurerm.html.erb:5
225
+ msgid "Marketplace URN (e.g. OpenLogic:CentOS:7.5:latest)"
226
+ msgstr ""
227
+
228
+ #: ../app/views/images/form/_azurerm.html.erb:6
229
+ msgid "Does this image support user data input?"
230
+ msgstr ""
231
+
232
+ #: gemspec.rb:2
233
+ msgid "Azure Resource Manager as a compute resource for Foreman"
234
+ msgstr ""
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_azure_rm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditi Puntambekar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-02-26 00:00:00.000000000 Z
13
+ date: 2020-05-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: deface
@@ -82,6 +82,20 @@ dependencies:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
84
  version: 0.18.7
85
+ - !ruby/object:Gem::Dependency
86
+ name: azure_mgmt_subscriptions
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: 0.18.1
92
+ type: :runtime
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "~>"
97
+ - !ruby/object:Gem::Version
98
+ version: 0.18.1
85
99
  - !ruby/object:Gem::Dependency
86
100
  name: rubocop
87
101
  requirement: !ruby/object:Gem::Requirement
@@ -131,6 +145,7 @@ files:
131
145
  - Rakefile
132
146
  - app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb
133
147
  - app/controllers/foreman_azure_rm/concerns/hosts_controller_extensions.rb
148
+ - app/helpers/azure_compute_resource_helper.rb
134
149
  - app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb
135
150
  - app/models/foreman_azure_rm/azure_rm.rb
136
151
  - app/models/foreman_azure_rm/azure_rm_compute.rb
@@ -144,16 +159,21 @@ files:
144
159
  - app/views/compute_resources/show/_azurerm.html.erb
145
160
  - app/views/compute_resources_vms/form/azurerm/_base.html.erb
146
161
  - app/views/compute_resources_vms/form/azurerm/_network.html.erb
162
+ - app/views/compute_resources_vms/form/azurerm/_volume.html.erb
147
163
  - app/views/compute_resources_vms/index/_azurerm.html.erb
148
164
  - app/views/compute_resources_vms/show/_azurerm.html.erb
149
165
  - app/views/images/form/_azurerm.html.erb
150
166
  - config/routes.rb
151
167
  - db/migrate/20200211073049_fix_case_azure_rm.rb
168
+ - db/migrate/20200507103900_fix_image_uuid_prefix.rb
152
169
  - lib/foreman_azure_rm.rake
153
170
  - lib/foreman_azure_rm.rb
154
171
  - lib/foreman_azure_rm/azure_sdk_adapter.rb
155
172
  - lib/foreman_azure_rm/engine.rb
156
173
  - lib/foreman_azure_rm/version.rb
174
+ - locale/Makefile
175
+ - locale/en/foreman_azure_rm.po
176
+ - locale/foreman_azure_rm.pot
157
177
  - locale/gemspec.rb
158
178
  homepage: https://github.com/theforeman/foreman_azure_rm
159
179
  licenses: