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

Issue looping through an array of objects #868

Open
C4F3Z1N opened this issue Feb 13, 2023 · 0 comments
Open

Issue looping through an array of objects #868

C4F3Z1N opened this issue Feb 13, 2023 · 0 comments

Comments

@C4F3Z1N
Copy link

C4F3Z1N commented Feb 13, 2023

I couldn't figure out which combination of functions and arguments I should use to loop through a file backend like this:

---
- ipv4: 192.168.192.99/32
  uuid: eabf31d2-3b00-43ab-83dd-11ebcc665977
  active: false

- ipv4: 192.168.192.180/32
  uuid: b03793b2-512b-4c06-9652-cc97c5b8cb8c
  active: true
...

My template file looks like this:

{{range lsdir "*"}}
	debug: {{.}}
{{end}}

I tried many combinations using the functions map, get, getvs, ls, lsdir, and the arguments "/*", "*", "/", but the error message remains the same:

line 2: cannot unmarshal !!seq into map[interface {}]interface {}

Any help is greatly appreciated.

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

1 participant