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

Passing extra-vars via key=value is broken #46

Open
ibuziuk opened this issue Sep 4, 2018 · 5 comments
Open

Passing extra-vars via key=value is broken #46

ibuziuk opened this issue Sep 4, 2018 · 5 comments

Comments

@ibuziuk
Copy link

ibuziuk commented Sep 4, 2018

Originally the issue [1] was found in eclipse-che where tests are executed via the following command using the canary version of apb-base :

oc run "${APB_NAME}-test" -it --restart='Never' --image "${REGISTRY}/${APB_NAME}/${APB_NAME}" --env "OPENSHIFT_TOKEN=${OC_PASS}" --env "OPENSHIFT_TARGET=https://kubernetes.default.svc" --env "POD_NAME=${APB_NAME}-test" --env "POD_NAMESPACE=${APB_NAME}" --overrides='{"apiVersion":"v1","spec":{"serviceAccountName":"apb"}}' -- test -e namespace=${APB_NAME}

The following command works correctly against sprint150.1 version of apb-base, but fails with the following error against the most recent version:

ERROR! Invalid extra vars data supplied. '@/opt/apb/env/extravars' could not be made into a dictionary

Basically, it appeared to be that on the recent version of apb-base extra vars must be passed the following way: -e "{"namespace": "${APB_NAME}"}" and -e namespace=${APB_NAME} way of passing extra vars is not supported currently even though the docs are saying the opposite:

-e EXTRA_VARS, --extra-vars=EXTRA_VARS
set additional variables as key=value or YAML/JSON, if
filename prepend with @

[1] ansibleplaybookbundle/eclipse-che-apb#23

@ibuziuk
Copy link
Author

ibuziuk commented Sep 4, 2018

@djzager could you please clarify if this is a regression or now it would be possible to add extra-vars only via json / yaml ?

@rgolangh
Copy link
Contributor

@ibuziuk maybe related to what you saw #49

@djzager
Copy link
Contributor

djzager commented Oct 10, 2018

Apologies are two-fold @ibuziuk

  1. Delayed response, was out on paternity leave
  2. For the change in behavior. When I was working on updating our APB base to use ansible-runner, my goal was to make it so there was no change in behavior. In the end, from a practicality and maintainability perspective it made the most sense to ensure that it absolutely works for the way the Automation Broker invokes the APB. That is the reason that it is only possible to use JSON string after --extra-vars.

Hope that helps.

@jorgemoralespou
Copy link

This seems to have broken many APBs that used FROM ansibleplaybookbundle/apb-base
I've pinned the APBs I own to FROM ansibleplaybookbundle/apb-base:release-1.2 to make them work until I change how I pass extra-vars.

e.g. https://github.com/openshift-labs/starter-guides/tree/ocp-3.11/apb

@tatemz
Copy link

tatemz commented Apr 2, 2020

Getting this error too, but fixing the version to release-1.2 did not work

Is this repo still alive? If not, is there an alternative solution to replace APBs?

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

No branches or pull requests

5 participants