Hello,
I need to store an array of objects in pillar.
Help me please to figure out if it is possible.
Here is a JSON which I need to convert in pillar
nodes: [
{
ip: "192.168.0.1",
port: 8080
},
{
ip: "192.168.0.2",
port: 443
},
{
ip: "192.168.0.3",
port: 8081
}
]
I need to be able to get IP and ports from the array like these:
{{ salt['pillar.get']('nodes:[0]:ip') }}
{{ salt['pillar.get']('nodes:[0]:port') }}
{{ salt['pillar.get']('nodes:[1]:ip') }}
{{ salt['pillar.get']('nodes:[2]:port') }}
Best regards,
Alexandr