Difference between revisions of "SaltStack Install"
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
``` | ``` | ||
+ | /etc/salt/master.d/main.conf | ||
+ | ``` | ||
+ | file_roots: | ||
+ | dev: | ||
+ | - /srv/salt/dev | ||
+ | qa: | ||
+ | - /srv/salt/qa | ||
+ | prod: | ||
+ | - /srv/salt/prod | ||
+ | base: | ||
+ | - /srv/salt/base | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | systemctl restart salt-master | ||
+ | ``` | ||
Revision as of 04:45, 13 April 2020
Examples using LXD
Master
lxc launch ubuntu:18.04 salt lxc exec sftp3 -- script /dev/null -c "curl -L https://bootstrap.saltstack.com -o install_salt.sh" lxc exec sftp3 -- script /dev/null -c "sudo sh install_salt.sh -M -x python3 -D"
/etc/salt/master.d/main.conf
file_roots: dev: - /srv/salt/dev qa: - /srv/salt/qa prod: - /srv/salt/prod base: - /srv/salt/base
systemctl restart salt-master
Minion
lxc launch ubuntu:18.04 sftp3 lxc exec sftp3 -- script /dev/null -c "curl -L https://bootstrap.saltstack.com -o install_salt.sh" lxc exec sftp3 -- script /dev/null -c "sudo sh install_salt.sh -P -x python3 -D"
Create envs
mkdir /srv/salt/dev mkdir /srv/salt/qa mkdir /srv/salt/prod
/srv/salt/dev/top.sls
dev: 'haproxy*.uvoo.io': - haproxy
salt -l debug 'myhost.uvoo.io' state.apply saltenv=dev test=True