Deploy with Puppet

This guide provides a complete Puppet module for installing and enrolling LinuxGuard. Credentials are stored in Hiera using the eyaml encryption backend, which encrypts individual values in Hiera YAML files while keeping keys readable. The module is idempotent — safe to apply on already-enrolled nodes because the enroll exec resource includes an unless guard on /var/lib/linuxguard/config.

Prerequisites

  • Puppet 7 or 8 with Puppet Server

  • hiera-eyaml available on Puppet Server (bundled with Puppet Server 5.2.0+; install with puppetserver gem install hiera-eyaml if needed)

  • A LinuxGuard API key and tenant ID (from the LinuxGuard console)

Module Structure

Create the following structure in your Puppet environment's modules/ directory:

modules/
└── linuxguard/
    ├── metadata.json        # Module name, author, version, dependencies
    └── manifests/
        └── init.pp          # Main class: install, service, enroll

Hiera data lives in the environment, not in the module:

environments/production/
├── hiera.yaml               # Hierarchy with eyaml backend
└── data/
    └── common.eyaml         # Encrypted LinuxGuard credentials

Step 1: Generate eyaml Encryption Keys

eyaml uses PKCS7 key pairs to encrypt Hiera values. Generate the keys on your Puppet Server:

The keys are generated in ./keys/ by default. Move them to the standard location:

Then fix key ownership so Puppet Server can read them:

Note: Puppet Server runs as the puppet user. If the key files are owned by root, Puppet catalog compilation will fail with a permission error when attempting to decrypt Hiera values.

Step 2: Encrypt LinuxGuard Credentials

Run eyaml encrypt for each credential value:

Each command outputs an ENC[PKCS7,...] block. Copy the outputs into environments/production/data/common.eyaml:

Replace the placeholder ENC[PKCS7,...] strings with the actual output from the eyaml encrypt commands above.

Step 3: Configure the Hiera eyaml Backend

Create or update environments/production/hiera.yaml with the eyaml backend configuration:

Place this file at environments/production/hiera.yaml, or the equivalent path for your environment name.

Step 4: Create the Module Files

metadata.json

Replace yourorg with your organisation's name.

manifests/init.pp

Note: The unless => 'test -f /var/lib/linuxguard/config' guard skips enrollment if the agent is already enrolled. The require attributes enforce ordering: install -> service -> enroll. See Automated Deployment Overview for details on the agent's built-in idempotency behavior.

Step 5: Apply the Module

Classify the node with the module using the Puppet site manifest or an ENC:

Or classify via the Puppet Enterprise console or your node classifier of choice.

Then trigger a Puppet agent run on the target node:

Enrolled nodes appear in the Infrastructure view of the LinuxGuard console within a few minutes of successful enrollment.


Related: Automated Deployment Overview | Installation | Configuration

Last updated

Was this helpful?