Confd doesn't work with yaml list?

41 views
Skip to first unread message

Siang Jin

unread,
Jan 2, 2020, 8:33:03 PM1/2/20
to confd-users
Hey group,
I posted a issue here:
https://github.com/kelseyhightower/confd/issues/818

I have a yaml file format like:

sshd:
  pubkeys:
    user1:
      - key1
      - key2
    user2:
      - key1

Then I would like to use confd template to generate a config file based on it.
Looks like confd doesn't like the formate, I tried the following template:

{{range gets "/sshd/pubkeys/*"}}
{{.}}
{{end}}

But it returned nothing.
Could someone take a look?


Also,

I tried:

{{range $pub_key := ls "/sshd/pubkeys/user1"}}
{{$pub_key}}
{{end}}

I expected it will return key1 and key2 to me, but instead, I got value 0 and 1, so the index.
How could I get the value?

Reply all
Reply to author
Forward
0 new messages