This example really just demonstrates a simple approach to pulling common data out of your manifests and into Hiera.
For this example we're just creating a single instance and security
group, using AMI and region details stored in the hiera YAML file at
hieradata/common.yaml
.
+-------------+
| +---------+ |
| | | |
hiera-test | | hiera-1 | |
| | | |
| +---------+ |
+-------------+
Feel free to change the details in the YAML file to other AMIs and regions.
With the module installed as described in the README, from this directory run:
puppet apply init.pp --test --hiera_config hiera.yaml
This should create an instance and security group. You can delete them
with the puppet resource
commands when done.
puppet resource ec2_instance hiera-1 region=us-west-1 ensure=absent puppet resource ec2_securitygroup hiera-test region=us-west-1 ensure=absent
This example uses explicit calls to the Hiera function in the manifests. In your own manifests you could use data binding and parametized classes to achieve the same ends.