Ansible Tower/AWX Credential Management

31 views
Skip to first unread message

Yantram Cloud

unread,
Jan 10, 2021, 2:35:50 AM1/10/21
to Ansible Project
All,
I am looking a way to access credentials that are setup in Ansible Tower credentials.
The scenario I am testing is to clone a private git repo. the way I found to pass the username and password are as follows.

---
- hosts: all 
  gather_facts: no
  become: yes
  tasks:
    - name: install git package
      apt:
        name: git

    - name: Get updated files from git repository 
      git: 
        repo: "https://{{ githubuser | urlencode }}:{{ githubpassword | urlencode }}@github.com/privrepo.git"
        dest: /tmp


Now in this, I want to use the githubuser and githubpassword to be passed from the credentials i have setup under the Credentials in Ansible Tower or a way to pass the credentials securely to my playbook?

Thanks,
Jayant


Dick Visser

unread,
Jan 10, 2021, 2:53:11 AM1/10/21
to ansible...@googlegroups.com
Hi
This is the ansible list, your question will get more/better response on the dedicated awx list. Give that a try.

Btw i would use public keys or tokens btw for interaction with GitHub, definitely not user password of the actual account.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4e2b5dfe-f1c7-4975-9c78-ce7d8c534cd8n%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Yantram Cloud

unread,
Jan 10, 2021, 3:05:14 AM1/10/21
to ansible...@googlegroups.com
Thanks, i will post this in the AWX group.
However, the problem is not just limited to git.
 there are scenarios where I need to access the credentials especially the username which is in credentials.

Thanks,
Jayant

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/hG7wij4MVPQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwMGMw3TttvAoQGHuu7pbpxB7QsbBU9pznQseTqn1wSvCw%40mail.gmail.com.

Wei-Yen Tan

unread,
Jan 10, 2021, 3:54:10 AM1/10/21
to ansible...@googlegroups.com
I have done this exact task before for a custom credential. We can talk over there


From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Yantram Cloud <yantra...@gmail.com>
Sent: Sunday, January 10, 2021 9:04:45 PM
To: ansible...@googlegroups.com <ansible...@googlegroups.com>
Subject: Re: [ansible-project] Ansible Tower/AWX Credential Management
 
Reply all
Reply to author
Forward
0 new messages