+ All Categories
Home > Technology > Ain't Nobody Got Time For That: Intro to Automation

Ain't Nobody Got Time For That: Intro to Automation

Date post: 09-Apr-2017
Category:
Upload: mfrost503
View: 333 times
Download: 3 times
Share this document with a friend
56
AIN’T NOBODY GOT TIME FOR THAT! MATT FROST @SHRTWHITEBLDGUY HTTPS://JOIND.IN/16027
Transcript
Page 1: Ain't Nobody Got Time For That: Intro to Automation

AIN’T NOBODY GOT TIME FOR THAT!

MATT FROST @SHRTWHITEBLDGUY HTTPS://JOIND.IN/16027

Page 2: Ain't Nobody Got Time For That: Intro to Automation

WHO AM I?INTRODUCTION

Page 3: Ain't Nobody Got Time For That: Intro to Automation

WHAT IS AUTOMATION?DEFINITION

Page 4: Ain't Nobody Got Time For That: Intro to Automation

WHY AUTOMATE?DEFINING PURPOSE

Page 5: Ain't Nobody Got Time For That: Intro to Automation

• TASKS BECOME CLEARLY DEFINED IN ONE LOCATION

• OFFERS AN OPPORTUNITY TO REFINE PROCESSES

• ELIMINATES PROCESS VARIATION

• ELIMINATES DISRUPTIONS

WHY AUTOMATE?

Page 6: Ain't Nobody Got Time For That: Intro to Automation

WHAT WE’LL COVER

Page 7: Ain't Nobody Got Time For That: Intro to Automation

• CHALLENGES

• WHAT/WHERE/WHEN/WHY/HOW?

• OVERVIEW OF AUTOMATION TOOLS/TECHNIQUES

WHAT WE’LL COVER

Page 8: Ain't Nobody Got Time For That: Intro to Automation

AUTOMATION CHALLENGESCHALLENGES

Page 9: Ain't Nobody Got Time For That: Intro to Automation

• REQUIRES A STRONG UNDERSTANDING OF THE PROCESS

• REQUIRES A LOT OF TRUST IN THE PROCESS

• REQUIRES A PLAN IF SOMETHING GOES SIDEWAYS

AUTOMATION CHALLENGES

Page 10: Ain't Nobody Got Time For That: Intro to Automation

HOW DO WE AUTOMATE?OBJECTIVE

Page 11: Ain't Nobody Got Time For That: Intro to Automation

• TOOLS

• SCRIPTING

• EXPERIENCE

HOW DO WE AUTOMATE?

Page 12: Ain't Nobody Got Time For That: Intro to Automation

WHERE CAN WE AUTOMATE?OBJECTIVE

Page 13: Ain't Nobody Got Time For That: Intro to Automation

• LOCALLY

• DEV ENVIRONMENTS

• PRODUCTION

WHERE CAN WE AUTOMATE

Page 14: Ain't Nobody Got Time For That: Intro to Automation

LOCALLYWHERE CAN WE AUTOMATE?

Page 15: Ain't Nobody Got Time For That: Intro to Automation

WHEN YOU THINK ABOUT ALL THE THINGS YOU HAVE TO DO TO START WORKING, IT’S ANNOYING RIGHT?

Page 16: Ain't Nobody Got Time For That: Intro to Automation

THERE ARE SOME EASY OPTIONS…BUT

Page 17: Ain't Nobody Got Time For That: Intro to Automation

ALFRED!

Page 18: Ain't Nobody Got Time For That: Intro to Automation

SWEET RIGHT?

Page 19: Ain't Nobody Got Time For That: Intro to Automation

WORKFLOWS!

Page 20: Ain't Nobody Got Time For That: Intro to Automation
Page 21: Ain't Nobody Got Time For That: Intro to Automation

LOCAL SCRIPTING

Page 22: Ain't Nobody Got Time For That: Intro to Automation

TOOLS

Page 23: Ain't Nobody Got Time For That: Intro to Automation

DEPLOYMENT/CI• PHING • JENKINS • ANSIBLE • TRAVIS CI • CUSTOM SHELL SCRIPTS

Page 24: Ain't Nobody Got Time For That: Intro to Automation

MONITORING• NEW RELIC • PINGDOM • CUSTOM SHELL SCRIPTS • TESTING TOOLS

Page 25: Ain't Nobody Got Time For That: Intro to Automation

TESTING TOOLS• PHPUNIT • PHPSPEC • BEHAT • CODECEPTION • RUNSCOPE

Page 26: Ain't Nobody Got Time For That: Intro to Automation

PROVISIONING• ANSIBLE • CHEF • PUPPET • SHELL SCRIPTS

Page 27: Ain't Nobody Got Time For That: Intro to Automation

THERE ARE OPTIONSYOU DON’T NEED ALL THESE TOOLS BUT…

Page 28: Ain't Nobody Got Time For That: Intro to Automation

CREATING A SOLUTION

