Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FINE] Porting newly supported Tower credential types to Fine #15780

Merged
merged 7 commits into from
Nov 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class ManageIQ::Providers::AnsibleTower::AutomationManager < ManageIQ::Providers
require_nested :Credential
require_nested :AmazonCredential
require_nested :AzureCredential
require_nested :AzureClassicCredential
require_nested :CloudCredential
require_nested :GoogleCredential
require_nested :MachineCredential
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ManageIQ::Providers::AnsibleTower::AutomationManager::AzureClassicCredential < ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::AzureClassicCredential
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This corresponds to Ansible Tower's Azure Resource Manager (azure_rm) type credential. We are not modeling the deprecated Azure classic
class ManageIQ::Providers::AnsibleTower::AutomationManager::AzureCredential <
ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential
# This corresponds to Ansible Tower's Azure Resource Manager (azure_rm) type credential
class ManageIQ::Providers::AnsibleTower::AutomationManager::AzureCredential < ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::AzureCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::AnsibleTower::AutomationManager::GoogleCredential < ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::GoogleCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::AnsibleTower::AutomationManager::NetworkCredential < ManageIQ::Providers::AnsibleTower::AutomationManager::Credential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::NetworkCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::AnsibleTower::AutomationManager::OpenstackCredential < ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::OpenstackCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::AnsibleTower::AutomationManager::RackspaceCredential < ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::RackspaceCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::AnsibleTower::AutomationManager::Satellite6Credential < ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::Satellite6Credential
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::AmazonCredential
extend ActiveSupport::Concern

COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Access Key'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::AzureClassicCredential
COMMON_ATTRIBUTES = {
:userid => {
:type => :string,
:label => N_('Subscription ID'),
:help_text => N_('The Subscription UUID for the Microsoft Azure Classic account'),
:max_length => 1024,
:required => true
}
}.freeze

EXTRA_ATTRIBUTES = {
:ssh_key_data => {
:type => :password,
:multiline => true,
:label => N_('Management Certificate'),
:help_text => N_('Contents of the PEM file that corresponds to the certificate you uploaded in the Microsoft Azure console'),
:required => true
}
}.freeze

API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze

API_OPTIONS = {
:type => 'cloud',
:label => N_('Azure Classic (deprecated)'),
:attributes => API_ATTRIBUTES
}.freeze
TOWER_KIND = 'azure'.freeze
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::AzureCredential
COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
:help_text => N_('The username to use to connect to the Microsoft Azure account')
},
:password => {
:type => :password,
:label => N_('Password'),
:help_text => N_('The password to use to connect to the Microsoft Azure account')
}
}.freeze

EXTRA_ATTRIBUTES = {
:subscription => {
:type => :string,
:label => N_('Subscription ID'),
:help_text => N_('The Subscription UUID for the Microsoft Azure account'),
:max_length => 1024,
:required => true
},
:tenant => {
:type => :string,
:label => N_('Tenant ID'),
:help_text => N_('The Tenant ID for the Microsoft Azure account'),
:max_length => 1024
},
:secret => {
:type => :password,
:label => N_('Client Secret'),
:help_text => N_('The Client Secret for the Microsoft Azure account'),
:max_length => 1024,
},
:client => {
:type => :string,
:label => N_('Client ID'),
:help_text => N_('The Client ID for the Microsoft Azure account'),
:max_length => 128
},
}.freeze

API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze

API_OPTIONS = {
:type => 'cloud',
:label => N_('Azure'),
:attributes => API_ATTRIBUTES
}.freeze
TOWER_KIND = 'azure_rm'.freeze
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::GoogleCredential
COMMON_ATTRIBUTES = {
:userid => {
:type => :email,
:label => N_('Service Account Email Address'),
:help_text => N_('The email address assigned to the Google Compute Engine service account'),
:required => true
}
}.freeze

EXTRA_ATTRIBUTES = {
:ssh_key_data => {
:type => :password,
:multiline => true,
:label => N_('RSA Private Key'),
:help_text => N_('Contents of the PEM file associated with the service account email'),
:required => true
},
:project => {
:type => :string,
:label => N_('Project'),
:help_text => N_('The GCE assigned identification. It is constructed as two words followed by a three digit number, such as: squeamish-ossifrage-123'),
:max_length => 100,
}
}.freeze

API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze

API_OPTIONS = {
:type => 'cloud',
:label => N_('Google Compute Engine'),
:attributes => API_ATTRIBUTES
}.freeze
TOWER_KIND = 'gce'.freeze
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::MachineCredential
extend ActiveSupport::Concern

COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::NetworkCredential
COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
:help_text => N_('Username for this credential'),
:required => true
},
:password => {
:type => :password,
:label => N_('Password'),
:help_text => N_('Password for this credential'),
:required => true
}
}.freeze

