Slide 1

Slide 1 text

Automating IAAC with Terraform, Ansible and CircleCI. Olufuwa Temitayo #AndelaWorkshop 9 | 15 | 2018

Slide 2

Slide 2 text

#Whoami Senior Dev Andela. DevOps Engineer PlutoTv. Failed at three startups. Proud Husband.

Slide 3

Slide 3 text

DevOps is Culture not a Role.

Slide 4

Slide 4 text

DevOps is a software engineering culture and practice that aims at unifying software development (Dev) and software operation (Ops). The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management.

Slide 5

Slide 5 text

“Ops people are basically developers who failed at programming, they're like the mall cops that could never be real cops.” As seen on Quora

Slide 6

Slide 6 text

Developers and these lines ● But It works on my machine. ● You need to have this package installed on your system. ● I have uploaded it refresh your browser.

Slide 7

Slide 7 text

Then came the cloud

Slide 8

Slide 8 text

Cloud Market Share

Slide 9

Slide 9 text

AWS

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

● EC2 is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. ● Object storage built to store and retrieve any amount of data from anywhere ● Elastic Load Balancing automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, and IP addresses. Common AWS Services

Slide 13

Slide 13 text

AWS Management console Demo

Slide 14

Slide 14 text

Shell Scripts Vs CM tools ● Parallel execution across multiple machines. ● A library of ready-made idempotent 'modules' ● Automatic step-by-step reporting. ● Syntax that strikes a balance between ease-of-variable-mangling, sufficient logic-flow control, and readability.

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. Designed for multi-tier deployments since day one, Ansible models your IT infrastructure by describing how all of your systems inter-relate, rather than just managing one system at a time.

Slide 17

Slide 17 text

Deployment (Past)

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Demo

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Orchestrators CFN, TF

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Oh sh*t ! We made an error so we have to start all over again Stupid right ?

Slide 26

Slide 26 text

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

Slide 27

Slide 27 text

Basics

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Benefits of Terraform ● Great implementation of Infrastructure as Code concept. ● Supports various cloud providers, including AWS, Azure and OpenStack ● Encourages good design practices ● Collaboration is made possible by using remote backend to store state files (such as S3)

Slide 30

Slide 30 text

Terraform in teams. ● Version control ● Coding guidelines ● Workflow

Slide 31

Slide 31 text

Terraform State file

Slide 32

Slide 32 text

Remote State file

Slide 33

Slide 33 text

Terraform Continuous Delivery

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

CI/CD

Slide 36

Slide 36 text

CircleCI is a Continuous Integration/ Continuous Deployment platform that enables developers to build, test and deploy their code using automation.

Slide 37

Slide 37 text

Best Practices * ● Ensure deployments are aligned with established deployment policies. If you don't have established deployment strategies build some they'll serve as your blueprint to code against. ● Decide if it makes sense to build out new infrastructure on every stable release build using a tool like Terraform or release the build to existing infrastructure and validate your IaC templates are still valid. If not handle the exceptions. ● Frequently assess the viability of your current IaC templates to ensure that they are supporting your current infrastructure requirements. Accurately identify when you need to Scale up, out, down and in because these requirements are mainly based on demand they fluctuate. *According to CircleCI

Slide 38

Slide 38 text

Testing ● Static testing of infrastructure as a code ● Unit testing of infrastructure as code ● System testing ● System integration testing ● .Blue/Green deployment

Slide 39

Slide 39 text

Questions @olufuwatayo