naftulikay / ansible-role-degoss

An Ansible role for installing, running, and removing Goss from a system without leaving any traces.
Other
42 stars 12 forks source link

Can't write variables into test templates #52

Closed asciifaceman closed 4 years ago

asciifaceman commented 4 years ago

It doesn't appear goss templates are taking in variables set anywhere, whether facts or direct

Goss call in playbook

    - role: degoss
      goss_file: tests/goss/install.yml
      vars:
          somevar: hostname
      goss_variables:
          somevar: hostname

tests/goss/install.yml

command:
  version:
    exit-status: 0
    exec: "{{ somevar }}"
Goss Execution Failed (Unable to run tests) (rc=1)
  2020/03/04 23:45:28 template: goss:16: function "somevar" not defined
asciifaceman commented 4 years ago

Appears to be a docs breakdown, had to code dive to find usage

"{{ .Vars.somevar }}"
asciifaceman commented 4 years ago

Documented via #53

No fix required, just knowledge