-
Notifications
You must be signed in to change notification settings - Fork 0
Digital Ocean Setup
Ryan McNeely edited this page Feb 26, 2020
·
26 revisions
- Create Digital Ocean account
- Spin up two CentOS 7 basic machines ($5/month/each package)
- Pick Toronto DC (if you want)
- In additional options select Private networking
- SSH into the CentOS machines
- Install CentOS 7 PY3 salt-master on one, minion on the other (https://repo.saltstack.com/#rhel)
- Add the salt-master (private) ip and hostname to /etc/hosts on the minion
- Edit the /etc/minion file on the minion
- Set the master hostname
- Set the id of the minion (eg. salt-minion-01)
- Start the minion
systemctl start salt-minion - Accept the minion on the salt master
salt-key -A
- Spin up a new CentOS 7 basic machine
- Pick Toronto DC (if you want)
- In additional options select Private networking
- SSH into the new CentOS syslog machine
- Edit the syslog config
vim /etc/rsyslog.conf - Uncomment the listener UDP setting:
$ModLoad imtcp $InputTCPServerRun 514
#TODO fix #5, skip for now
- Right below add:
$template FromIp,"/var/log/%FROMHOST-IP%.log"
. ?FromIp & ~
- Restart rsyslog
systemctl restart rsyslog.service - Test the config
- from the salt master (using the server IP):
logger --server 10.137.80.209 helloword - on the syslog server check for 'helloworld' message:
tail /var/log/messages
- Add the salt-master (private) ip and hostname to /etc/hosts
- Install + configure minion (same as salt-minion-01, with different name)
- On the Salt master edit
/srv/salt/master
- Uncomment
log_file: udp://loghost:10514and put your syslog server info eg.log_file: udp://10.137.80.209:514 - Uncomment
log_level: warningand change 'warning' to 'info'
- Restart Salt master process
pkill salt-mastersalt-master -d
- Wait a minute for the master to come back up
https://docs.saltstack.com/en/latest/topics/tutorials/states_pt1.html
- Edit /etc/salt/master to enable state tree
file_roots:
base:
- /srv/salt