Bug 1534096 - Adding credentials is broken in the latest drop due to tower defaulting to v2 api - This makes it impossible to create a ansible_playbook with a vault
Summary: Adding credentials is broken in the latest drop due to tower defaulting to v2...
Keywords:
Status: CLOSED DUPLICATE of bug 1533630
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: GA
: cfme-future
Assignee: James Wong
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-13 02:39 UTC by ldomb
Modified: 2018-01-13 13:54 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-13 13:54:56 UTC
Category: ---
Cloudforms Team: Ansible
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description ldomb 2018-01-13 02:39:57 UTC
Description of problem:
It looks like that the credentials part of ansible inside in CFME is not updated in the latest drop of the appliance. For example, it is not possible anymore to create a machine credential with a vault as the tower api has changed!

Since tower 3.2.x you have to do 3 steps to achieve this: 

[root@host160 ~]# tower-cli credential create --name="rhv-ocp" --organization=CFME --credential-type="Machine" --inputs='{"username":"root","password":"redhat"}'
Resource changed.
== ======= =============== 
id  name   credential_type 
== ======= =============== 
 5 rhv-ocp               1
== ======= =============== 

[root@host160 ~]# tower-cli credential create --name="rhv-ocp-vault" --organization=CFME --inputs='{"vault_password":"redhat"}'  --credential-type="Vault"
Resource changed.
== ============= =============== 
id     name      credential_type 
== ============= =============== 
 6 rhv-ocp-vault               3
== ============= =============== 
[root@host160 ~]# tower-cli inventory list
== ====================== ============ 
id          name          organization 
== ====================== ============ 
 2 CFME Default Inventory            2
== ====================== ============ 
[root@host160 ~]# tower-cli job_template create --name ocp-rhv --project=rhv-ocp --inventory=2 --credential rhv-ocp --vault-credential rhv-ocp-vault --playbook ocp-deploy-rhv.yml
Resource changed.
== ======= ========= ======= ================== 
id  name   inventory project      playbook      
== ======= ========= ======= ================== 
 7 ocp-rhv         2       6 ocp-deploy-rhv.yml
== ======= ========= ======= ================== 

So what it means is that the method needs to be rewritten which communicates with tower 3.2.x. What's worse is that when creating a catalog item now I can only choose machine creds. These Machine creds do NOT have vaults anymore. Thus I cannot decrypt my vault during the run. 

This needs to be adapted/fixed to the behavior of tower 3.2 where multiple creds can be select to run a job. Unless we fall back to v1 tower api we will have to make multi creds available for the ansible inside playbook job.

Version-Release number of selected component (if applicable):
5.9.0.16.20180109204148_7ac9852

How reproducible:


Steps to Reproduce:
1. Create a ansible inside machine credential and add vault variables
2.
3.

Actual results:
This will fail


Expected results:
This should work

Additional info:

You can use my step to create one. Then go to the catalog item and try to add the vault variable which was just created. You won't be able to add it as the UI does not let me choose 2 creds. Which would be machine + vault. Or ec2 plus vault etc...

Please let me know if there are any questions.

Comment 2 Greg McCullough 2018-01-13 13:54:56 UTC
Thanks

*** This bug has been marked as a duplicate of bug 1533630 ***


Note You need to log in before you can comment on or make changes to this bug.