Skip to content

Digital Ocean Setup

Ryan McNeely edited this page Feb 26, 2020 · 26 revisions

Instructions to create a simple Salt master and Salt minion on CentOS

  1. Create Digital Ocean account
  2. Spin up two CentOS 7 basic machines ($5/month/each package)
  • Pick Toronto DC (if you want)
  • In additional options select Private networking
  1. SSH into the CentOS machines
  2. Install CentOS 7 PY3 salt-master on one, minion on the other (https://repo.saltstack.com/#rhel)
  3. Add the salt-master (private) ip and hostname to /etc/hosts on the minion
  4. Edit the /etc/minion file on the minion
  • Set the master hostname
  • Set the id of the minion (eg. salt-minion-01)
  1. Start the minion systemctl start salt-minion
  2. Accept the minion on the salt master salt-key -A

Syslog server setup

  1. Spin up a new CentOS 7 basic machine
  • Pick Toronto DC (if you want)
  • In additional options select Private networking
  1. SSH into the new CentOS syslog machine
  2. Edit the syslog config vim /etc/rsyslog.conf
  3. Uncomment the listener UDP setting: $ModLoad imtcp $InputTCPServerRun 514

#TODO fix #5, skip for now

  1. Right below add:
$template FromIp,"/var/log/%FROMHOST-IP%.log" 
. ?FromIp & ~ 
  1. Restart rsyslog systemctl restart rsyslog.service
  2. 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
  1. Add the salt-master (private) ip and hostname to /etc/hosts
  2. Install + configure minion (same as salt-minion-01, with different name)

Setup Salt Master for remote syslog logging

  1. On the Salt master edit /srv/salt/master
  • Uncomment log_file: udp://loghost:10514 and put your syslog server info eg. log_file: udp://10.137.80.209:514
  • Uncomment log_level: warning and change 'warning' to 'info'
  1. Restart Salt master process
  • pkill salt-master
  • salt-master -d
  1. Wait a minute for the master to come back up

Setting up states

https://docs.saltstack.com/en/latest/topics/tutorials/states_pt1.html

  1. Edit /etc/salt/master to enable state tree
file_roots:
  base:
    - /srv/salt

Clone this wiki locally