From b80f7f36732b69ad77550d603e843b72d643cdf2 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Wed, 2 Oct 2024 22:14:49 -0600 Subject: [PATCH] Add Servers & Workflows/Linux/Automation/Puppet/Gitea Implementation.md --- .../Automation/Puppet/Gitea Implementation.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Servers & Workflows/Linux/Automation/Puppet/Gitea Implementation.md diff --git a/Servers & Workflows/Linux/Automation/Puppet/Gitea Implementation.md b/Servers & Workflows/Linux/Automation/Puppet/Gitea Implementation.md new file mode 100644 index 0000000..deb6677 --- /dev/null +++ b/Servers & Workflows/Linux/Automation/Puppet/Gitea Implementation.md @@ -0,0 +1,43 @@ +**Purpose**: +At this point, we need to configure Gitea as the storage repository for the Puppet "Environments" (e.g. `Production` and `Development`). We can do this by leveraging a tool called "r10k" which pulls a Git repository and configures it as the environment in Puppet. + +## Install r10k +``` sh +# Install r10k Pre-Requisites +sudo dnf install -y ruby ruby-devel gcc make + +# Install r10k Gem (The Software) +# Note: If you encounter any issues with permissions, you can install the gem with "sudo gem install r10k --no-document". +sudo gem install r10k + +# Verify the Installation (Run this as a non-root user) +r10k version +``` + +## Configure r10k +``` sh +# Create the r10k Configuration Directory +sudo mkdir -p /etc/puppetlabs/r10k + +# Create the r10k Configuration File +sudo nano /etc/puppetlabs/r10k/r10k.yaml +``` + +```yaml title="/etc/puppetlabs/r10k/r10k.yaml" +--- +# Cache directory for r10k +cachedir: '/var/cache/r10k' + +# Sources define which repositories contain environments +sources: + puppet: + remote: 'https://git.bunny-lab.io/GitOps/Puppet.git' + basedir: '/etc/puppetlabs/code/environments' +``` + +``` sh +# Create r10k Cache Directory +sudo mkdir -p /var/cache/r10k +sudo chown -R puppet:puppet /var/cache/r10k +``` +