cd ~/life && git log | head
I've just release dawdaw, a custom saltstack (a config management tool) states render for extremely python devs like me.
Here is an extract of the README:
Dawdaw is an experiment to make a SaltStack custom renderer (the stuff that allows you to write your states in yaml/jinja2/mako/other) in an attempt to solve those problems:
Disadvantages: you move await from full declarative code (which you were already doing in fact with jinja2 templates) to go back to python code. This is, on one hand very powerful, on the other hand probably too powerful (and may be way less easy to understand for devops that don't come from a programming background). That works for me because I'm a python dev and I'm using this for my personal usages, but that might not fit your case.
Move from:
include:
- dotfiles
wyrd-pkgs:
pkg.installed:
- name: wyrd
- require:
- sls: dotfiles
reminds.git:
git.latest:
- name: ssh://git@bitbucket.org/psycojoker/reminds.git
- runas: psycojoker
- target: /home/psycojoker/reminds/
- require:
- pkg: git
cd /home/psycojoker/reminds/ && bash init:
cmd.run:
- unless: ls /home/psycojoker/.reminders /home/psycojoker/.reminders.gcl
- user: psycojoker
- require:
- git: reminds.git
To:
#!dawdaw_template
from dawdaw.states import pkg, git, cmd, include
from dawdaw.utils import default, test, debug
dotfiles = include("dotfiles")
with default(user="psycojoker", runas="psycojoker"):
pkg.installed("wyrd",
require=[dotfiles.get("pkg", "dotfiles-pkgs")])
git.latest("ssh://git@bitbucket.org/psycojoker/reminds.git",
target="/home/psycojoker/reminds/")
if not test("ls /home/psycojoker/.reminders /home/psycojoker/.reminders.gcl"):
cmd.run("cd /home/psycojoker/reminds/ && bash init")