Page 29: Ain't Nobody Got Time For That: Intro to Automation

SERVER DEPLOYMENTCREATING A SOLUTION

Page 30: Ain't Nobody Got Time For That: Intro to Automation

DIGITAL OCEAN APICREATING A SOLUTION

Page 31: Ain't Nobody Got Time For That: Intro to Automation
Page 32: Ain't Nobody Got Time For That: Intro to Automation
Page 33: Ain't Nobody Got Time For That: Intro to Automation

I DON’T WANT TO CLICK THAT MANY TIMES…

CREATING A SOLUTION

Page 34: Ain't Nobody Got Time For That: Intro to Automation

ANSIBLECREATING A SOLUTION

Page 35: Ain't Nobody Got Time For That: Intro to Automation

SERVER SETUP CAN BE HARDCREATING A SOLUTION

Page 36: Ain't Nobody Got Time For That: Intro to Automation

HERE’S WHAT I NEEDEDCREATING A SOLUTION

• PHP (AND DEPS) • MYSQL (AND DEPS) • APACHE (I KNOW…) • WORDPRESS CONFIGS

Page 37: Ain't Nobody Got Time For That: Intro to Automation

ANSIBLE STRUCTURECREATING A SOLUTION

Page 38: Ain't Nobody Got Time For That: Intro to Automation

ROLES

• Files

• Handlers

• Meta

• Tasks

• Templates

• Vars

Page 39: Ain't Nobody Got Time For That: Intro to Automation

PLAYBOOK

Page 40: Ain't Nobody Got Time For That: Intro to Automation

--- - name: Install Apache2 apt: pkg=apache2 state=installed update_cache=true register: apache2

- name: Install Apache2 MPM Prefork apt: pkg=apache2-pmp-prefork state=installed when: apache2|success register: prefork

- name: Install Apache2 MPM Prefork apt: pkg=apache2-pmp-prefork state=installed when: apache2|success register: prefork

Page 41: Ain't Nobody Got Time For That: Intro to Automation

--- - hosts: bd roles: - setup - iptables-setup - apache2-setup - mysql-setup - php-setup - users-setup

PLAYBOOK EXAMPLE

Page 42: Ain't Nobody Got Time For That: Intro to Automation

PHINGCREATING A SOLUTION

Page 43: Ain't Nobody Got Time For That: Intro to Automation

CONSIDERATIONSCREATING A SOLUTION

Page 44: Ain't Nobody Got Time For That: Intro to Automation

<?xml version="1.0" encoding="UTF-8"?> <project name="BDSO" default="build" basedir="./"> <property file="bdso.properties" /> <target name="composer"> <echo msg="Composer automatic updates aren't enabled at this point" /> <echo msg="Running self-update on composer" /> <exec command="sudo composer self-update" passthru="true" /> <echo msg="Installing new dependencies (if necessary)" /> <exec command="composer install --no-dev --no-scripts" passthru="true" /> </target>

<target name="build"> <phingcall target="composer" /> </target>

COMPOSER INSTALL WITH PHING

Page 45: Ain't Nobody Got Time For That: Intro to Automation

INSTALLING PHINGCREATING A SOLUTION

“phing/phing”: “2.*”

Page 46: Ain't Nobody Got Time For That: Intro to Automation

RUNNING PHINGCREATING A SOLUTION

vendor/bin/phing -f path/to/build.xml

Page 47: Ain't Nobody Got Time For That: Intro to Automation

BASH SCRIPTINGCREATING A SOLUTION

Page 48: Ain't Nobody Got Time For That: Intro to Automation

SCRIPTING COMMANDSCREATING A SOLUTION

Page 49: Ain't Nobody Got Time For That: Intro to Automation

MY FAVORITE UNIX COMMAND

find ./ -type f -name ‘*.php’ -print0 | xargs -0 grep -n ‘SearchTerm’

finder -s ‘SearchTerm’

Page 50: Ain't Nobody Got Time For That: Intro to Automation

MONITORING WITH SHELL SCRIPTS

CREATING A SOLUTION

Page 51: Ain't Nobody Got Time For That: Intro to Automation

THE BASICSCREATING A SOLUTION

• MAKE SURE SERVICES ARE RUNNING • CHECK SERVER LOAD • NOTIFICATIONS

Page 52: Ain't Nobody Got Time For That: Intro to Automation

SIMPLICITY OVER ALL ELSECONCLUSION

Page 53: Ain't Nobody Got Time For That: Intro to Automation

SECURITYCONCLUSION

Page 54: Ain't Nobody Got Time For That: Intro to Automation

AUTOMATION IS ATTAINABLECONCLUSION

Page 55: Ain't Nobody Got Time For That: Intro to Automation

QUESTIONS?CONCLUSION

Page 56: Ain't Nobody Got Time For That: Intro to Automation

FEEDBACKCONCLUSION

https://joind.in/16027

Twitter: @shrtwhitebldguy

IRC: mfrost503


Recommended