Planet Puppet

Your source of Puppet technical information

Puppet rspec testing and hiera

Martin Alfke (noreply@blogger.com), May 12, 2023 07:08 AM | Source: Unix Freak

Rspec testing your puppet modules supports you in having stable and functional modules.
For a couple of weeks there is hiera integration in rspec-puppet.



Basic Spec setup


You will need a couple of files for puppet module rspec testing:

Gemfile
# Install via
# bundle install --path vendor/gems
#
source "https://rubygems.org"

gem "mocha", :require => false
gem 'puppet',       '>= 3.1.1'
gem 'puppet-lint'
gem 'facter',       '>= 1.6.10'
gem 'rspec-puppet', :git => "https://github.com/rodjek/rspec-puppet.git"
gem 'rake',         '>= 0.9.2'
gem 'puppetlabs_spec_helper', '0.3.0'
gem 'test-unit'
Rakefile
require 'rake'
require 'rake/tasklib'
require 'rspec/core/rake_task'
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint'

desc "Run the tests"
RSpec::Core::RakeTask.new(:test) do |t| ...

[ Read More ]

Puppet rspec testing with automatic hiera lookups (implicit hiera lookup like puppet 3.x)

Martin Alfke (noreply@blogger.com), May 12, 2023 07:08 AM | Source: Unix Freak

This article is an add-on to my other article regarding puppet & rspec.
This article only covers automatic hiera lookups used during rspec puppet runs.
Many thanks to Jan (janwaech<at>gmail<dot>com) who spend the time digging into rspec-puppet code finding this nice solution.



Basic Setup:


Gemfile


# Install via
# bundle install --path vendor/gems
#
source "https://rubygems.org"

gem "mocha", :require => false
gem 'puppet',       '>= 3.1.1'
gem 'puppet-lint'
gem 'facter',       '>= 1.6.10'
gem 'rspec-puppet', :git => "https://github.com/rodjek/rspec-puppet.git"
gem 'rake',         '>= 0.9.2'
gem 'puppetlabs_spec_helper', '0.3.0'
gem 'test-unit'

Rakefile


require 'rake'
require 'rake/tasklib'
require 'rspec/core/rake_task'
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'

require 'hiera'
require ...

[ Read More ]

Using ArgoCD Pull Request Generator to review application modifications

Julien Acroute, April 11, 2023 02:29 PM | Source: Camptocamp Blog

As a developer, when modifications are pushed to a feature branch, you and your team want to test this new feature. If you have the chance to work with a stateless application, you can deploy another instance of the application with modifications from the feature branch.

An interesting feature of ArgoCD is the Pull Request Generator. It's a generator for ApplicationSet. An ApplicationSet is a template of ArgoCD Application associated with a generator. Generator can be a directory: an application will be created for every sub-folder. There is also the Cluster generator that deploy the same Application ...

[ Read More ]

Puppet is YAML

Martin Alfke, February 08, 2023 08:33 AM | Source: betadots

or: The Power of Hiera5
or: Puppet with 7 lines of code only

We sometimes see people struggling when it comes to Puppet.
Mostly this is due to time needed to learn about the details of Puppet, like Puppet Language syntax.

There are two general ways on how to manage your infrastructure using Puppet:

  1. own code
  2. YAML data

Writing your own code will be helpful in edge cases or if there are internal applications where no Puppet extension exists.

When starting using Puppet we always recommend to make use of hiera.
Hiera is the Puppet internal data backend and can ...

[ Read More ]

Puppet ist YAML

Martin Alfke, February 08, 2023 08:31 AM | Source: betadots

oder: Puppet mit nur 7 Zeilen Code

Gelegentlich sehen wir, dass Menschen Probleme haben, wenn es um den Einsatz von Puppet Konfigurations-Management geht.
Meistens liegt die Ursache in dem notwendigen zeitlichen Aufwand, den man aufbringen muss, um die Puppet Programmiersprache kennen zu lernen.

Generell existieren 2 Wege, wie man eine Infrastruktur mit Puppet verwalten kann:

  1. eigener Code
  2. YAML Daten

Eigener Code macht Sinn, wenn man besondere Fälle verwalten muss. z.B. interne Anwendungen, für die keine Puppet Erweiterungen (Module) existieren.

