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

Check parameter handling in molecule tests #56

Open
dometto opened this issue Nov 21, 2023 · 1 comment
Open

Check parameter handling in molecule tests #56

dometto opened this issue Nov 21, 2023 · 1 comment

Comments

@dometto
Copy link
Member

dometto commented Nov 21, 2023

I noticed that a playbook that was passing the tests actually failed to deploy on Research Cloud due to the way that parameters seem to be handled: what was really a string value 'true' on SRC was a boolean true in our molecule setup. This caused the parameters to be handled differently in the role (security_updates). I will research if we can get rid of this discrepancy, or else document that string values should be used for parameters in our tests.

@dometto
Copy link
Member Author

dometto commented Dec 14, 2023

I've investigated the way variables in SRC portal are passed on to ansible using https://github.com/dometto/src-vars-debug

Results (this is what ansible receives, input in SRC portal in the comment on each line):

boolean: 'true' # true
boolean2: 'False' # False
json: '[{name:jammy,component:main,packages:/srv/aptly/pkgs,architectures:[amd64]}]\n[{name:focal,component:main,packages:/srv/aptly/pkgs,architectures:[amd64, arm64]}]' # multiline string becomes oneline string with explicit '\n' in it
stringwithdoublequotes: hello # "hello"
stringwithsinglequotes: hello # 'hello'

As you can see quotes are sanitized, while multiline strings become single line strings, and booleans become strings.

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

No branches or pull requests

1 participant