SaltClass, shared system classes #saltstack #salt
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.releasenotes
aodh/server
apache/server
aptly
artifactory/client
backupninja
barbican/server
billometer/server
bind/server
cassandra/backup
ccp/control
ceilometer
ceph
cinder
collectd
designate/server
devops_portal/service
docker
elasticsearch
fluentd/label/default_output
freeipa
galera/server
gerrit
git/server
glance
glusterfs
grafana
graphite
haproxy/proxy
heat
heka
helm/analytics_pipeline
horizon/server
influxdb
ironic
jenkins
keepalived/cluster/instance
keystone
kibana
kubernetes
libvirt/server
linux
maas/region
memcached/server
model_manager/server
mongodb/server
murano/server
mysql/client
nagios/server
neutron
nginx/server
nova
ntp/client
octavia
opencontrail
openldap/client
openssh
postgresql/client
powerdns/server
prometheus
rabbitmq/server
reclass/storage
rsyslog/client
rundeck
sahara/server
salt
sensu
sphinx/server
statsd/server
swift
telegraf
xtrabackup
zookeeper/backup
.gitreview
CHANGELOG.rst
README.rst

README.rst

Generic system model for SaltClass based deployment

This repo is based on existing reclass-model (https://github.com/Mirantis/reclass-system-salt-model)

Contains default pillar data for various systems/apps. Use along with pillar data on - service level (enbeded in formula under /metadata) - cluster level (an class override for individual deployment)

Expected SaltClass root structure:

/srv/salt/env  # installed formulas
/srv/salt/saltclass/
  - nodes
  - services/
               # link installed formulas `<formula>/metadata/service`
               #
               # SaltClass fixup:
               # for i in $(grep -r -e '^applications:' -e '^parameters:' -l ${SALT_CLASS_SERVICE:-/usr/share/salt-formulas/reclass/service}); do
               #   sed -i 's/applications:/states:/g;s/parameters:/pillars:/g' $i;
               # done
  - classes/
     - system  # (this repo as subrepository)
     - cluster # (your overrides)

SaltClass

Added to SaltStack Salt by PR: https://github.com/saltstack/salt/pull/42349.

Configuration

Directly to master.conf:

ext_pillar:
  - saltclass:
    - path: /srv/salt/saltclass

master_tops:
  saltclass:
    path: /srv/salt/saltclass

With the salt-formula-salt saltclass pillar:

salt:
  pillar:
    engine: composite
    saltclass:
      path: /srv/salt/saltclass

Examples

Basic jinja + grains example

# /srv/salt/saltclass/nodes/minion.domain.yml
environment: prod
classes:
{% for class in ['default', 'app1'] %}
  - {{ class }}
{% endfor %}
  - {{ __grains__['os'] }}

pillars:
  default:
    network:
      dns:
        srv3: 192.168.1.1
    os: {{ __grains__['oscodename'] }}