Beruflich Dokumente
Kultur Dokumente
= POWER!!
Mike Piecuch
Senior DevOps Software Engineer
Nuage Networks from Nokia
Must Haves:
Deploy on demand or on a schedule
Write configuration at time of deploy
Scripting in plain English sentences
Debuggability
Tracking and archiving
Take over the Internet and eventually the world!
My Minions
• Schedules builds/tests/deploy
• Manages resources
• Tracks and archives results
Configure App
Write File From Template
... index.html
... index_template.j2
... num_stars=${num_stars}
... take_over_the_world=${take_over_the_world}
# Execute ansible-playbook
if exit_code != 0:
raise Exception(
"Playbook %s failed with exit code %d" % (
playbook, exit_code))
Jinja2 Template Substitution
hosts_template.j2
[super_evil_servers] [super_evil_servers]
{{ server_ip }} 10.31.177.12
[super_evil_servers:vars] [super_evil_servers:vars]
ansible_user=root ansible_user=root
port={{ port }} port=80
index_template.j2
<html> <html>
<title> Mike's Super Evil Killer Web <title> Mike's Super Evil Killer
App </title> Web App </title>
App Rating: App Rating:
{% for i in range( num_stars | int ) %} <img src="star.png">
<img src="star.png"> <img src="star.png">
{% endfor %} <img src="star.png">
<img src="star.png">
{% if take_over_the_world == 'true' %} <img src="star.png">
<script src="take_over_the_world.js">
</script> <script
{% else %} src="take_over_the_world.js">
Not taking over the world today... :( </script>
{% endif %} </html>
</html>
Run Deploy Job
Aww, Snap!!
Robot to the Rescue!
Fix it… fix it… FIX IT!!
deploy_super_evil_app.yml (Ansible Playbook)
---
- hosts: super_evil_servers
tasks:
- name: Start app
shell: "start server {{ server_port }}"
hosts_template.j2
[super_evil_servers] [super_evil_servers]
{{ server_ip }} {{ server_ip }}
[super_evil_servers:vars] [super_evil_servers:vars]
ansible_user=root ansible_user=root
port={{ port }} server_port={{ port }}
Tracking and Archiving
App Rating:
Presentation Material
Mike Piecuch
Senior DevOps Software Engineer
Nuage Networks from Nokia