A simple demo of a working type and provider using Resource API and PDK.
- Description
- Setup - The basics of getting started with rsapidemo
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
The example repo shows a minimal working implementation of a Puppet custom type and provider created with PDK and Resource API. It also contains working unit tests. You can use this as a starting point for playing around with Resource API and extend it to develop your own type and provider.
To experiment with the module you will need to first install the Puppet Development Kit (PDK), see here for installation: https://puppet.com/docs/pdk/1.x/pdk_install.html.
You install the module by creating a directory and cloning the Github repository.
For ease of experimenting, we recommend to create a separate directory (for example modules
) to clone the module into:
mkdir modules
cd modules
git clone https://github.com/timidri/rsapidemo
cd rsapidemo
pdk update
pdk test unit # installs missing Gemfile dependencies
After cloning the module you can start experimenting with the type and provider right away. Examples of commands:
pdk bundle exec puppet resource demo --modulepath ~/modules
pdk bundle exec puppet resource demo foo ensure=present --modulepath ~/modules
pdk bundle exec puppet resource demo foo ensure=absent --modulepath ~/modules
This sample type and provider are only tested on Mac OS, CentOS 7, Windows 2012 R2, Windows 2016 and Windows 10.