Hello AWX community
I am trying to CI/CD from JIRA → Bitbicket → Ansible Tower.
I think the documentation on how to pipeline from Bitbicket is out of date now tower-cli uses Oauth2.
Can anyone please guide me on how to script the setup of the tower-cli connection to tower.
There is official documentation here:
https://bitbucket.org/AnsibleByRedHat/ansible-tower-pipelines/src/master/
And it provides an example “tower.bash”
This example references the pre tower 3.3 Oauth2 login commands:
$ tower-cli config host tower.example.com
$ tower-cli config username user
$ tower-cli config password pass
To connect to the current tower version you need to use
$ tower-cli config host tower.example.com
$ tower-cli login username
Password:
I am not very experienced at this stuff but it looks to me like, In the legacy mode a variable can be used to set the password in to the ~/.tower-cli.cfg file.
I had a play with the “tower-cli login” command. I don’t know of a way to answer the prompt for the password. I think this can not be handled in the script. I think it produces the error
“/usr/local/lib/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the terminal. passwd = fallback_getpass(prompt, stream)Warning: Password input may be echoed.”
Can someone with better coding than me please confirm that I am correct or not.
Please suggest a way forward.
Is there such thing as an Oath2 command in bash that can take a variable for the password?
Best Regards
Ian