SaltStack Deconstructed - Intro
image/svg+xml
SaltStack Deconstructed - Intro
salt/modules
/srv/salt/_modules
Repo:
Custom:
$ salt '*' saltutil.sync_grains
{'base':['nginx']}
salt-minion
Mt
varstack
.
top
/srv/salt/top.sls
salt-master
Mt
mongodb
.
top
Mt
cobbler
.
top
Mt
mongodb
.
top
salt/tops
N/A
Repo:
Custom:
$ cp mytop.py <SALT DIST PATH>/salt/tops/
key.txt
/srv/salt
Fs
roots
.
find_file
Fs
gitfs
.
find_file
Fs
s3fs
.
find_file
$ salt-cp '*' salt://key.txt /etc/key.txt
$ salt '*' state.apply key.file
$ salt '*' cp.get_file salt://key.txt /etc/key.txt
Fs
s3fs
.
dir_list
Fs
gitfs
.
file_list
Fs
roots
.
find_file
salt/fileserver
N/A
Repo:
Custom:
$ cp myfs.py <SALT DIST PATH>/salt/fileserver/
salt-cloud
Cl
db-large
web-medium
Cl
vmware
.
destroy
Cl
xen
.
reboot
Cl
ec2
.
create
salt/cloud/clouds
/srv/salt/_clouds
Repo:
Custom:
$ salt '* saltutil.sync_clouds
salt-cloud
Device
Master
salt-master
buildlight
Pr
philips_hue
philips_hue
$ salt 'buildlight' hue.call color=red
Minion
Master
salt-master
salt-minion
Device
salt-proxy
Pr
my_db
.
add_user
Pr
philips_hue
.
call_color
Pr
nxos
.
show_run
salt/proxy
/srv/salt/_proxy
Repo:
Custom:
$ salt '*' saltutil.sync_proxymodules
salt-proxy
/etc/salt/master.d/auth.conf
/srv/salt/_modules/dbwrapper.py
Ex
dbwrapper
.
cleanup
Ex
cmd
.
run
Au
mysql
.
auth
Na
cherrypy
.
start
salt-api
salt-master
Na
wsgi
Na
cherrypy
Na
tornado
Na
wsgi
.
start
Na
cherrypy
.
start
Na
tornado
.
start
salt/netapi
N/A
Repo:
Custom:
$ cp myaapi.py <SALT DIST PATH>/salt/netapi/
salt-api
APIGET 'web*' pkg.list_pkgs
APIGET 'web*' pkg.version nginx
/etc/salt/master.d/auth.conf
/etc/salt/master.d/auth.conf
$ salt -G 'role:db' service.start mysql
$ salt -G 'role:db' service.start mongo
/etc/salt/master.d/auth.conf
$ salt '*' cmd.run '/root/script.sh'
/etc/salt/master.d/auth.conf
Au
ldap
.
auth
Au
mysql
.
auth
Au
pam
.
auth
salt/auth
N/A
Repo:
Custom:
$ cp myauth.py <SALT DIST PATH>/salt/auth/
salt-api
1
Start
auth
netapi
proxy
cloud
fileserver
mastertops