foreman_azure_rm 2.0.2 → 2.0.3

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: e05c23b1a095391bdea55a57e7dfca7f8563e0d73acd4b02b3d56e6591be5f42
4
- data.tar.gz: 3f16062a92f583807ec4884be2e939f725c6aa9ca488db945dd1f78bb6b929c2
3
+ metadata.gz: 9db2c6a180afc8c47af707c9857d8c45c4505b6326b07fc35b7dacd4effb4158
4
+ data.tar.gz: 54e4039412ad74a2f8b7113b827a5b86c8ecc2940da9b891d2578ee92e63614b
5
5
  SHA512:
6
- metadata.gz: 9d06ced474ac3f829e0d8ad8b3d87ce91b095f70c58579d68116dc25a59128ee97c67cf947bbf2502a9f60d46f710030eed1b7cec9efabf165d6d954337574a6
7
- data.tar.gz: d1235b61f7c32bf0b4c81973e317218d700a23dfe4cca346b841a6b3ce04e0fbec6836d9dab57c17557230de3039914150b08b24e303049f65e6cd0e9c6645a5
6
+ metadata.gz: 5009a521e15fc1b6d0d618e3b267f93671d92f2f457693f5b4ee7732e87037e3f47c434f941531d611b08d3678d581a2445a4cc5aa3b86e2613d8c2361ce061c
7
+ data.tar.gz: 38f4fa38b70c23e68ec60aec1f9fdf45bb3067bb2e6eb90d3aeb6fb0015911b10c8fcc66538bd95357de13b6657b8e6b0eae5eb53a5b801a5203ef87aae1fa2f
@@ -88,6 +88,8 @@ module ForemanAzureRM
88
88
  NetworkModels::IPAllocationMethod::Dynamic
89
89
  when 'None'
90
90
  nil
91
+ else
92
+ raise RuntimeError, "Public IP value must be either 'Dynamic', 'Static' or 'None'"
91
93
  end
92
94
  if pub_ip_alloc.present?
93
95
  public_ip_params = NetworkModels::PublicIPAddress.new.tap do |ip|
@@ -108,6 +110,7 @@ module ForemanAzureRM
108
110
  NetworkModels::NetworkInterfaceIPConfiguration.new.tap do |nic_conf|
109
111
  nic_conf.name = "#{args[:vm_name]}-nic#{nic}"
110
112
  nic_conf.private_ipallocation_method = priv_ip_alloc
113
+ nic_conf.private_ipaddress = attrs[:ip] if priv_ip_alloc == "Static"
111
114
  nic_conf.subnet = subnets.select{ |subnet| subnet.id == attrs[:network] }.first
112
115
  nic_conf.public_ipaddress = pip
113
116
  end
@@ -216,4 +219,4 @@ module ForemanAzureRM
216
219
  end
217
220
  end
218
221
  end
219
- end
222
+ end
@@ -59,7 +59,7 @@ module ForemanAzureRM
59
59
  [:image]
60
60
  end
61
61
 
62
- def regions
62
+ def self.regions
63
63
  [
64
64
  ['West Europe', 'westeurope'],
65
65
  ['Central US', 'centralus'],
@@ -73,6 +73,9 @@ module ForemanAzureRM
73
73
  ]
74
74
  end
75
75
 
76
+ validates :region, inclusion: { in: regions.collect(&:second),
77
+ message: "%{value} must be lowercase." }
78
+
76
79
  def resource_groups
77
80
  sdk.rgs
78
81
  end
@@ -44,6 +44,9 @@ module ForemanAzureRM
44
44
  vm_status == 'running'
45
45
  end
46
46
 
47
+ def reload
48
+ end
49
+
47
50
  def state
48
51
  vm_status
49
52
  end
@@ -116,6 +119,10 @@ module ForemanAzureRM
116
119
  @azure_vm.name = setuuid
117
120
  end
118
121
 
122
+ def vm_description
123
+ _("%{vm_size} VM Size") % {:vm_size => vm_size}
124
+ end
125
+
119
126
  # Following properties are for AzureRM
120
127
  # These are not part of Foreman's interface
121
128
 
@@ -3,7 +3,7 @@
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.regions, {}, {:label => _('Azure Region'), :required => true }) %>
6
+ <%= selectable_f(f, :url, f.object.class.regions, {}, {:label => _('Azure Region'), :required => true }) %>
7
7
 
8
8
  <div class="col-md-offset-2">
9
9
  <%= test_connection_button_f(f, true) %>
@@ -176,12 +176,6 @@
176
176
  }
177
177
  %>
178
178
 
179
- <% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1'
180
- %>
181
-
182
- <%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine upon creation"), :label => _('Start'), :label_size => "col-md-2" } if new_vm && controller_name != "compute_attributes"
183
- %>
184
-
185
179
  <div id="image_selection">
186
180
  <%= select_f f, :image_id, images, :uuid, :name,
187
181
  { :include_blank => (images.empty? or images.size == 1) ? false : _('Please select an image') },
@@ -19,6 +19,7 @@
19
19
  <td>
20
20
  <%= action_buttons(
21
21
  vm_power_action(vm, authorizer),
22
+ vm_import_action(vm),
22
23
  display_delete_if_authorized(hash_for_compute_resource_vm_path(
23
24
  :compute_resource_id => @compute_resource,
24
25
  :id => vm.identity).merge(:auth_object => @compute_resource, :authorizer => authorizer))
@@ -1,6 +1,6 @@
1
1
  <%= text_f f, :username, :value => @image.username || "root",
2
2
  :help_inline => _("The user that will be used to SSH into the VM for completion")
3
3
  %>
4
- <%= password_f f, :password, :help_inline => _("Password to authenticate with - used for SSH finish step.") %>
4
+ <%= password_f f, :password, :keep_value => true, :help_inline => _("Password to authenticate with - used for SSH finish step.") %>
5
5
  <%= image_field(f, :label => _("Marketplace Image URN"), :help_inline => _("Marketplace URN (e.g. OpenLogic:CentOS:7.5:latest)")) %>
6
6
  <%= checkbox_f f, :user_data, :help_inline => _("Does this image support user data input?") %>
@@ -1,3 +1,3 @@
1
1
  module ForemanAzureRM
2
- VERSION = '2.0.2'.freeze
2
+ VERSION = '2.0.3'.freeze
3
3
  end
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.2
4
+ version: 2.0.3
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: 2019-11-26 00:00:00.000000000 Z
13
+ date: 2019-12-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: deface
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.7.6
177
+ rubygems_version: 2.7.6.2
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Azure Resource Manager as a compute resource for The Foreman