Skip to content

Instantly share code, notes, and snippets.

@apex-omontgomery
Last active October 11, 2019 18:25
Show Gist options
  • Save apex-omontgomery/561fc77fea9ddaa7b3016b38804928f1 to your computer and use it in GitHub Desktop.
Save apex-omontgomery/561fc77fea9ddaa7b3016b38804928f1 to your computer and use it in GitHub Desktop.

base/init.sls

$ cat /srv/salt/roles/base/init.sls
include:
  - salt-minion
  

Root file

$ cat /srv/salt/roles/init.sls
include:
  - base

master config

auto_accept: True
file_ignore_glob: []
file_roots:
  base:
    - /srv/salt
    - /srv/formulas
    - /srv/salt/roles
    - /srv/config
pillar_roots:
  base:
    - /srv/pillar

# https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html#tutorial-gitfs
fileserver_backend:
  - gitfs

gitfs_provider: pygit2
gitfs_base: master

gitfs_remotes:
  - https://github.com/saltstack-formulas/logstash-formula.git:
    - root: logstash
  - https://github.com/saltstack-formulas/docker-formula.git:
    - root: docker
  - https://github.com/saltstack-formulas/prometheus-formula.git:
    - root: prometheus
    

Organization

$ tree
.
├── config
│   ├── both.crt
│   ├── master
│   └── minion.j2
├── formulas
│   ├── cert-authority
│   │   ├── files
│   │   │   └── company.crt
│   │   ├── init.sls
│   │   └── pillar.example
│   ├── git
│   │   ├── init.sls
│   │   └── pillar.example
│   ├── python-pip
│   │   ├── init.sls
│   │   └── pillar.example
│   └── salt-minion
│       ├── init.sls
│       ├── pillar.example
│       └── README.md
├── Makefile
├── pillar
│   ├── base
│   │   └── init.sls
│   └── top.sls
├── salt
│   ├── _grains
│   ├── roles
│   │   ├── base
│   │   │   └── init.sls
│   │   ├── init.sls
│   │   └── salt-bootstrap.sls
│   └── top.sls
$ cat salt/top.sls
base:
  '*':
    - roles

States

$ cat salt/roles/base/init.sls
include:
  - salt-minion

Pillar files

$ cat pillar/base/init.sls
salt-minion:
$ cat pillar/top.sls
base:
  '*':
    - base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment