Lab – creating a module and testing it
In this lab, you will use the knowledge you’ve gained about module structure, the PDK, and testing to create and test a Grafana module. Then, using what you learned about Puppet Forge, you will explore the Forge site to choose modules:
- Using either the code you wrote for Chapter 4 for the combined Grafana, Windows, and Linux class or the example answer at https://github.com/PacktPublishing/Puppet-8-for-DevOps-Engineers/blob/main/ch04/all_grafana_data_types.pp, create a new module called
packt_grafana
, with this Puppet code broken up into appropriate classes following theinit
,service
,config
, andinstall
pattern (for this number of resources, a single class in the real world would be more appropriate, but this is just for practice). I recommend creating classes withpdk new class
. Follow https://puppet.com/docs/puppet/latest/puppet_strings_style.html to ensure classes are fully documented and pass tests. - Expand the default...