Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automating an AWS Complex Infrastructure With Ansible: Lessons learned

Automating an AWS Complex Infrastructure With Ansible: Lessons learned

From template tricks to major caveats, I will share my experiences migrating a complex AWS infrastructure from a semi manual configuration (WebUI+boto scripts) to a fully automated one via Ansible.
Related code and more here

https://github.com/jaimegago/ansible-bay-area-meetup/tree/master/automate_public_cloud_07_16_14

Jaime Gago

July 16, 2014
Tweet

More Decks by Jaime Gago

Other Decks in Technology

Transcript

  1. Background Story Migrating AWS to VPC • Complex architecture (route53,

    ELBs, ASGs, EC2 Types, Sec Groups, multiple regions and AZ, EIPs, EC2 User data leveraged in downstream automation,...) • Mainly Web UI (some automation via Boto scripts and AWS CLI) • Puppet Shop (application + OS layer) • Army of 2 (Systems Engineers)
  2. Engineering Process Ansible Playbooks AWS Account keys in Shell Environment

    Ansible Head Ansible Patched Modules AWS Account keys in Shell Environment boto
  3. Safeguards • Test AWS account + S3 trick (always_run: true)

    • --check --diff (not very effective in my use case) • --list-tasks --tags
  4. Ansible Data Structure • All vars define in one file

    (group vars) • 1 playbook per “service” • 1 “Network” + 1 “Security group” playbook per region • Tasks are tagged with region + purpose • Playbook of playbooks
  5. Future • Connect Ansible data with Puppet (e.g. service ports)

    • More Safeguards (e.g. disable runs that with changing tasks > x%) • Automated Tests (Continuous Delivery Style)