Advanced DPK: Building a PIA Domain

With the DPK, you can build many configurations: full systems like the PeopleSoft Images, a web server, a combination of domains, or deploy the middleware software only. The goal of the DPK is to build you a server for you from a single set of configuration files.

But, what if you want to spin up a temporary web domain and test something without impacting your standard configuration? You can add the temporary domain to the psft_customizations.yaml file, but the DPK will shut down every domain on the server before it builds the new domain. That’s not a good solution.

Behind the DPK are new Puppet types that provide interfaces to create domains using Puppet. If you look in the file puppet\etc\modules\pt_config\tests\test_pia_create.pp, you can see this in action. The test creates variables and array’s to pass into the pt_webserver_domain Puppet type. Calling pt_webserver_domain will create a new PIA domain. Let’s explore this Puppet type and see how we can use it to create temporary domain

I want to say, use this method only if you have a good understanding of Puppet. This post is showing how to build PIA domains directly so we can better understand how the DPK works.

Custom YAML files

In the test_pia_create.pp manifest, the arrays are created in the manifest. We’ll use a YAML file to store our data instead. I find writing arrays in Puppet to be tedious and can break easily. Hiera and YAML files are much easier to work with, and we can use this manfiest for more domains in the future.

hrdev.yaml

hrdev.yaml is a small YAML file that stores data for a single PIA domain. It is important to keep the structure of the pia_domain_list section so we can easily take the YAML data and pass it into the pt_webserver_domain type. In the hrdev.yaml file, you can update any settings you want to configure the domain the way you want.

YAML Hashes and Arrays

YAML files can store data in various ways. The two common types the DPK uses are hashes and arrays. Hashes are key: value pairs, and can also contain nested hashes. The config_settings and pia_site_list sections are an example of a nested hash.

The DPK types use Arrays but the psft_customizations.yaml file (other others) use hashes. Hashes are often easier to work with because they are more descriptive. Thankfully, the DPK comes with some helper functions to convert a nested hash into a nested array.

Custom PIA Manifest

Next, we’ll start writing a Puppet manifest that will load hrdev.yaml and prepare our PIA domain. To start, let’s load our data and get the pia_domain_list hash into a variable:

The $domain_name value is the key of the hash, and $pia_domain_info is the nested hash. Those values will be accessible inside our loop. Next, we’ll take the webserver_settings, pia_site_list, and config_settings (if it exists in the YAML file) sections and turn them into nested arrays. The PeopleTools team delivers an excellent function hash_of_hash_to_array_of_array() function that does the heavy lifting.

Running the Manifest

Save the piaDomain.pp manifest to your c:\programdata\puppetlabs\puppet\etc\manifests folder, and the hrdev.yaml file to c:\temp folder. From the puppet\etc\manfiests folder, run puppet apply piaDomain.pp --trace --debug. The PIA build process can take 5-10 minutes to run, but at the end you’ll have a PIA domain built using the DPK and Puppet.

Both hrdev.yaml and piaDomain.pp are on Github if you want to download the files and test.

Building Blocks

If you want to spin up a single PIA domain, this may feel like overkill. The value in learning Puppet and the DPK isn’t to build a single domain, it’s a building block to quickly (and consistently) build many domains. The piaDomains.pp manifest can scale to multiple domains and all you have to do is update the YAML file.

Not everyone may need (or want) to dig into the DPK this deep. But for anyone who wants more control over their environment build with the DPK, using the Puppet types that come with the DPK will be an invaluable skill.

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

This will be displayed in a monospaced font. The first four
spaces will be stripped off, but all other whitespace
will be preserved.
Markdown is turned off in code blocks:
[This is not a link](http://example.com)