hammer_cli_foreman_azure_rm 0.1.1 → 0.2.2

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: 0cd5f8e80632f2af3952c995f4f199c60f11892047876907cbeed5e5ee5d7214
4
- data.tar.gz: 77baa96a6072e7916686c4bf31b97f1ae7ef3eb1502aa7c7d9b7cc95e3e201e4
3
+ metadata.gz: 798330bd523e01919ec7abf741c394b5cf8655abe4cd0d1f650455b0bfce4cb6
4
+ data.tar.gz: 224e8e528e04a45b05882b014e95418b230ae350f8ceb4743b5a40f84fdde0b6
5
5
  SHA512:
6
- metadata.gz: 7fb4bc0733e87b8ec5e38988d6506df58e48b604d3cbd7c10c6beeb59b28ea753e67b604a8f72700a36611a5683fb6a36269fa2d22d4d12d6bd3ea804c02be29
7
- data.tar.gz: 8b7cf74727ac075989412b8e321268a9eb3af5849ed1bb48b0b8a437e7395ce48fdbf9f1794cd4287ee7821b5b27afdfe8d7ffca2ae7b1d42ae3f93c52563606
6
+ metadata.gz: 67b45adbb7f8b46c66f6a7c2a3a39387af768b9aa76af67d3f5c18a6df6faeb24fb4d5c508489d9f2cbde4d8b554757210d4442bd7e80a5a88b29754053b2ce0
7
+ data.tar.gz: a9a1aefb5a3e478b44783337449f3f0502aa26898d5b084dc82c6590cec04e3dfe5b7a3aa4531df36f071b4f089a5892d950305ec15712777d37aebf5c0ac918
data/README.md CHANGED
@@ -3,18 +3,52 @@
3
3
  ## Description
