Update Servers & Workflows/Linux/Automation/Puppet/Puppet Deployment.md
This commit is contained in:
@ -197,6 +197,7 @@ You will make a repository on Gitea with the following files and structure as no
|
||||
```
|
||||
|
||||
=== "Puppetfile"
|
||||
This file is used by the Puppet Server (PuppetMaster) to prepare the environment by installing modules / Forge packages into the environment prior to devices getting their configurations. It's important and the modules included in this example are the bare-minimum to get things working with PuppetDB functionality.
|
||||
|
||||
```json title="Puppetfile"
|
||||
forge 'https://forge.puppet.com'
|
||||
@ -210,6 +211,7 @@ You will make a repository on Gitea with the following files and structure as no
|
||||
```
|
||||
|
||||
=== "environment.conf"
|
||||
This file is mostly redundant, as it states the values below, which are the default values Puppet works with. I only included it in case I had a unique use-case that required a more custom approach to the folder structure. (This is very unlikely).
|
||||
|
||||
```yaml title="environment.conf"
|
||||
# Specifies the module path for this environment
|
||||
@ -226,6 +228,17 @@ You will make a repository on Gitea with the following files and structure as no
|
||||
```
|
||||
|
||||
=== "site.pp"
|
||||
This file is kind of like an inventory of devices and their states. In this example, you will see that the puppet serveri tself is named `lab-puppet-01.bunny-lab.io` and the agent device is named `onfiguring fedora.bunny-lab.io`. By "including" modules, it installs the PuppetDB role and configures it automatically. By stating the firewall rules, it also ensures that those firewall ports are open no matter what, and if they close, Puppet will re-open them automatically. Port 8140 is for Agent communication, and 8081 is for PuppetDB functionality.
|
||||
|
||||
!!! example "Neofetch Example"
|
||||
In the example configuration below, you will notice this section. This tells Puppet to deploy the neofetch package to any device that has `include neofetch` written. Grouping devices etc is currently undocumented as of writing this.
|
||||
``` sh
|
||||
# Node definition for the Fedora agent
|
||||
node 'fedora.bunny-lab.io' {
|
||||
# Include the neofetch class to ensure Neofetch is installed
|
||||
include neofetch
|
||||
}
|
||||
```
|
||||
|
||||
```yaml title="manifests/site.pp"
|
||||
# Node definition for the Puppet Server
|
||||
@ -271,6 +284,7 @@ You will make a repository on Gitea with the following files and structure as no
|
||||
```
|
||||
|
||||
=== "init.pp"
|
||||
This is used by the neofetch class noted in the `site.pp` file. This is basically the declaration of how we want neofetch to be on the devices that include the neofetch "class". In this case, we don't care how it does it, but it will install Neofetch, whether that is through yum, dnf, or apt. A few lines of code is OS-agnostic. The formatting / philosophy is similar in a way to the modules in Ansible playbooks, and how they declare the "state" of things.
|
||||
|
||||
```yaml title="modules/neofetch/manifests/init.pp"
|
||||
class neofetch {
|
||||
|
Reference in New Issue
Block a user