This example demonstrates a simple approach to pulling common data out of your manifests and into Hiera.
For this example we're creating a single instance and security
group, using AMI and region details stored in the Hiera YAML file at
+-------------+ | +---------+ | | | | | 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
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 parameterized classes to achieve the same ends.