Thanks Pete and John.
Now we've got a puppet module that use a unique file in hiera, inside this
file (associative hash), we've all the customers and the specific data from
each one. This allow us to create Vhosts in Apache, creates specific tomcat
webapps, set quotas in distributed file systems...
All the Apaches nodes has all vhosts from the customers, and the same for
the tomcat and distributed filesystems.
The idea is to split this file in a file per customer, manage and creates
one file per customer is easier than one big file with all the customers.
And merge this set of files in execution time with a hiera merge.
current:
$ cat data/customers.yaml
---
### customers
customers:
client1:
code: 'c1'
name: 'client1'
pre : 'yes'
pro: 'yes'
dom_pro: 'www.client1.com'
dom_pre: 'www.pre.client1.com'
http_pro: 'no'
https_pro: 'no'
http_pre: 'no'
https_pre: 'no'
descripcion: 'Description Client 1'
cuota: '2.0TB'
client2:
code: 'c2'
name: 'client2'
pre : 'yes'
pro: 'yes'
dom_pro: 'www.client2.com'
dom_pre: 'www.pre.client2.com'
http_pro: 'no'
https_pro: 'no'
http_pre: 'no'
https_pre: 'no'
descripcion: 'Description Client 2'
cuota: '2.0TB'
later:
$ cat data/client1.yaml
---
### customers
customers:
client1:
code: 'c1'
name: 'client1'
pre : 'yes'
pro: 'yes'
dom_pro: 'www.client1.com'
dom_pre: 'www.pre.client1.com'
http_pro: 'no'
https_pro: 'no'
http_pre: 'no'
https_pre: 'no'
descripcion: 'Description Clie 1'
cuota: '2.0TB'
$ cat data/client2.yaml
---
### customers
customers:
client2:
code: 'c2'
name: 'client2'
pre : 'yes'
pro: 'yes'
dom_pro: 'www.client2.com'
dom_pre: 'www.pre.client2.com'
http_pro: 'no'
https_pro: 'no'
http_pre: 'no'
https_pre: 'no'
descripcion: 'Description Clie 1'
cuota: '2.0TB'
Cheers,
Juan Moreno
El jueves, 24 de julio de 2014 14:27:58 UTC+2, Juan Moreno escribió:
> Hi,
>
> I would like to know if exists the possibility to include all the yaml
> files of a directory in hiera.
>
> The hiera config looks like:
>
> :hierarchy:
> - %{hostname}
> - secrets
> - customers/*
>
> :backends:
> - yaml
> :yaml:
> :datadir: '/etc/puppet/data'
>
> Cheers,
> Juan Moreno
>
--
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/0563de1a-9709-4372-9fee-3031e0633d90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.