Getting PDK installed and updated can be a bit...weird these days, and after running into a few bumps I thought I'd share my compiled notes that streamlined a few different pages in the Puppet help documentation. Note: this is for manual setup. At some point I'll add the super fun Puppet version of this to make it simple and automated.
Prerequisites
- One of the following: a Puppet Core license, a Puppet Enterprise License, a Puppet Core development license.
- a Linux workstation. In this example I'm working with Fedora 33.
Steps
1. Gather Your Credentials
First things first, let's get our credentials in order.
For Puppet Enterprise users:
The username is license-id. The password can be found via the PE console. Log into the console, click on License in the left side menus and then click Copy license id.
For Puppet Core users:
The username is forge-key. The password can be found and/or created by logging into the Puppet Forge. Click on your account at the upper right corner and select View Profile. On the left side, select API Keys. Generate an API key and copy the key. That is your password. Make a note to save this for future use as once you leave that page you'll have to create a new one if you forget it.
2. Download and Setup the Repository File
First, let's grab the repository. You can find the relevant RPM or DEB from either yum-puppetcore.puppet.com/public or apt-puppetcore.puppet.com/public. Once you've found the right one, let's download and install!
wget https://yum-puppetcore.puppet.com/public/puppet8-release-el-9.noarch.rpm
sudo rpm -ivh puppet8-release-el-8-noarch.rpm
Once you've done the above, you'll be able to edit the repo file at /etc/yum.repos.d/puppet8-release.repo. Let's take a look at the contents:
[puppet8]
name=Puppet 8 Repository el 8 - $basearch
baseurl=https://yum-puppetcore.puppet.com/puppet8/el/8/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet8-release
enabled=1
gpgcheck=1
## Add authentication here by uncommenting and filling in values
#username=<api_user>
#password=<api_key>
It's pretty straightforward here. Remove the # from username and password, then copy your username and password from above into the <api_user> and <api_key> spaces, respectively. Save and quit editing the file.
3. Update and Install
At this point we have our repo file, we have our credentials configured and we just need to update the repos and install pdk. a simple yum update followed by yum install pdk should get us there.
root@choplifter:/home/matthew# yum update
Updating and loading repositories:
Puppet 8 Repository el 8 - x86_64 100% | 14.2 KiB/s | 14.1 KiB | 00m01s
Repositories loaded.
Nothing to do.
root@choplifter:/home/matthew# yum install pdk
Updating and loading repositories:
Repositories loaded.
Package Arch Version Repository Size
Installing:
pdk x86_64 3.6.1.1-1.el9 puppet8 223.8 MiB
Transaction Summary:
Installing: 1 package
Total size of inbound packages is 57 MiB. Need to download 57 MiB.
After this operation, 224 MiB extra will be used (install 224 MiB, remove 0 B).
Is this ok [y/N]: Y
[1/1] pdk-0:3.6.1.1-1.el9.x86_64 100% | 15.8 MiB/s | 57.0 MiB | 00m04s
--------------------------------------------------------------------------------------
[1/1] Total 100% | 15.8 MiB/s | 57.0 MiB | 00m04s
Running transaction
Importing OpenPGP key 0x9E61EF26:
UserID : "Puppet, Inc. Release Key (Puppet, Inc. Release Key) <release@puppet.com>"
Fingerprint: D6811ED3ADEEB8441AF5AA8F4528B6CD9E61EF26
From : file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet8-release
Is this ok [y/N]: Y
The key was successfully imported.
[1/3] Verify package files 100% | 5.0 B/s | 1.0 B | 00m00s
[2/3] Prepare transaction 100% | 3.0 B/s | 1.0 B | 00m00s
[3/3] Installing pdk-0:3.6.1.1-1.el9.x86_64 100% | 72.0 MiB/s | 228.5 MiB | 00m03s
Complete!
root@choplifter:/home/matthew# pdk --version
3.6.1
That's all there is to it! As an added bonus, this is the same repo for Bolt and all the Puppet Core bits, so if you need the agent on your box it's as easy as another yum install.
Or dnf. Whatever.
Top comments (0)