User Tools

Site Tools


Sidebar






newpage

linux:saltstack

This is an old revision of the document!


Saltstack

infrastructure management, configuration management, orchestration & remote execution

Here are some tricks, because the documentation is a bit …dense, structured strange and incomplete..

Installation

Use the latest versions from salt repo, because various things like finger-key-exchange have been modified in 2016 and you get authentication errors with older versions debian:

wget -4 -O  - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub |  apt-key add -

add to sources.list:

deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main

install

apt-get install salt-minion

if you get python-systemd not installable, maybe you have pinned all *systemd* packages in /etc/apt/preferences.d/systemd to avoid systemd installation?

minion config

set ID in /etc/salt/minion_id

  xxxx.yyyy

config in /etc/salt/minion :

master: 1.2.3.4         # or hostname
master_finger: 'xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:.....'

mine_functions:
  test.ping: []
  grains.items: []
  network.ip_addrs:
    interface: eth0
    

gitfs

You can use a local repository to store states, but it must be a *bare* repository.

Salt refreshes the cache by default every 60 seconds!

# create bare repository:
mkdir -p /srv/repos/salt/states
git init --bare
# clone it somewhere and add your states:
git clone file:///srv/repos/salt/states
# ...
git add .
git commit
git push

Salt master configuration:

fileserver_backend:
  - git
gitfs_remotes:
  - file:///root/salt/states
linux/saltstack.1481384901.txt.gz · Last modified: 2016/12/10 16:48 by tkilla