SaltStack Install
Jump to navigation
Jump to search
Examples using LXD
Master
lxc launch ubuntu:18.04 salt lxc exec salt -- script /dev/null -c "curl -L https://bootstrap.saltstack.com -o install_salt.sh" lxc exec salt -- 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
Restart service
sudo systemctl restart salt-master
Minion
lxc launch ubuntu:18.04 sftp3 lxc exec haproxy1 -- script /dev/null -c "curl -L https://bootstrap.saltstack.com -o install_salt.sh" lxc exec haproxy1 -- 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
<br />base: '*.uvoo.io.dev' - base haproxy: 'haproxy*.uvoo.io.dev': - haproxy
/srv/salt/dev/init.sls
include: - base.users
/srv/salt/dev/users.sls
staff: group.present: - gid: 11000 - system: False busktest: user.present: - name: <myuser> - fullname: Salt Tester account - password: "<mypass in sha1 format>" - uid: 11001 # - gid_from_name: True # - gid: 11001 - home: /home/<myuser> - shell: /bin/bash - groups: - staff {% if grains['os_family'] == 'Debian' -%} - sudo {% else %} - wheel {% endif %} - require: - pkg: vim vim: pkg: - installed
salt -l debug 'myhost.uvoo.io' state.apply saltenv=dev test=True