tower_credential – create, update, or destroy Ansible Tower credential
tower_credential – create, update, or destroy Ansible Tower credential
Synopsis
- Create, update, or destroy Ansible Tower credentials. See https://www.ansible.com/tower for an overview.
Requirements
The below requirements are needed on the host that executes this module.
- ansible-tower-cli >= 3.0.2
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
authorize boolean |
|
Should use authorize for net type. |
authorize_password string |
Password for net credentials that require authorize. | |
become_method string |
|
Become method to use for privilege escalation. |
become_password string |
Become password. Use "ASK" and launch in Tower to be prompted. | |
become_username string |
Become username. Use "ASK" and launch in Tower to be prompted. | |
client string |
Client or application ID for azure_rm type. | |
description string |
The description to use for the credential. | |
domain string |
Domain for openstack type. | |
host string |
Host for this credential. | |
kind string / required |
|
Type of credential being added. The ssh choice refers to a Tower Machine credential. |
name string / required |
The name to use for the credential. | |
organization string / required |
Organization that should own the credential. | |
password string |
Password for this credential. ``secret_key`` for AWS. ``api_key`` for RAX. Use "ASK" and launch in Tower to be prompted. | |
project string |
Project that should for this credential. | |
secret string |
Secret token for azure_rm type. | |
security_token string added in 2.6 |
STS token for aws type. | |
ssh_key_data string |
SSH private key content. To extract the content from a file path, use the lookup function (see examples). | |
ssh_key_unlock string |
Unlock password for ssh_key. Use "ASK" and launch in Tower to be prompted. | |
state string |
|
Desired state of the resource. |
subscription string |
Subscription ID for azure_rm type. | |
team string |
Team that should own this credential. | |
tenant string |
Tenant ID for azure_rm type. | |
tower_config_file path |
Path to the Tower config file. | |
tower_host string |
URL to your Tower instance. | |
tower_password string |
Password for your Tower instance. | |
tower_username string |
Username for your Tower instance. | |
user string |
User that should own this credential. | |
username string |
Username for this credential. ``access_key`` for AWS. | |
validate_certs boolean |
|
Whether to allow insecure connections to Tower. If This should only be used on personally controlled sites using self-signed certificates.
|
vault_id string added in 2.8 |
Vault identifier. This parameter is only valid if | |
vault_password string |
Vault password. Use "ASK" and launch in Tower to be prompted. |
Notes
Note
- If no config_file is provided we will attempt to use the tower-cli library defaults to find your Tower host information.
- config_file should contain Tower configuration in the following format host=hostname username=username password=password
Examples
- name: Add tower credential
tower_credential:
name: Team Name
description: Team Description
organization: test-org
kind: ssh
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Create a valid SCM credential from a private_key file
tower_credential:
name: SCM Credential
organization: Default
state: present
kind: scm
username: joe
password: secret
ssh_key_data: "{{ lookup('file', '/tmp/id_rsa') }}"
ssh_key_unlock: "passphrase"
- name: Fetch private key
slurp:
src: '$HOME/.ssh/aws-private.pem'
register: aws_ssh_key
- name: Add Credential Into Tower
tower_credential:
name: Workshop Credential
ssh_key_data: "{{ aws_ssh_key['content'] | b64decode }}"
kind: ssh
organization: Default
tower_username: admin
tower_password: ansible
tower_host: https://localhost
run_once: true
delegate_to: localhost
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors
- Wayne Witzel III (@wwitzel3)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/tower_credential_module.html