EXTRA_ATTRIBUTES = {
:authorize => {
:type => :boolean,
:label => N_('Authorize'),
:help_text => N_('Whether to use the authorize mechanism')
},
:authorize_password => {
:type => :password,
:label => N_('Authorize password'),
:help_text => N_('Password used by the authorize mechanism')
},
:ssh_key_data => {
:type => :password,
:multiline => true,
:label => N_('SSH key'),
:help_text => N_('RSA or DSA private key to be used instead of password')
},
:ssh_key_unlock => {
:type => :password,
:label => N_('Private key passphrase'),
:help_text => N_('Passphrase to unlock SSH private key if encrypted'),
:max_length => 1024
}
}.freeze

API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze

API_OPTIONS = {
:label => N_('network'),
:type => 'network',
:attributes => API_ATTRIBUTES
}.freeze
TOWER_KIND = 'net'.freeze
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::OpenstackCredential
COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
:help_text => N_('The username to use to connect to OpenStack'),
:required => true
},
:password => {
:type => :password,
:label => N_('Password (API Key)'),
:help_text => N_('The password or API key to use to connect to OpenStack'),
:required => true
}
}.freeze

EXTRA_ATTRIBUTES = {
:host => {
:type => :string,
:label => N_('Host (Authentication URL'),
:help_text => N_('The host to authenticate with. For example, https://openstack.business.com/v2.0'),
:max_length => 1024,
:required => true
},
:project => {
:type => :string,
:label => N_('Project (Tenant Name)'),
:help_text => N_('This is the tenant name. This value is usually the same as the username'),
:max_length => 100,
:required => true
},
:domain => {
:type => :string,
:label => N_('Domain Name'),
:help_text => N_('OpenStack domains define administrative boundaries. It is only needed for Keystone v3 authentication URLs'),
:max_length => 100
}
}.freeze

API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze

API_OPTIONS = {
:type => 'cloud',
:label => N_('OpenStack'),
:attributes => API_ATTRIBUTES
}.freeze
TOWER_KIND = 'openstack'.freeze
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::RackspaceCredential
COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
:help_text => N_('Username for this credential'),
:required => true
},
:password => {
:type => :password,
:label => N_('API Key'),
:help_text => N_('API Key for this credential'),
:required => true
}
}.freeze

API_ATTRIBUTES = COMMON_ATTRIBUTES

API_OPTIONS = {
:type => 'cloud',
:label => N_('Rackspace'),
:attributes => API_ATTRIBUTES
}.freeze
TOWER_KIND = 'rax'.freeze
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::Satellite6Credential
COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
:help_text => N_('The username to use to connect to Satellite 6'),
:required => true
},
:password => {
:type => :password,
:label => N_('Password'),
:help_text => N_('The password to use to connect to Satellite 6'),
:required => true
}
}.freeze

EXTRA_ATTRIBUTES = {
:host => {
:type => :string,
:label => N_('Satellite 6 Host'),
:help_text => N_('Hostname or IP address which corresponds to your Red Hat Satellite 6 server'),
:max_length => 1024,
:required => true
}
}.freeze

API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze

API_OPTIONS = {
:type => 'cloud',
:label => N_('Satellite6'),
:attributes => API_ATTRIBUTES
}.freeze
TOWER_KIND = 'satellite6'.freeze
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::ScmCredential
extend ActiveSupport::Concern

COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::VmwareCredential
extend ActiveSupport::Concern

COMMON_ATTRIBUTES = {
:userid => {
:label => N_('Username'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def credentials
when 'satellite6' then "#{provider_module}::AutomationManager::Satellite6Credential"
# when 'cloudforms' then "#{provider_module}::AutomationManager::$$$Credential"
when 'gce' then "#{provider_module}::AutomationManager::GoogleCredential"
# when 'azure' then "#{provider_module}::AutomationManager::???Credential"
when 'azure' then "#{provider_module}::AutomationManager::AzureClassicCredential"
when 'azure_rm' then "#{provider_module}::AutomationManager::AzureCredential"
when 'openstack' then "#{provider_module}::AutomationManager::OpenstackCredential"
else "#{provider_module}::AutomationManager::Credential"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class ManageIQ::Providers::EmbeddedAnsible::AutomationManager < ManageIQ::Provid
require_nested :Credential
require_nested :AmazonCredential
require_nested :AzureCredential
require_nested :AzureClassicCredential
require_nested :CloudCredential
require_nested :GoogleCredential
require_nested :MachineCredential
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::AzureClassicCredential < ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::AzureClassicCredential
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This corresponds to Ansible Tower's Azure Resource Manager (azure_rm) type credential. We are not modeling the deprecated Azure classic
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::AzureCredential <
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential
# This corresponds to Ansible Tower's Azure Resource Manager (azure_rm) type credential
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::AzureCredential < ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::AzureCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::GoogleCredential < ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::GoogleCredential
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::NetworkCredential <
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Credential
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::NetworkCredential < ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Credential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::NetworkCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::OpenstackCredential < ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::OpenstackCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::RackspaceCredential < ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::RackspaceCredential
end
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Satellite6Credential < ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::Satellite6Credential
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module MiqAeMethodService
class MiqAeServiceManageIQ_Providers_AnsibleTower_AutomationManager_AzureClassicCredential < MiqAeServiceManageIQ_Providers_AnsibleTower_AutomationManager_CloudCredential
end
end
Loading