From b88bddeb3b54bb123e6a3f4e7fd6c5b4316e6e4c Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 3 Oct 2024 20:44:51 -0600 Subject: [PATCH] Update Servers & Workflows/Linux/Automation/Puppet/Puppet Deployment.md --- .../Automation/Puppet/Puppet Deployment.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Servers & Workflows/Linux/Automation/Puppet/Puppet Deployment.md b/Servers & Workflows/Linux/Automation/Puppet/Puppet Deployment.md index 8c5511d..9f357ac 100644 --- a/Servers & Workflows/Linux/Automation/Puppet/Puppet Deployment.md +++ b/Servers & Workflows/Linux/Automation/Puppet/Puppet Deployment.md @@ -183,6 +183,10 @@ An ENC allows you to define node-specific data, including the environment, on th - **Scalability**: Suitable for managing environments for hundreds or thousands of nodes. ### Create an ENC Script +``` sh +sudo mkdir -p /opt/puppetlabs/server/data/puppetserver/scripts/ +``` + ```ruby title="/opt/puppetlabs/server/data/puppetserver/scripts/enc.rb" #!/usr/bin/env ruby # enc.rb @@ -214,4 +218,29 @@ output = { } puts output.to_yaml +``` + +``` sh +# Ensure the File is Executable +sudo chmod +x /opt/puppetlabs/server/data/puppetserver/scripts/enc.rb +``` + +### Configure Puppet Server to Use the ENC +Edit the Puppet Server's `puppet.conf` and set the `node_terminus` and `external_nodes` parameters: +```ini title="/etc/puppetlabs/puppet/puppet.conf" +[master] +node_terminus = exec +external_nodes = /opt/puppetlabs/server/data/puppetserver/scripts/enc.rb +``` + +Restart the Puppet Service +``` sh +sudo systemctl restart puppetserver +``` + +## Pull Puppet Environments from Gitea +At this point, we can tell r10k to pull down the Puppet environments (e.g. `Production` and `Development`) that we made in the Gitea repository in previous steps. Run the following command on the Puppet Server to pull down the environments. This will download / configure any Puppet Forge modules as well as any hand-made modules such as Neofetch. +``` sh +sudo /usr/local/bin/r10k deploy environment production -p +sudo /usr/local/bin/r10k deploy environment development -p ``` \ No newline at end of file