Lab – use eyaml to store a secret
In this lab, the puppet-hiera_eyaml
module has been used to set up eyaml
with default pkcs
keys, with a global Hiera setup to look at the node name, OS, and common values. In site.pp
, a Hiera lookup is performed to look up the value of secret::examplefiles
, which is used as content to create a /var/tmp/secret_example
file on the Puppet primary server. The lookup has a default of not set. In this lab, you will encrypt a secret and add it within the OS level so the content of the file changes.
SSH to the primary server and elevate to root:
ssh centos@<primary_host> sudo su -
Run the eyaml encrypt –p
command from within the /etc/puppetlabs/puppet
directory and enter a secret of your choice at the prompt:
cd /etc/puppetlabs/puppet eyaml encrypt -p
Copy the output after the string starting with ENC[
and paste it into the data section at /etc/puppetlabs/puppet/data/os/RedHat.eyaml
so it contains something like this: