From aaa0ed4c72d9190a7f87b31531885144d6482221 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 30 Jun 2017 15:57:25 -0400 Subject: [PATCH] add help text for built-in Tower credential types see: #6561 --- .../0042_v320_drop_v1_credential_fields.py | 2 +- awx/main/models/credential.py | 56 +++++++++++++++---- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/awx/main/migrations/0042_v320_drop_v1_credential_fields.py b/awx/main/migrations/0042_v320_drop_v1_credential_fields.py index b1eb8d6489..ea6f905e0f 100644 --- a/awx/main/migrations/0042_v320_drop_v1_credential_fields.py +++ b/awx/main/migrations/0042_v320_drop_v1_credential_fields.py @@ -99,7 +99,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='credential', 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( model_name='credential', diff --git a/awx/main/models/credential.py b/awx/main/models/credential.py index 585d57ae8e..c3aecae4b7 100644 --- a/awx/main/models/credential.py +++ b/awx/main/models/credential.py @@ -219,10 +219,8 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin): 'CredentialType', related_name='credentials', 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").') + help_text=_('Specify the type of credential you want to create. Refer ' + 'to the Ansible Tower documentation for details on each type.') ) organization = models.ForeignKey( 'Organization', @@ -608,7 +606,10 @@ def ssh(cls): 'id': 'become_method', 'label': 'Privilege Escalation Method', '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', 'label': 'Privilege Escalation Username', @@ -738,6 +739,10 @@ def aws(cls): 'label': 'STS Token', 'type': 'string', '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'] } @@ -764,6 +769,8 @@ def openstack(cls): 'id': 'host', 'label': 'Host (Authentication URL)', 'type': 'string', + 'help_text': ('The host to authenticate with. For example, ' + 'https://openstack.business.com/v2.0/') }, { 'id': 'project', 'label': 'Project (Tenant Name)', @@ -771,7 +778,11 @@ def openstack(cls): }, { 'id': 'domain', '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'] } @@ -789,6 +800,8 @@ def vmware(cls): 'id': 'host', 'label': 'VCenter Host', 'type': 'string', + 'help_text': ('Enter the hostname or IP address which corresponds ' + 'to your VMware vCenter.') }, { 'id': 'username', 'label': 'Username', @@ -815,6 +828,8 @@ def satellite6(cls): 'id': 'host', 'label': 'Satellite 6 URL', 'type': 'string', + 'help_text': ('Enter the URL which corresponds to your Red Hat ' + 'Satellite 6 server. For example, https://satellite.example.org') }, { 'id': 'username', 'label': 'Username', @@ -840,6 +855,9 @@ def cloudforms(cls): 'id': 'host', 'label': 'CloudForms URL', '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', 'label': 'Username', @@ -864,18 +882,25 @@ def gce(cls): 'fields': [{ 'id': 'username', 'label': 'Service Account Email Address', - 'type': 'string' + 'type': 'string', + 'help_text': ('The email address assigned to the Google Compute ' + 'Engine service account.') }, { 'id': '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', 'label': 'RSA Private Key', 'type': 'string', 'format': 'ssh_private_key', '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': [{ 'id': 'username', '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', 'label': 'Management Certificate', 'type': 'string', 'format': 'ssh_private_key', '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': [{ 'id': 'subscription', 'label': 'Subscription ID', - 'type': 'string' + 'type': 'string', + 'help_text': ('Subscription ID is an Azure construct, which is ' + 'mapped to a username.') }, { 'id': 'username', 'label': 'Username',