Difference between revisions of "SaltStack Install"
Jump to navigation
Jump to search
| Line 67: | Line 67: | ||
busktest: | busktest: | ||
user.present: | user.present: | ||
| − | - name: | + | - name: <myuser> |
- fullname: Salt Tester account | - fullname: Salt Tester account | ||
| − | - password: " | + | - password: "<mypass in sha1 format>" |
- uid: 11001 | - uid: 11001 | ||
# - gid_from_name: True | # - gid_from_name: True | ||
# - gid: 11001 | # - gid: 11001 | ||
| − | - home: /home/ | + | - home: /home/<myuser> |
- shell: /bin/bash | - shell: /bin/bash | ||
- groups: | - groups: | ||
Revision as of 05:05, 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
Restart service
sudo 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
<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