Puppet Tutorials: Complete Guide of Puppet Module


How to Create Puppet Module Skeleton?


Step 1 – Install PDK

# RHEL 7

$ sudo rpm -Uvh https://yum.puppet.com/puppet-tools-release-el-7.noarch.rpm
$ sudo yum install pdk

$ exec bash

# RHEL 8

$ sudo rpm -Uvh https://yum.puppet.com/puppet-tools-release-el-8.noarch.rpm
$ sudo yum install pdk
$ exec bash

# Ubuntu 20.04

$ wget https://apt.puppet.com/puppet-tools-release-focal.deb
$ sudo dpkg -i puppet-tools-release-focal.deb
$ sudo apt-get update
$ sudo apt-get install pdk
$ exec bash

Reference – https://www.puppet.com/docs/pdk/2.x/pdk_install.html

Step 2 – Install PDK

$ pdk new module <MODULE_NAME>

$ pdk new module websphere


root@agent1:~# pdk new module tcb-websphere
pdk (INFO): Creating new module: tcb-websphere

We need to create the metadata.json file for this module, so we're going to ask you 4 questions.
If the question is not applicable to this module, accept the default option shown after each question. You can modify any answers at any time by manually updating the metadata.json file.

[Q 1/4] If you have a Puppet Forge username, add it here.
We can use this to upload your module to the Forge when it's complete.
--> tcb

[Q 2/4] Who wrote this module?
This is used to credit the module's author.
--> Rajesh Kumar

[Q 3/4] What license does this module code fall under?
This should be an identifier from https://spdx.org/licenses/. Common values are "Apache-2.0", "MIT", or "proprietary".
--> Apache-2.0

[Q 4/4] What operating systems does this module support?
Use the up and down keys to move between the choices, space to select and enter to continue.
--> RedHat based Linux, Debian based Linux, Windows

Metadata will be generated based on this information, continue? Yes
pdk (INFO): Using the default template-url and template-ref.
pdk (INFO): Module 'websphere' generated at path '/root/websphere'.
pdk (INFO): In your module directory, add classes with the 'pdk new class' command.
Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x