add help text for built-in Tower credential types

see: #6561
This commit is contained in:
Ryan Petrello
2017-06-30 15:57:25 -04:00
parent 42a55cd1b3
commit aaa0ed4c72
2 changed files with 45 additions and 13 deletions

View File

@@ -99,7 +99,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='credential', model_name='credential',
name='credential_type', name='credential_type',
field=models.ForeignKey(related_name='credentials', to='main.CredentialType', null=False, help_text='Type for this credential. Credential Types define valid fields (e.g,. "username", "password") and their properties (e.g,. "username is required" or "password should be stored with encryption").') field=models.ForeignKey(related_name='credentials', to='main.CredentialType', null=False, help_text='Specify the type of credential you want to create. Refer to the Ansible Tower documentation for details on each type.')
), ),
migrations.AlterField( migrations.AlterField(
model_name='credential', model_name='credential',

View File

@@ -219,10 +219,8 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
'CredentialType', 'CredentialType',
related_name='credentials', related_name='credentials',
null=False, null=False,
help_text=_('Type for this credential. Credential Types define ' help_text=_('Specify the type of credential you want to create. Refer '
'valid fields (e.g,. "username", "password") and their ' 'to the Ansible Tower documentation for details on each type.')
'properties (e.g,. "username is required" or "password '
'should be stored with encryption").')
) )
organization = models.ForeignKey( organization = models.ForeignKey(
'Organization', 'Organization',
@@ -608,7 +606,10 @@ def ssh(cls):
'id': 'become_method', 'id': 'become_method',
'label': 'Privilege Escalation Method', 'label': 'Privilege Escalation Method',
'choices': map(operator.itemgetter(0), 'choices': map(operator.itemgetter(0),
V1Credential.FIELDS['become_method'].choices) V1Credential.FIELDS['become_method'].choices),
'help_text': ('Specify a method for "become" operations. This is '
'equivalent to specifying the --become-method '
'Ansible parameter.')
}, { }, {
'id': 'become_username', 'id': 'become_username',
'label': 'Privilege Escalation Username', 'label': 'Privilege Escalation Username',
@@ -738,6 +739,10 @@ def aws(cls):
'label': 'STS Token', 'label': 'STS Token',
'type': 'string', 'type': 'string',
'secret': True, 'secret': True,
'help_text': ('Security Token Service (STS) is a web service '
'that enables you to request temporary, '
'limited-privilege credentials for AWS Identity '
'and Access Management (IAM) users.'),
}], }],
'required': ['username', 'password'] 'required': ['username', 'password']
} }
@@ -764,6 +769,8 @@ def openstack(cls):
'id': 'host', 'id': 'host',
'label': 'Host (Authentication URL)', 'label': 'Host (Authentication URL)',
'type': 'string', 'type': 'string',
'help_text': ('The host to authenticate with. For example, '
'https://openstack.business.com/v2.0/')
}, { }, {
'id': 'project', 'id': 'project',
'label': 'Project (Tenant Name)', 'label': 'Project (Tenant Name)',
@@ -771,7 +778,11 @@ def openstack(cls):
}, { }, {
'id': 'domain', 'id': 'domain',
'label': 'Domain Name', 'label': 'Domain Name',
'type': 'string' 'type': 'string',
'help_text': ('OpenStack domains define administrative boundaries. '
'It is only needed for Keystone v3 authentication '
'URLs. Refer to Ansible Tower documentation for '
'common scenarios.')
}], }],
'required': ['username', 'password', 'host', 'project'] 'required': ['username', 'password', 'host', 'project']
} }
@@ -789,6 +800,8 @@ def vmware(cls):
'id': 'host', 'id': 'host',
'label': 'VCenter Host', 'label': 'VCenter Host',
'type': 'string', 'type': 'string',
'help_text': ('Enter the hostname or IP address which corresponds '
'to your VMware vCenter.')
}, { }, {
'id': 'username', 'id': 'username',
'label': 'Username', 'label': 'Username',
@@ -815,6 +828,8 @@ def satellite6(cls):
'id': 'host', 'id': 'host',
'label': 'Satellite 6 URL', 'label': 'Satellite 6 URL',
'type': 'string', 'type': 'string',
'help_text': ('Enter the URL which corresponds to your Red Hat '
'Satellite 6 server. For example, https://satellite.example.org')
}, { }, {
'id': 'username', 'id': 'username',
'label': 'Username', 'label': 'Username',
@@ -840,6 +855,9 @@ def cloudforms(cls):
'id': 'host', 'id': 'host',
'label': 'CloudForms URL', 'label': 'CloudForms URL',
'type': 'string', 'type': 'string',
'help_text': ('Enter the URL for the virtual machine which '
'corresponds to your CloudForm instance. '
'For example, https://cloudforms.example.org')
}, { }, {
'id': 'username', 'id': 'username',
'label': 'Username', 'label': 'Username',
@@ -864,18 +882,25 @@ def gce(cls):
'fields': [{ 'fields': [{
'id': 'username', 'id': 'username',
'label': 'Service Account Email Address', 'label': 'Service Account Email Address',
'type': 'string' 'type': 'string',
'help_text': ('The email address assigned to the Google Compute '
'Engine service account.')
}, { }, {
'id': 'project', 'id': 'project',
'label': 'Project', 'label': 'Project',
'type': 'string' 'type': 'string',
'help_text': ('The Project ID is the GCE assigned identification. '
'It is constructed as two words followed by a three '
'digit number. Example: adjective-noun-000')
}, { }, {
'id': 'ssh_key_data', 'id': 'ssh_key_data',
'label': 'RSA Private Key', 'label': 'RSA Private Key',
'type': 'string', 'type': 'string',
'format': 'ssh_private_key', 'format': 'ssh_private_key',
'secret': True, 'secret': True,
'multiline': True 'multiline': True,
'help_text': ('Paste the contents of the PEM file associated '
'with the service account email.')
}] }]
} }
) )
@@ -891,14 +916,19 @@ def azure(cls):
'fields': [{ 'fields': [{
'id': 'username', 'id': 'username',
'label': 'Subscription ID', 'label': 'Subscription ID',
'type': 'string' 'type': 'string',
'help_text': ('Subscription ID is an Azure construct, which is '
'mapped to a username.')
}, { }, {
'id': 'ssh_key_data', 'id': 'ssh_key_data',
'label': 'Management Certificate', 'label': 'Management Certificate',
'type': 'string', 'type': 'string',
'format': 'ssh_private_key', 'format': 'ssh_private_key',
'secret': True, 'secret': True,
'multiline': True 'multiline': True,
'help_text': ('Paste the contents of the PEM file that corresponds '
'to the certificate you uploaded in the Microsoft '
'Azure console.')
}] }]
} }
) )
@@ -914,7 +944,9 @@ def azure_rm(cls):
'fields': [{ 'fields': [{
'id': 'subscription', 'id': 'subscription',
'label': 'Subscription ID', 'label': 'Subscription ID',
'type': 'string' 'type': 'string',
'help_text': ('Subscription ID is an Azure construct, which is '
'mapped to a username.')
}, { }, {
'id': 'username', 'id': 'username',
'label': 'Username', 'label': 'Username',