Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Custom Credentials on prompt with Workflows #881

Closed
cesarfn4 opened this issue Dec 22, 2017 · 4 comments
Closed

Allow Custom Credentials on prompt with Workflows #881

cesarfn4 opened this issue Dec 22, 2017 · 4 comments

Comments

@cesarfn4
Copy link

ISSUE TYPE
  • Feature Idea
COMPONENT NAME
  • API
SUMMARY

With the introduction of custom credential it is now possible to add several sets of credentials to a job template.

However, it is not possible to add custom credentials during Workflow edition, on top of machine credentials, because we can only select one. The custom credentials do appear in the list but they overwrite the machine credentials when selected.

The only workaround is to leave the default credentials set in the job template, where you can select both machine and custom credentials, and leave it as is in the workflow.

ENVIRONMENT
  • AWX version: 1.0
@AlanCoding
Copy link
Member

This should now be possible in the API. You are probably looking at the credential field on the workflow nodes, but this is only left there for backward-compatibility with clients that have are using the old schema.

Given you have already created your node, go to /api/v2/workflow_job_template_nodes/N/credentials/ and POST {"id": M} to associate credentials by id there.

Note that the job template used by the node needs to have ask_variables_on_launch set to true.

The UI is currently working on implementing this on their side.

@stahloss
Copy link

@AlanCoding We're at AWX 15.0.1 and it seems I don't have the option to provide credentials to Workflow Templates through the UI. Is it not implemented yet?

@AlanCoding
Copy link
Member

You can add credentials to workflow nodes (which will apply to 1 job for that node), but you cannot attach credentials to the Workflow Template itself, such that it applies to all jobs inside the workflow.

@stahloss
Copy link

stahloss commented Dec 8, 2020

@AlanCoding Is it possible to do this at launch time? Because if you change the actual workflow node and multiple runs are launched simultaneously, we'll have possible race conditions on the credentials.

Here I do see a possibility to set credentials on the Workflow at launch. For our use case, we'd like to be able to set one credential at workflow level to override all workflow node credentials for one job.
Now we need to change all individual workflow nodes (which will be many in our case) and nobody should change the credentials in between :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants