foreman_azure_rm 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/concerns/fog_extensions/azurerm/server.rb +33 -25
- data/lib/foreman_azure_rm/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4ed4553178840cb2968e9e328413e529cbc198c
|
|
4
|
+
data.tar.gz: ecd58fbfe5c23475b2aa81b9984ad8de5ba2cccc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf9926c2925460409da62a313ab3a8f3e5c035d433dfa86ea72a865c6a6030eed025d1e77e34a82f9a442c32480b8ab8dc230ae2db9cf02c2cb399dce46d5de1
|
|
7
|
+
data.tar.gz: 9a504b87b437b3b51e55e23667481251ac944e28665c54380e255183695d332a42e6af3deef1e7d74be90f6e661ec3fbe4268ee26e038e1f8c24f8d9559e1020
|
|
@@ -23,32 +23,42 @@ module FogExtensions
|
|
|
23
23
|
def self.prepended base
|
|
24
24
|
base.instance_eval do
|
|
25
25
|
def parse(vm)
|
|
26
|
-
hash
|
|
27
|
-
hash['id']
|
|
28
|
-
hash['name']
|
|
29
|
-
hash['location']
|
|
26
|
+
hash = {}
|
|
27
|
+
hash['id'] = vm.id
|
|
28
|
+
hash['name'] = vm.name
|
|
29
|
+
hash['location'] = vm.location
|
|
30
30
|
hash['resource_group'] = get_resource_group_from_id(vm.id)
|
|
31
|
-
hash['vm_size']
|
|
31
|
+
hash['vm_size'] = vm.hardware_profile.vm_size unless vm.hardware_profile.vm_size.nil?
|
|
32
32
|
unless vm.storage_profile.nil?
|
|
33
|
-
hash['os_disk_name']
|
|
33
|
+
hash['os_disk_name'] = vm.storage_profile.os_disk.name
|
|
34
34
|
hash['os_disk_caching'] = vm.storage_profile.os_disk.caching
|
|
35
35
|
unless vm.storage_profile.os_disk.vhd.nil?
|
|
36
|
-
hash['os_disk_vhd_uri']
|
|
36
|
+
hash['os_disk_vhd_uri'] = vm.storage_profile.os_disk.vhd.uri
|
|
37
37
|
hash['storage_account_name'] = hash['os_disk_vhd_uri'].split('/')[2].split('.')[0]
|
|
38
38
|
end
|
|
39
39
|
unless vm.storage_profile.image_reference.nil?
|
|
40
40
|
unless vm.storage_profile.image_reference.publisher.nil?
|
|
41
41
|
hash['publisher'] = vm.storage_profile.image_reference.publisher
|
|
42
|
-
hash['offer']
|
|
43
|
-
hash['sku']
|
|
44
|
-
hash['version']
|
|
42
|
+
hash['offer'] = vm.storage_profile.image_reference.offer
|
|
43
|
+
hash['sku'] = vm.storage_profile.image_reference.sku
|
|
44
|
+
hash['version'] = vm.storage_profile.image_reference.version
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
|
-
hash['username'] = vm.os_profile.admin_username
|
|
49
|
-
hash['custom_data'] = vm.os_profile.custom_data
|
|
50
|
-
hash['data_disks'] = []
|
|
51
48
|
|
|
49
|
+
hash['disable_password_authentication'] = false
|
|
50
|
+
|
|
51
|
+
unless vm.os_profile.nil?
|
|
52
|
+
hash['username'] = vm.os_profile.admin_username
|
|
53
|
+
hash['custom_data'] = vm.os_profile.custom_data
|
|
54
|
+
hash['disable_password_authentication'] = vm.os_profile.linux_configuration.disable_password_authentication unless vm.os_profile.linux_configuration.nil?
|
|
55
|
+
if vm.os_profile.windows_configuration
|
|
56
|
+
hash['provision_vm_agent'] = vm.os_profile.windows_configuration.provision_vmagent
|
|
57
|
+
hash['enable_automatic_updates'] = vm.os_profile.windows_configuration.enable_automatic_updates
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
hash['data_disks'] = []
|
|
52
62
|
unless vm.storage_profile.data_disks.nil?
|
|
53
63
|
vm.storage_profile.data_disks.each do |disk|
|
|
54
64
|
data_disk = Fog::Storage::AzureRM::DataDisk.new
|
|
@@ -56,30 +66,26 @@ module FogExtensions
|
|
|
56
66
|
end
|
|
57
67
|
end
|
|
58
68
|
|
|
59
|
-
hash['disable_password_authentication'] = false
|
|
60
|
-
hash['disable_password_authentication'] = vm.os_profile.linux_configuration.disable_password_authentication unless vm.os_profile.linux_configuration.nil?
|
|
61
|
-
if vm.os_profile.windows_configuration
|
|
62
|
-
hash['provision_vm_agent'] = vm.os_profile.windows_configuration.provision_vmagent
|
|
63
|
-
hash['enable_automatic_updates'] = vm.os_profile.windows_configuration.enable_automatic_updates
|
|
64
|
-
end
|
|
65
69
|
hash['network_interface_card_ids'] = vm.network_profile.network_interfaces.map(&:id)
|
|
66
|
-
hash['availability_set_id']
|
|
70
|
+
hash['availability_set_id'] = vm.availability_set.id unless vm.availability_set.nil?
|
|
67
71
|
|
|
68
72
|
hash
|
|
69
73
|
end
|
|
70
74
|
end
|
|
71
75
|
end
|
|
72
76
|
|
|
73
|
-
def interfaces_attributes=(attrs)
|
|
77
|
+
def interfaces_attributes=(attrs)
|
|
78
|
+
;
|
|
79
|
+
end
|
|
74
80
|
|
|
75
81
|
def provisioning_ip_address
|
|
76
82
|
interfaces.each do |nic|
|
|
77
83
|
nic.ip_configurations.each do |configuration|
|
|
78
84
|
next unless configuration.primary
|
|
79
85
|
if configuration.public_ipaddress.present?
|
|
80
|
-
ip_id
|
|
81
|
-
ip_rg
|
|
82
|
-
ip_name
|
|
86
|
+
ip_id = configuration.public_ipaddress.id
|
|
87
|
+
ip_rg = ip_id.split('/')[4]
|
|
88
|
+
ip_name = ip_id.split('/')[-1]
|
|
83
89
|
public_ip = service.get_public_ip(ip_rg, ip_name)
|
|
84
90
|
return public_ip.ip_address
|
|
85
91
|
else
|
|
@@ -101,7 +107,9 @@ module FogExtensions
|
|
|
101
107
|
interfaces
|
|
102
108
|
end
|
|
103
109
|
|
|
104
|
-
def volumes_attributes=(attrs)
|
|
110
|
+
def volumes_attributes=(attrs)
|
|
111
|
+
;
|
|
112
|
+
end
|
|
105
113
|
|
|
106
114
|
def volumes
|
|
107
115
|
volumes = []
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_azure_rm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Gregory
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fog-azure-rm-downgraded
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.3.
|
|
19
|
+
version: 0.3.1
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - '='
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.3.
|
|
26
|
+
version: 0.3.1
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: deface
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|