Skip to content

Instantly share code, notes, and snippets.

@baby-gnu
baby-gnu / split-platforms-mapdata-dumps
Last active April 1, 2021 13:43
Tool to extract the mapdata dumps from kitchen containers and store them under `test/integration/default/files/_mapdata`
#!/usr/bin/perl
# This script is used to split the content of mapdata dumps extracted
# from the kitchen containers:
#
# 0. make sure to have <FORMULA>._mapdata in kitchen.yml suites
# 1. build all platforms: ./bin/kitchen converge
# 2. extract the YAML dumps: ./bin/kitchen exec -c 'base64 /tmp/salt_mapdata_dump.yaml' | tee /tmp/kitchen_mapdata_dumps.txt
# 3. split the mapdata dumps per platform: split-platforms-mapdata-dumps /tmp/kitchen_mapdata_dumps.txt
@baby-gnu
baby-gnu / Log of salt-call -l debug state.apply foo.test
Last active March 31, 2021 12:42
Difference of context when importing jinja files with or without context
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: testmachine1.example.net
[DEBUG ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG ] Grains refresh requested. Refreshing grains.
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf
@baby-gnu
baby-gnu / splityaml
Last active March 24, 2020 19:47
SaltStack formula: converte YAML files to `parameters/` directories
#!/usr/bin/python3
import glob
import os
import re
import sys
from string import Template
from ruamel.yaml import YAML
@baby-gnu
baby-gnu / salt-ssh config
Last active August 18, 2023 07:48
Configure salt-ssh to use only files under ~/.salt: all the following files are relative to ~/.salt/
My complete configuration is now hosted at https://gitlab.mim-libre.fr/-/snippets/13