Release of dawdaw, a custom saltstack states renderer for extremly lazy python devs 2014-05-19

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:

  • current states are extremely too verbose to write
  • you often repeat yourself way too much
  • really have a linear states declaration for requires
  • explicit requires on included states, because global sucks
  • namespacing all the things, because global sucks
  • indirectly trying to solve the "salt states totally sucks are being redistributed" problem by going full python, you can now use and pypi/pip to redistribute you work¹

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:

  - dotfiles

    - name: wyrd
    - require:
      - sls: dotfiles

    - name: ssh://
    - runas: psycojoker
    - target: /home/psycojoker/reminds/
    - require:
      - pkg: git

cd /home/psycojoker/reminds/ && bash init:
    - unless: ls /home/psycojoker/.reminders /home/psycojoker/.reminders.gcl
    - user: psycojoker
    - require:
      - git: reminds.git



from dawdaw.states import pkg, git, cmd, include
from dawdaw.utils import default, test, debug

dotfiles = include("dotfiles")

with default(user="psycojoker", runas="psycojoker"):
                  require=[dotfiles.get("pkg", "dotfiles-pkgs")])

    if not test("ls /home/psycojoker/.reminders /home/psycojoker/.reminders.gcl"):"cd /home/psycojoker/reminds/ && bash init")

Read the rest on github.