tower_credential: Add parameter vault_id (#53400)
vault_id allows user to specify vault identifier as per Tower UI. Fixes: #45644 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
b94bfed1a6
commit
831f068f98
1 changed files with 37 additions and 2 deletions
|
@ -27,43 +27,56 @@ options:
|
||||||
description:
|
description:
|
||||||
- The name to use for the credential.
|
- The name to use for the credential.
|
||||||
required: True
|
required: True
|
||||||
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- The description to use for the credential.
|
- The description to use for the credential.
|
||||||
|
type: str
|
||||||
user:
|
user:
|
||||||
description:
|
description:
|
||||||
- User that should own this credential.
|
- User that should own this credential.
|
||||||
|
type: str
|
||||||
team:
|
team:
|
||||||
description:
|
description:
|
||||||
- Team that should own this credential.
|
- Team that should own this credential.
|
||||||
|
type: str
|
||||||
project:
|
project:
|
||||||
description:
|
description:
|
||||||
- Project that should for this credential.
|
- Project that should for this credential.
|
||||||
|
type: str
|
||||||
organization:
|
organization:
|
||||||
description:
|
description:
|
||||||
- Organization that should own the credential.
|
- Organization that should own the credential.
|
||||||
required: True
|
required: True
|
||||||
|
type: str
|
||||||
kind:
|
kind:
|
||||||
description:
|
description:
|
||||||
- Type of credential being added. The ssh choice refers to a Tower Machine credential.
|
- Type of credential being added.
|
||||||
|
- The ssh choice refers to a Tower Machine credential.
|
||||||
required: True
|
required: True
|
||||||
|
type: str
|
||||||
choices: ["ssh", "vault", "net", "scm", "aws", "vmware", "satellite6", "cloudforms", "gce", "azure_rm", "openstack", "rhv", "insights", "tower"]
|
choices: ["ssh", "vault", "net", "scm", "aws", "vmware", "satellite6", "cloudforms", "gce", "azure_rm", "openstack", "rhv", "insights", "tower"]
|
||||||
host:
|
host:
|
||||||
description:
|
description:
|
||||||
- Host for this credential.
|
- Host for this credential.
|
||||||
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- Username for this credential. access_key for AWS.
|
- Username for this credential. access_key for AWS.
|
||||||
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for this credential. Use ASK for prompting. secret_key for AWS. api_key for RAX.
|
- Password for this credential. Use ASK for prompting. secret_key for AWS. api_key for RAX.
|
||||||
|
type: str
|
||||||
ssh_key_data:
|
ssh_key_data:
|
||||||
description:
|
description:
|
||||||
- SSH private key content. To extract the content from a file path, use the lookup function (see examples).
|
- SSH private key content. To extract the content from a file path, use the lookup function (see examples).
|
||||||
required: False
|
required: False
|
||||||
|
type: str
|
||||||
ssh_key_unlock:
|
ssh_key_unlock:
|
||||||
description:
|
description:
|
||||||
- Unlock password for ssh_key. Use ASK for prompting.
|
- Unlock password for ssh_key. Use ASK for prompting.
|
||||||
|
type: str
|
||||||
authorize:
|
authorize:
|
||||||
description:
|
description:
|
||||||
- Should use authorize for net type.
|
- Should use authorize for net type.
|
||||||
|
@ -72,43 +85,61 @@ options:
|
||||||
authorize_password:
|
authorize_password:
|
||||||
description:
|
description:
|
||||||
- Password for net credentials that require authorize.
|
- Password for net credentials that require authorize.
|
||||||
|
type: str
|
||||||
client:
|
client:
|
||||||
description:
|
description:
|
||||||
- Client or application ID for azure_rm type.
|
- Client or application ID for azure_rm type.
|
||||||
|
type: str
|
||||||
security_token:
|
security_token:
|
||||||
description:
|
description:
|
||||||
- STS token for aws type.
|
- STS token for aws type.
|
||||||
version_added: "2.6"
|
version_added: "2.6"
|
||||||
|
type: str
|
||||||
secret:
|
secret:
|
||||||
description:
|
description:
|
||||||
- Secret token for azure_rm type.
|
- Secret token for azure_rm type.
|
||||||
|
type: str
|
||||||
subscription:
|
subscription:
|
||||||
description:
|
description:
|
||||||
- Subscription ID for azure_rm type.
|
- Subscription ID for azure_rm type.
|
||||||
|
type: str
|
||||||
tenant:
|
tenant:
|
||||||
description:
|
description:
|
||||||
- Tenant ID for azure_rm type.
|
- Tenant ID for azure_rm type.
|
||||||
|
type: str
|
||||||
domain:
|
domain:
|
||||||
description:
|
description:
|
||||||
- Domain for openstack type.
|
- Domain for openstack type.
|
||||||
|
type: str
|
||||||
become_method:
|
become_method:
|
||||||
description:
|
description:
|
||||||
- Become method to use for privilege escalation.
|
- Become method to use for privilege escalation.
|
||||||
choices: ["None", "sudo", "su", "pbrun", "pfexec", "pmrun"]
|
choices: ["None", "sudo", "su", "pbrun", "pfexec", "pmrun"]
|
||||||
|
type: str
|
||||||
become_username:
|
become_username:
|
||||||
description:
|
description:
|
||||||
- Become username. Use ASK for prompting.
|
- Become username. Use ASK for prompting.
|
||||||
|
type: str
|
||||||
become_password:
|
become_password:
|
||||||
description:
|
description:
|
||||||
- Become password. Use ASK for prompting.
|
- Become password. Use ASK for prompting.
|
||||||
|
type: str
|
||||||
vault_password:
|
vault_password:
|
||||||
description:
|
description:
|
||||||
- Vault password. Use ASK for prompting.
|
- Vault password. Use ASK for prompting.
|
||||||
|
type: str
|
||||||
|
vault_id:
|
||||||
|
description:
|
||||||
|
- Vault identifier.
|
||||||
|
- This parameter is only valid if C(kind) is specified as C(vault).
|
||||||
|
type: str
|
||||||
|
version_added: "2.8"
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Desired state of the resource.
|
- Desired state of the resource.
|
||||||
choices: ["present", "absent"]
|
choices: ["present", "absent"]
|
||||||
default: "present"
|
default: "present"
|
||||||
|
type: str
|
||||||
extends_documentation_fragment: tower
|
extends_documentation_fragment: tower
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -227,6 +258,7 @@ def main():
|
||||||
organization=dict(required=True),
|
organization=dict(required=True),
|
||||||
project=dict(),
|
project=dict(),
|
||||||
state=dict(choices=['present', 'absent'], default='present'),
|
state=dict(choices=['present', 'absent'], default='present'),
|
||||||
|
vault_id=dict(),
|
||||||
)
|
)
|
||||||
|
|
||||||
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
|
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||||
|
@ -289,11 +321,14 @@ def main():
|
||||||
else:
|
else:
|
||||||
module.params['ssh_key_data'] = data
|
module.params['ssh_key_data'] = data
|
||||||
|
|
||||||
|
if module.params.get('vault_id', None) and module.params.get('kind') != 'vault':
|
||||||
|
module.fail_json(msg="Parameter 'vault_id' is only valid if parameter 'kind' is specified as 'vault'")
|
||||||
|
|
||||||
for key in ('authorize', 'authorize_password', 'client',
|
for key in ('authorize', 'authorize_password', 'client',
|
||||||
'security_token', 'secret', 'tenant', 'subscription',
|
'security_token', 'secret', 'tenant', 'subscription',
|
||||||
'domain', 'become_method', 'become_username',
|
'domain', 'become_method', 'become_username',
|
||||||
'become_password', 'vault_password', 'project', 'host',
|
'become_password', 'vault_password', 'project', 'host',
|
||||||
'username', 'password', 'ssh_key_data',
|
'username', 'password', 'ssh_key_data', 'vault_id',
|
||||||
'ssh_key_unlock'):
|
'ssh_key_unlock'):
|
||||||
if 'kind' in params:
|
if 'kind' in params:
|
||||||
params[key] = module.params.get(key)
|
params[key] = module.params.get(key)
|
||||||
|
|
Loading…
Reference in a new issue