-
Notifications
You must be signed in to change notification settings - Fork 11
Gain access to role vars in Goss test files #3
Comments
I have been using j2cli for this purpose. I can then update my development goss tests by running (e.g. in nginx role)
We just need to adapt
Does this somehow help? Can it be integrated into molecule? |
@t2d have you got a working example on Github that we can take a look at please ? |
Would it be a good idea to put a verifier task as a yml file inside role tasks? Then you can execute it with molecule verify.yml. In that way you could access inventory and role vars. Also run it in other deployments. |
@decentral1se I think it's possible this request was addressed by @markwell-ch via PR #13 Can you verify? |
Awesome, that works like a charm! systemli/ansible-role-sshd@abc6136 Thanks @markwell-ch ! |
Transferring ansible/molecule#2375 to here.
We need to pass the role
defaults/main.yml
andvars/main.yml
into the verifier (like goss). If I have in mydefaults/main.yml
:And then a Goss test like:
My tests and my vars can quickly get out of sync when I change my vars.
How can we receive vars from Ansible in the context of Molecule?
The text was updated successfully, but these errors were encountered: