Skip to content
Peter Yee edited this page Oct 9, 2017 · 4 revisions

Welcome to the atelier wiki! We can format this never, but for now I'm just going to drop in some saltstack cheat sheet commands

In the README.md is how to set up the client and servers, if you're connecting to our deploy server from outside of AWS you'll need to use the public ip instead of the private internal ip. (currently ec2-54-226-177-109.compute-1.amazonaws.com)

Key Management

On the deploy server as root, salt-key lists all known minion keys. If you set up a server and don't see it there, it either does not have salt-minion running or is not configured to point to this server as a master In order to issue commands to a new server, you will need to do a salt-key -A [key name]

Server Care & Feeding

On the deploy server as root, salt is the main go-to command. In order to target servers you can either do salt '*' to target all servers or salt -L 'server1, server2' to target a list of servers, or more usefully `salt -C 'G@roles:[role name]' to match all servers with specific grain or role settings

Examples of common commands to run are:
salt '*' test.ping see which servers are running
salt -C 'G@roles:couture and G@roles:prod' state.highstate production deploy project couture
salt -C 'G@roles:couture-cron' cmd.run "systemctl list-timers" list when scheduled jobs last ran and when they will run next
salt '*' cmd.run "ps -eo pcpu,pmem,pid,args | sort -k 2 -n -r | head -5" list cpu and ram use of the top 5 processes using the most ram salt '*' cmd.run "curl -s http://169.254.169.254/latest/meta-data/public-ipv4" get a list of ip addresses to post into your hosts file

Obviously this command line interface is a bit dangerous as it's easy to run irreversible commands on unintended servers. If we stick with this tool we will probably eventually set up some UI to make this more friendly, probably integrated either with a continuousIntegration or chat server

Clone this wiki locally