Wir empfehlen grundsätzlich den Einsatz von Hiera in einem Puppet Umfeld.
Hiera ist das Puppet interne Daten Backend, in welchem man ...

[ Read More ]

Puppet Containment Demystified

Anonymous, January 20, 2023 12:00 AM | Source: binford2k.com

Containment has always been kind of a sticky subject in the Puppet world. Part of the confusion is that that Puppet tries really hard to handle on its own so that you don’t have to care about the weird little implementation details of how ordering relationships are resolved.

But that just means you’re not expecting it when it does raise its nasty little hobbit head.

Let’s talk a bit about how containment works so that you’re not surprised by an unexpected production outage caused by an unforeseen dependency issue.

We’ll start with ordering and the DAG. Directed Acyclic Graph is ...

[ Read More ]

Puppet Containment Demystified

Anonymous, January 20, 2023 12:00 AM | Source: binford2k.com

Containment has always been kind of a sticky subject in the Puppet world. Part of the confusion is that that Puppet tries really hard to handle on its own so that you don’t have to care about the weird little implementation details of how ordering relationships are resolved.

But that just means you’re not expecting it when it does raise its nasty little hobbit head.

Let’s talk a bit about how containment works so that you’re not surprised by an unexpected production outage caused by an unforeseen dependency issue.

We’ll start with ordering and the DAG. Directed Acyclic Graph is ...

[ Read More ]

Deploy your Pulumi project using Docker and Dagger.io

Hugo Bollon, December 14, 2022 10:30 AM | Source: Camptocamp Blog

🕰� In the previous episode

In the first part of this Dagger's series, I showed you what's Dagger.io, what's the features of it and it's benefits against others ci/cd solutions and finally the very basis of Dagger.

With this chapter, I will show you how we can overpower the CI/CD of any Pulumi project using Dagger.

🧰 Pulumi - An amazing IaC tool

First of all, I think that some of you may doesn't know what is Pulumi or even IaC (Infrastructure as Code) concept, so I will quickly present to you these two points.

Infrastructure as Code

Nowadays, IT ...

[ Read More ]

Desktop as Code with TP Desktop

Anonymous, December 13, 2022 12:00 AM | Source: Example 42

We manage via code the configurations of servers, cloud resources and infrastructures. Are we doing the same with our desktop setups, on our laptop, desktop, remote VDI? Do we manage as code the usual files we have, or would like to have, in our home configurations on remote servers? You may wonder what’s the benefit of adding the complexity of developing configurations that are applied one time and are usually managed manually. Well, let’s see if any of these use cases may be of interest for us: We do not setup our desktop only once. We do it whenever we ...

[ Read More ]

Use Docker to build better CI/CD pipelines with Dagger

Hugo Bollon, December 11, 2022 05:00 AM | Source: Camptocamp Blog

With the raises of DevOps practices, CI/CD (continuous integration & continuous deployment) takes a major place in every delivery workload.
CI/CD allow organizations to build, test and finally ship their applications more quickly and efficiently. It's a modern set of practices which allows to automatically trigger build, test or others types of jobs when the changes to the codebase are done.

In this quest of automation, we can use some CI/CD ecosystem like Github Actions, Gitlab-CI or many more.
However, a very promising new solution open-source is born called Dagger.

Dagger's logo

🤔 Dagger? What is it?

Dagger.io is a brand-new programmable ...

[ Read More ]

Puppet consulting, the example42 way

Anonymous, November 06, 2022 12:00 AM | Source: Example 42

If you think that this is a mere low budget marketing self-promoting post, you are right. Still, if you are interested in Puppet consulting, or, for some really arcane reason, in example42, keep on reading, as I guarantee that everything written here is true and happened for real. example42, an idea, an approach to work Example42 started in 2008 as an Open Source project, then, in 2015, it became a company based in Berlin, and finally, at the beginning of this year it turned into a brand of Lab42 Srl, my company, based in Italy. The idea behind example42 is ...

[ Read More ]

Puppet supports DoD continuous compliance and configuration management

Anonymous, October 24, 2022 12:00 PM | Source: Puppet

Learn how federal IT teams use Compliance Enforcement Modules to automate continuous compliance without the delay, risk and cost of manual approaches.

[ Read More ]

