12

Click here to load reader

Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

  • Upload
    logilab

  • View
    116

  • Download
    0

Embed Size (px)

DESCRIPTION

Salt allows scalable infrastructure management, including provisioning new systems and managing them over their lifetime. In this talk I'll show how it makes managing Debian systems easier.

Citation preview

Page 1: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Adding Salt to your Debian systems

[email protected]

Page 2: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

What is salt?

● Remote execution framework● Set of tools built around that framework, including config management

Page 3: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Why salt?

● Written in python● Using yaml for state description● Great documentation● Big and growing community● Fast-moving

Page 4: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Why not salt?

● Young and fast-moving● Written in python● Rolls its own crypto

Page 5: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Terminology

● Master, minions● Grain● Pillar● State● Top file● Highstate

Page 6: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Adding a minion

● Install salt-minion

http://debian.saltstack.com/● Tell it where the master is

echo master: salt.logilab.fr > /etc/salt/minion.d/master.conf

● Check and accept the key on the master

salt-key -a mynewminion

Page 7: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Remote execution

$ salt '*' test.ping

$ salt 'db*' cmd.run pg_lsclusters

$ salt -G 'oscodename:jessie' grains.item \ kernelrelease

Page 8: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Config management

● Using yaml (by default) to describe desired system state

● Templating with jinja● Grains/pillars/... available for targetting and in

template context

Page 9: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Top file (2)

/srv/salt/top.sls

base:

'*':

- common

'role:webserver':

- match: grain

- apache

Page 10: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

SLS files

/srv/salt/common.sls

basepkgs:

pkg.install:

- pkgs:

- vim

- less

- debsums

Page 11: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

SLS files (continued)

/srv/salt/apache/init.sls

apache2:

- pkg.installed

- service.running:

- require:

- pkg: apache2

- watch:

{% for vhost in pillar['vhosts'] %}

- file: /etc/apache2/sites-available/{{ vhost }}

{% endfor %}

Page 12: Debconf14 : Putting some salt in your Debian systems -- Julien Cristau

Other nice things

● Integration with cloud and virtualization APIs with salt-cloud and salt-virt

● Provisioning, pre-approval of minion keys● Automatic highstate on boot or on a schedule