Skip to content

Latest commit

 

History

History
 
 

manage-credentials

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

manage-credentials

This role manages custom credential for Ansible Tower, ensuring that other components of the Ansible Tower configuration (e.g.: inventories) have access to what is needed.

Requirements

A running Ansible Tower with admin permission level access.

Role Variables

Check the top level README for additional/common variables.

The variables used must be defined in the Ansible Inventory using the ansible_tower.credentials list as explained below.

Variable Description Required Defaults
ansible_tower.credentials.name Name to be used for the credential yes
ansible_tower.credentials.description Description for the credential no nothing('')
ansible_tower.credentials.organization Name of the existing org to tie these credentials with yes
ansible_tower.credentials.type Type of credentials ('machine', 'aws', etc) yes
ansible_tower.credentials.inputs Additional input parameters no

Note: Credential configuration will only happen if the ansible_tower.credentials portion of the dictionary is defined. Likewise, the installation expects this section to be "complete" if specified as it otherwise may error out.

Note: Credential input will only happen if the ansible_tower.credentials.inputs portion of the dictionary is defined and complete as per Tower Credential Types documentation.

Note: User-defined credentials that are not declared in your inventory will be deleted by default after this role is run. Tower-managed credentials can be identified by a 'managed_by_tower field returned by the Tower API and cannot be deleted by the user.

Example Inventory

---

ansible_tower:
  credentials:
  - name: "Cred1"
    description: "My Credential 1"
    organization: "Default"
    credential_type: "Machine"
  - name: "Cred2"
    description: "My Credential 2"
    organization: "Default"
    credential_type: "Machine"
  - name: "Cred3"
    description: "My Credential 3"
    organization: "Default"
    credential_type: "Ansible Tower"
    inputs:
      host: "localhost"
      username: "my_user"
      password: 'my_password'
      verify_ssl: true

Example Playbook

---

- hosts: tower
  roles:
  - role: manage-credentials

License

Apache License 2.0

Author Information

Red Hat Community of Practice & staff of the Red Hat Open Innovation Labs.