Hi Guys,
I have a json configuration file on each Puppet Agent that I need to parse
and return the values as custom facts. Each json file will contain an
array of from 0 to n elements each of which will have needed configuration
settings. I think what I need to write is an aggregate fact where the
specific elements in the array will be represented as chunks. Here's a
simplified example of the json file.
{
"Sites":
[
{
"WEB_ID": "0006",
"BACKUP_LIVE": "True",
"BACKUP_TEST": "False",
"LIVE_DIR": "/srv/www/live-0006.net",
"TEST_DIR": "/srv/www/test-0006.net",
},
{
"WEB_ID": "0145",
"BACKUP_LIVE": "True",
"BACKUP_TEST": "False",
"LIVE_DIR": "/srv/www/live-0145.net",
"TEST_DIR": "/srv/www/test-0145.net"
},
{
"WEB_ID": "0000",
"BACKUP_LIVE": "True",
"BACKUP_TEST": "False",
"LIVE_DIR": "/srv/www/live-0000.net",
"TEST_DIR": "/srv/www/test-0000.net"
}
]
}
I don't think writing the fact would be too difficult but I don't know how
to reference the facts from within a manifest on the Puppet Master. I
would like to be able to access these settings using a custom fact from
within a manifest. Something like:
value=Sites[2]["LIVE_DIR"]
and have the variable, value, set to '/srv/www/test-0000.net'.
If you have an aggregate fact, how to you use it in a manifest?
Is this possible?
Thanks.....
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/e9496d7e-c42f-49e6-b64b-2b8b17c81263%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.