ansible.builtin.tower_credential (v2.7.16) — module

create, update, or destroy Ansible Tower credential.

| "added in version" 2.3 of ansible.builtin"

Authors: Wayne Witzel III (@wwitzel3)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.7.16

Description

Create, update, or destroy Ansible Tower credentials. See U(https://www.ansible.com/tower) for an overview.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add Credential Into Tower
  tower_credential:
    name: Workshop Credential
    ssh_key_data: "/home/{{ansible_user}}/.ssh/aws-private.pem"
    kind: ssh
    organization: Default
    tower_username: admin
    tower_password: ansible
    tower_host: https://localhost
  run_once: true
  delegate_to: localhost

Inputs

    
host:
    description:
    - Host for this credential.

kind:
    choices:
    - ssh
    - vault
    - net
    - scm
    - aws
    - vmware
    - satellite6
    - cloudforms
    - gce
    - azure_rm
    - openstack
    - rhv
    - insights
    - tower
    description:
    - Type of credential being added.  The ssh choice refers to a Tower Machine credential.
    required: true

name:
    description:
    - The name to use for the credential.
    required: true

team:
    description:
    - Team that should own this credential.

user:
    description:
    - User that should own this credential.

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Desired state of the resource.

client:
    default: null
    description:
    - Client or application ID for azure_rm type.
    required: false

domain:
    description:
    - Domain for openstack type.

secret:
    description:
    - Secret token for azure_rm type.

tenant:
    description:
    - Tenant ID for azure_rm type.

project:
    description:
    - Project that should for this credential.

password:
    description:
    - Password for this credential. Use ASK for prompting. secret_key for AWS. api_key
      for RAX.

username:
    description:
    - Username for this credential. access_key for AWS.

authorize:
    default: 'no'
    description:
    - Should use authorize for net type.
    type: bool

description:
    description:
    - The description to use for the credential.

organization:
    description:
    - Organization that should own the credential.
    required: true

ssh_key_data:
    description:
    - Path to SSH private key.

subscription:
    description:
    - Subscription ID for azure_rm type.

become_method:
    choices:
    - None
    - sudo
    - su
    - pbrun
    - pfexec
    - pmrun
    description:
    - Become method to Use for privledge escalation.

security_token:
    default: null
    description:
    - STS token for aws type.
    required: false
    version_added: '2.6'
    version_added_collection: ansible.builtin

ssh_key_unlock:
    description:
    - Unlock password for ssh_key. Use ASK for prompting.

validate_certs:
    aliases:
    - tower_verify_ssl
    description:
    - Whether to allow insecure connections to AWX.
    - If C(no), SSL certificates will not be validated.
    - This should only be used on personally controlled sites using self-signed certificates.
    - If value not set, will try environment variable C(CONTROLLER_VERIFY_SSL) and then
      config files
    type: bool

vault_password:
    description:
    - Vault password. Use ASK for prompting.

become_password:
    description:
    - Become password. Use ASK for prompting.

become_username:
    description:
    - Become username. Use ASK for prompting.

controller_host:
    aliases:
    - tower_host
    description:
    - URL to your Automation Platform Controller instance.
    - If value not set, will try environment variable C(CONTROLLER_HOST) and then config
      files
    - If value not specified by any means, the value of C(127.0.0.1) will be used
    type: str

authorize_password:
    description:
    - Password for net credentials that require authorize.

controller_password:
    aliases:
    - tower_password
    description:
    - Password for your controller instance.
    - If value not set, will try environment variable C(CONTROLLER_PASSWORD) and then
      config files
    type: str

controller_username:
    aliases:
    - tower_username
    description:
    - Username for your controller instance.
    - If value not set, will try environment variable C(CONTROLLER_USERNAME) and then
      config files
    type: str

controller_oauthtoken:
    aliases:
    - tower_oauthtoken
    description:
    - The OAuth token to use.
    - This value can be in one of two formats.
    - A string which is the token itself. (i.e. bqV5txm97wqJqtkxlMkhQz0pKhRMMX)
    - A dictionary structure as returned by the token module.
    - If value not set, will try environment variable C(CONTROLLER_OAUTH_TOKEN) and then
      config files
    type: raw
    version_added: 3.7.0
    version_added_collection: awx.awx

controller_config_file:
    aliases:
    - tower_config_file
    description:
    - Path to the controller config file.
    - If provided, the other locations for config files will not be considered.
    type: path