Consistent & Reliable
Let’s you know what failed, where, and when
Powerful but Simple
compose existing technology
Batteries Included
Common functionality out of the box
Ansible allows simple, single pass configuration
make your machines look the way you need them.
- hosts: web
vars:
port: 8080
tasks:
- name: start the web server
command: /bin/runserver -p {{ port }}
[web]
web[01:10].example.com
[web:vars]
database=db-master.example.com
admin=admin@example.com
# ansible <hostgroup> <args>
$ ansible web -u webuser -a whoami
=> on all ten web servers... webuser
$ cat playbook.yaml
- hosts: web
remote_user: webuser
tasks:
- command: whoami
# ansible-playbook <playbooks...> <args>
$ ansible-playbook playbook.yaml
=> on all ten web servers... webuser
_________________________________________
/ Ansible is now officially easier for me \ | than writing a shell script to manage a | | server. Casual devops folks should | \ absolutely learn it. / ----------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
[program:web-server]
command=python -m SimpleHTTPServer
directory=/home/web/public
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
restart|force-reload)
restart
RETVAL=$?
;;
reload)
/usr/bin/supervisorctl $OPTIONS reload
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
exit 1
esac
$ supervisord
# starts the daemon, and all supervised apps
$ supervisorctl status
# lists the status of all supervised programs
$ supervisorctl start|stop|restart|update <app>
# control a process
$ supervisorctl reread
# update service definitions