Book Image

Extending Puppet

By : Alessandro Franceschi
Book Image

Extending Puppet

By: Alessandro Franceschi

Overview of this book

Table of Contents (21 chapters)
Extending Puppet
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Data in modules


We have already mentioned the data in the modules feature and its long and difficult path inside Puppet in Chapter 5, Using and Writing Reusable Modules.

At the moment of writing, the feature is still not released on the core Puppet; however, it's expected for Puppet 4.

The implementation details are still not defined, but for modules' authors, the usage patterns should be similar to the ones suggested by R.I.Pienaar in his experimental module-based proposal, which can be found at https://github.com/ripienaar/puppet-module-data.

The basic idea is that all the internal variables of a module and, where needed, the default values of parameters should be based on a Hiera YAML backend directly placed inside the module, with a module-specific hierarchy that does not interfere with users' local hierarchies.

Basically, we can define the hierarchy to manage the module data in our module's data/hiera.yaml file:

---
  :hierarchy:
    - "osfamily/%{::osfamily}"
    - common

Such a (simple...