How to rein in cloud chaos with Puppet

Anonymous, October 18, 2022 03:00 PM | Source: Puppet

Join us for a webinar on how Puppet Enterprise, Bolt, and Puppet code work together to deploy and maintain your cloud infrastructure.

[ Read More ]

Get your time back by getting rid of unused modules with Dropsonde

Anonymous, October 11, 2022 03:53 PM | Source: Puppet

Clean up dead weight in your Puppet codebase (and save time) by getting rid of modules you no longer use. We’ll show you how.

[ Read More ]

How Puppet is making platform engineering more secure

Anonymous, October 03, 2022 04:00 PM | Source: Puppet

Puppet is releasing two CVEs as part of our secure-by-default ecosystem. Learn how the rise of platform engineering can lead to untrusted input.

[ Read More ]

Cleaning up unused modules with Dropsonde

Anonymous, September 01, 2022 12:00 AM | Source: binford2k.com

You’ve probably been using Puppet Forge modules to manage bits in your infrastructure for years. And if you’re like most of us, you’ve gradually added more modules and maybe sort of lost track of exactly what some of them do and on what nodes they’re declared on. You may even suspect that you have modules installed that you haven’t actually used in years…. only you’re not quite certain which modules those might be. I’m certainly guilty of that!

You won’t be surprised to know that one of our most common customer requests is a way to audit their modules to ...

[ Read More ]

Modern Puppet node classification

Martin Alfke, August 08, 2022 06:35 AM | Source: betadots

Within Puppet we use modules to describe specific technical components which we want to configure on a system.
This can by achieved either by upstream library modules (some refer to these as component modules) which can be found on Puppet Forge or by self written Puppet code which we usually refer to as technical implementation profiles.

Since Puppet is a client server model, the server must be aware of each node and must know which classes a node needs. This process is called node classification.

Within Puppet there are several ways how nodes can be classified.
This article describes the ...

[ Read More ]

Moderne Puppet Node Klassifizierung

Martin Alfke, August 08, 2022 06:34 AM | Source: betadots

Innerhalb von Puppet werden mit Hilfe von Modulen bestimmte technische Komponenten konfiguriert.
Module können Upstream entwickelt und auf der Puppet Forge zur Verfügung gestellt werden. Diese Module nennen wir gerne Bibliotheken oder Komponenten Module.
Alternativ handelt es sich um selbst geschriebene Technische Implementierungs-Profile.

Da es sich bei Puppet um ein Client-Server Modell handelt, muss der Server wissen, welche Module auf einem System zum Einsatz kommen sollen. Diesen Vorgang nennt man Node Klassifizierung.

Innerhalb von Puppet stehen unterschiedliche Varianten für die Node Klassifizierung zur Verfügung.
Dieser Artikel beschreibt die klassische Node Klassifizierung und ihre Einschränkungen und geht danach auf flexiblere, Hiera ...

[ Read More ]

Puppet Evaluation Error. Error while evaluating a Resource Statement - Unknown resource type

Anonymous, August 07, 2022 12:00 AM | Source: Example 42

So you got the Error while evaluating a Resource Statement, Unknown resource type with Puppet and are searching for solutions? You are lucky, because right now we are going to see what it means, why it happens and how to solve it. TL;DR The module that provides the referred Unknown resource type is not available where your Puppet code is compiled. Find the module you need in the metadata.json file of the module where the code fails (refer to the provided file path). Solve by adding the dependency module to your Puppetfile, or running the puppet module install command. Decomposing ...

[ Read More ]

How I deployed a serverless and high availability Blackbox Exporter on AWS Fargate

Hugo Bollon, July 04, 2022 02:19 PM | Source: Camptocamp Blog

At Camptocamp, we're using multiple Blackbox Exporters hosted in a few different cloud providers and world regions. We're using them to monitor availability and ssl certificate validity and expiration of many websites.
They were all deployed inside Linux VMs provisioned by Terraform and configured by our Puppet infrastructure. However, in order to achieve more simplicity and high availability, we wanted to deploy containers instead of these VMs.

� Why a serverless approach with AWS Fargate

AWS ECS (Elastic Container Service) is a fully managed, highly scalable and docker compatible container orchestration service.
It is widely used to host microservice ...

[ Read More ]