Djangocon: Salt for django developers - Yann Malet

Tags: django, djangocon, python

(One of the summaries of a talk at the 2015 Djangocon EU conference).

Yann Malet is a co-author of high performance django. He now talks about salt, a tool for configuration managament and remote server setup.

First some terminology, which might not be clear for non-english speakers.

  • Master: the main machine that steers the whole process.

  • Minions: the “slaves”, the machines that are managed by the master. You can run commands and so on those minions. You don’t need to do it on all of them, you can target specific groups like “os.ubuntu” or “role:web”.

    He showed a couple of commandline examples like adding users and keys to a fresh system.

  • Pillar: a set of variables for one or more minions. Look at it as a python dict.

  • Grain: where pillar is more for multiple minions, grains are for one specific minion. It is the static data collected from the minion, like the amount of memory in the machine.

In the end, the various information for the minions is all squashed together, based on the roles the minion needs to have. The total state is then pushed to the minion and applied.

The easiest way to do custom stuff, like installing a django website, is to write a shell script that does it. You can use jinja2 template tags in there for variable replacement. He showed a django example and it looked pretty simple.

They have a “hpd-states” package that has most of the recommendations from the book all readily packaged. (The only link I could find right now is https://lincolnloop.com/blog/high-performance-django-infrastructure-preview/ ).

A model railway at the 2015 'ontraxs' exhibition in Utrecht
 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):