Closed thatsk closed 4 years ago
root@: ~# cat goss_package.yaml package: # Looping over a variables defined in a vars.yaml using $OS environment variable as a lookup key {{range $name, $vers := index .Vars .Env.node_type "packages"}} {{$name}}: installed: true versions: {{range $vers}} - {{.}} {{end}} {{end}} root@: ~# cat test.yaml package: PyYAML: installed: true versions: - 3.11-1.el7.x86_64 acl: installed: true versions: - 2.2.51-14.el7.x86_64 httpd: installed: true versions: - 2.2.17 root@: ~# cat vars.yaml test: packages: httpd: - 2.2.15 root@: ~# node_type=test goss --vars vars.yaml -g goss.yaml render package: PyYAML: installed: true versions: - 3.11-1.el7.x86_64 acl: installed: true versions: - 2.2.51-14.el7.x86_64 httpd: installed: true versions: - 2.2.17``` ```root@: ~# cat goss.yaml gossfile: /root/goss_package.yaml: {} /root/test.yaml: {}``` if its new packages it will override and render ```root@: ~# cat vars.yaml test: packages: kunal: - 2.2.15``` ```root@: ~# node_type=test goss --vars vars.yaml -g goss.yaml render package: PyYAML: installed: true versions: - 3.11-1.el7.x86_64 acl: installed: true versions: - 2.2.51-14.el7.x86_64 httpd: installed: true versions: - 2.2.17 kunal: installed: true versions: - 2.2.15```
I'm having a hard time understanding the question, bug, or feature request here.
Can you provide explanation text with small yaml examples?