4
4
  CLI tool for AzureRM compute resource in Foreman [foreman_azure_rm](https://github.com/theforeman/foreman_azure_rm)
5
5
 
6
+ ## Installation
7
+
8
+ ### Package
9
+ ```
10
+ # yum install tfm-rubygem-hammer_cli_foreman_azure_rm
11
+ ```
12
+
13
+ ### Foreman Installer
14
+ ```
15
+ # foreman-installer --enable-foreman-cli-azure
16
+ # hammer -r
17
+ ```
18
+ Please note that **hammer -r** will reload Apipie cache so that command options for azurerm compute resource will get loaded.
19
+
20
+ ### Development Setup
21
+
22
+ Clone the repo from github:
23
+ ```bash
24
+ git clone https://github.com/theforeman/hammer_cli_foreman_azure_rm.git
25
+ ```
26
+
27
+ Edit `~/.hammer/cli.modules.d/foreman_azure_rm.yml` and enter in the following:
28
+ ```yaml
29
+ :foreman_azure_rm:
30
+ :enable_module: true
31
+ ```
32
+
6
33
  ## Compute Resource Creation
7
34
 
8
35
  ```
9
- hammer compute-resource create --name cli_azure_cr --provider azurerm --tenant <tenant-id> --app-ident <client-id> --secret-key <client-secret> --sub-id <subscription-id> --region "eastus"
36
+ hammer compute-resource create --name cli_azure_cr --provider azurerm --tenant <tenant-id> --app-ident <client-id> --secret-key <client-secret> --sub-id <subscription-id> --region <region>
10
37
  ```
11
38
 
12
39
  Please note that the region value must be provided in **lowercase**.
13
40
 
41
+ ## List available networks
42
+ ```
43
+ hammer compute-resource networks --id <compute-resource-id>
44
+ ```
45
+
46
+ Please copy the subnet ID from this list to be passed to `compute_network` attribute during Host creation.
47
+
14
48
  ## Host Creation
15
49
 
16
50
  ```
17
- hammer host create --compute-resource-id 7 --compute-attributes="resource_group=aditi-rg,vm_size=Standard_B1s,username=myuser,password=mypassword,platform=Linux,image_id=OpenLogic:CentOS:7.5:latest" --interface="compute_public_ip=Dynamic,compute_network=mysubnetID,compute_private_ip=false" --name="test-host-cli" --location-id 1 --organization-id 2 --domain-id 2 --architecture-id 1 --operatingsystem-id 1
51
+ hammer host create --compute-resource-id 7 --compute-attributes="resource_group=test-rg,vm_size=Standard_B1s,username=myuser,password=mypassword,platform=Linux,script_command=date" --interface="compute_public_ip=Dynamic,compute_network=mysubnetID,compute_private_ip=false" --name="test-host-cli" --location-id 1 --organization-id 2 --domain-id 2 --architecture-id 1 --operatingsystem-id 1 --image-id 1
18
52
  ```
19
53
 
20
54
  ## Compute Profile Creation
@@ -26,11 +60,11 @@ hammer compute-profile create --name cli_cp
26
60
  ## Compute Profile Attributes Creation
27
61
 
28
62
  ```
29
- hammer compute-profile values create --compute-attributes="resource_group=aditi-rg,vm_size=Standard_B1s,username=myuser,password=mypassword,platform=Linux,image_id=OpenLogic:CentOS:7.5:latest" --interface="compute_public_ip=Dynamic,compute_network=mysubnetID,compute_private_ip=false" --compute-profile "cli_cp" --compute-resource-id 7 --location-id 1 --organization-id 2
63
+ hammer compute-profile values create --compute-attributes="resource_group=aditi-rg,vm_size=Standard_B1s,username=myuser,password=mypassword,platform=Linux" --interface="compute_public_ip=Dynamic,compute_network=mysubnetID,compute_private_ip=false" --compute-profile "cli_cp" --compute-resource-id 7 --location-id 1 --organization-id 2
30
64
  ```
31
65
 
32
66
  ## Host Creation with Compute Profile
33
67
 
34
68
  ```
35
- host create --compute-resource-id 7 --compute-profile "cli_cp" --name="test-host-cli-cp" --location-id 1 --organization-id 2 --domain-id 2 --architecture-id 1 --operatingsystem-id 1
69
+ host create --compute-resource-id 7 --compute-profile "cli_cp" --name="test-host-cli-cp" --location-id 1 --organization-id 2 --domain-id 2 --architecture-id 1 --operatingsystem-id 1 --image-id 1
36
70
  ```
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hammer_cli_foreman/compute_resource/base'
2
4
 
3
- module HammerCLIForemanAzureRM
5
+ module HammerCLIForemanAzureRm
4
6
  module ComputeResources
5
- class AzureRM < HammerCLIForeman::ComputeResources::Base
7
+ class AzureRm < HammerCLIForeman::ComputeResources::Base
6
8
  def name
7
9
  _('AzureRM')
8
10
  end
@@ -30,12 +32,20 @@ module HammerCLIForemanAzureRM
30
32
  ]
31
33
  end
32
34
 
35
+ def volume_attributes
36
+ [
37
+ ['disk_size_gb', _('Volume Size in GB (integer value)')],
38
+ ['data_disk_caching', _('Data Disk Caching (None, ReadOnly, ReadWrite)')]
39
+ ]
40
+ end
41
+
33
42
  def provider_specific_fields
34
43
  [
35
- Fields::Field.new(:label => _('tenant'), :path => [:tenant]),
36
- Fields::Field.new(:label => _('app_ident'), :path => [:app_ident]),
37
- Fields::Field.new(:label => _('sub_id'), :path => [:sub_id]),
38
- Fields::Field.new(:label => _('region'), :path => [:region])
44
+ Fields::Field.new(:label => _('tenant'), :path => [:tenant]),
45
+ Fields::Field.new(:label => _('app_ident'), :path => [:app_ident]),
46
+ Fields::Field.new(:label => _('sub_id'), :path => [:sub_id]),
47
+ Fields::Field.new(:label => _('region'), :path => [:region]),
48
+ Fields::Field.new(:label => _('cloud'), :path => [:cloud])
39
49
  ]
