Hi everyone,
I've been reading the groups here for a while, and have gotten a lot
of things fixed by finding other people's posts, so hopefully someone
will be able to set me straight. I am working on a Puppet deployment
that needs to have a lot of disparate data pulled together, and as far
as the ENC I created to pull it all in, everything has worked great.
However, I'm running into a problem instantiating Apache virtual
hosts. Here is some abridged output from my ENC:
---
classes:
app::lamp:
appdata:
sites:
Some Website:
id: "2"
name: Some Website
servername:
somewebsite.com
svntag_prod: trunk
svntag_dev: trunk
documentroot: ~
Another Website:
id: "4"
name: Another Website
servername:
anotherwebsite.com
svntag_prod: "1.2.0"
svntag_dev: "1.3.0-rc4"
documentroot: ~
Third Website:
id: "6"
name: Third Website
servername:
thirdwebsite.com
svntag_prod: trunk
svntag_dev: trunk
documentroot: "/opt/thirdwebsite/customhtdocs"
So, I have some other classes that are parameterized and I can
reference $appdata[$key] inside those manifests and everything works
fine for strings or arrays. My issue is getting this hash of hashes in
[appdata][sites] turned into vhosts. I tried using create_resources to
no avail, tried dumping the ENC to YAML and using Hiera to parse that,
and I have struck out in every way. And, honestly, I think there must
be a better way to do this. The data is all in a single MySQL table,
so I looked at hiera-mysql backend, but I think I am over my head
here. Has anyone got a good example I could reference doing something
like this, especially for multi-dimensional hashes? I was starting to
look at just converting it to JSON or just comma delimited text and
feed it to Puppet as a string to be parsed, but that just seems wrong.
I've been at this 4 hours now with no luck, any help anyone can
provide would be greatly appreciated.
Thanks,
-Jared