40
50
  end
41
51
 
@@ -44,4 +54,4 @@ module HammerCLIForemanAzureRM
44
54
  end
45
55
  end
46
56
  end
47
- end
57
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'hammer_cli/i18n'
4
+ module HammerCLIForemanAzureRm
5
+ module I18n
6
+ class LocaleDomain < HammerCLI::I18n::LocaleDomain
7
+ def translated_files
8
+ Dir.glob(File.join(File.dirname(__FILE__), '../**/*.rb'))
9
+ end
10
+
11
+ def locale_dir
12
+ File.join(File.dirname(__FILE__), '../../locale')
13
+ end
14
+
15
+ def domain_name
16
+ 'hammer-cli-foreman-azure-rm'
17
+ end
18
+
19
+ def type
20
+ :mo
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ HammerCLI::I18n.add_domain(HammerCLIForemanAzureRm::I18n::LocaleDomain.new)
@@ -1,5 +1,7 @@
1
- module HammerCLIForemanAzureRM
1
+ # frozen_string_literal: true
2
+
3
+ module HammerCLIForemanAzureRm
2
4
  def self.version
3
- @version ||= Gem::Version.new '0.1.1'
5
+ @version ||= Gem::Version.new '0.2.2'
4
6
  end
5
- end
7
+ end
@@ -1,6 +1,10 @@
1
- module HammerCLIForemanAzureRM
1
+ # frozen_string_literal: true
2
+
3
+ module HammerCLIForemanAzureRm
4
+ require 'hammer_cli_foreman_azure_rm/version'
2
5
  require 'hammer_cli_foreman_azure_rm/compute_resources/azure_rm'
3
6
  require 'hammer_cli_foreman/compute_resource/register_compute_resources'
4
7
 
5
- HammerCLIForeman.register_compute_resource('azurerm', HammerCLIForemanAzureRM::ComputeResources::AzureRM.new)
6
- end
8
+ HammerCLIForeman.register_compute_resource('azurerm',
9
+ HammerCLIForemanAzureRm::ComputeResources::AzureRm.new)
10
+ end
metadata CHANGED
@@ -1,49 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_azure_rm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditi Puntambekar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: gettext
14
+ name: hammer_cli_foreman
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.3
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: 4.0.0
19
+ version: 0.17.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 3.1.3
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: 4.0.0
26
+ version: 0.17.0
33
27
  - !ruby/object:Gem::Dependency
34
- name: hammer_cli_foreman
28
+ name: gettext
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - ">="
38
32
  - !ruby/object:Gem::Version
39
- version: 0.17.0
40
- type: :runtime
33
+ version: 3.1.3
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 4.0.0
37
+ type: :development
41
38
  prerelease: false
42
39
  version_requirements: !ruby/object:Gem::Requirement
43
40
  requirements:
44
41
  - - ">="
45
42
  - !ruby/object:Gem::Version
46
- version: 0.17.0
43
+ version: 3.1.3
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 4.0.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -83,6 +83,7 @@ files:
83
83
  - config/foreman_azure_rm.yml
84
84
  - lib/hammer_cli_foreman_azure_rm.rb
85
85
  - lib/hammer_cli_foreman_azure_rm/compute_resources/azure_rm.rb
86
+ - lib/hammer_cli_foreman_azure_rm/i18n.rb
86
87
  - lib/hammer_cli_foreman_azure_rm/version.rb
87
88
  homepage: https://github.com/theforeman/hammer_cli_foreman_azure_rm
88
89
  licenses:
@@ -103,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  - !ruby/object:Gem::Version
104
105
  version: '0'
105
106
  requirements: []
106
- rubyforge_project:
107
- rubygems_version: 2.7.6.2
107
+ rubygems_version: 3.1.6
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Foreman AzureRM commands for Hammer CLI