Ansible for Easy Provisioning and Application Deployment

Slides:



Advertisements
Similar presentations
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.
Advertisements

About Me CTO, Individual Digital, Inc. (Startup) Author of ext/tidy, PHP 5 Unleashed, Zend Ent. PHP Patterns
What all is there Inside the Apache web server. These slides are part of study material of LAMP course. Course conducted by Prof Rocky Jagtiani – Technical.
Application Deployment WEBLOGIC SERVER. 1.Stage 2.No Stage 3.External Stage Deploying Applications Using Different Modes.
December, 2008 CS-591 Securing Servers: International Capture the Flag 1 Nadine Sundquist CS591-F2008 University of Colorado, Colorado Springs Dr. C. Edward.
Asset: Academic Survey System & Evaluation Tool Bert G. Wachsmuth Seton Hall University.
Presented by Mina Haratiannezhadi 1.  publishing, editing and modifying content  maintenance  central interface  manage workflows 2.
Securing LAMP: Linux, Apache, MySQL and PHP Track 2 Workshop PacNOG 7 July 1, 2010 Pago Pago, American Samoa.
SquirrelMail for Webmail AfNOG 2013 Scalable Internet Services (SS-E) Presented by Michuki Mwangi Lusaka, Zambia (Original Materials by Joelja)
Hyrax Installation and Customization Dan Holloway James Gallagher.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Server works - HTML5 - CSS3 - Bootstrap 3.x. Likipe Servers Dev ServerProduction Server TypeShared HostVirtual Private Server Urlweb1.likipe.se/web2.likipe.se“Real.
STIG Compliance and Remediation with Ansible April 2015.
Sponsored by the National Science Foundation Configuration Management For Experimenters: Ansible Hands-On Sarah Edwards, GPO.
APEX power! Alan Arentsen brought to you by GlassFish.
Managing Drupal with Aegir Chris Burge Burge Consulting, LLC 30 June 2013 Dublin, Ireland Drupal Dev Days.
Vagrant workflow Jul. 15, 2014.
Module 4 : Installation Jong S. Bok
LinuxChix Apache. Serving Webpages The layer 7 protocol (HTTP) is what our browsers talk to get us the websites we can't seem to live without. HTTP is.
1 PUPPET AND DSC. INTRODUCTION AND USAGE IN CONTINUOUS DELIVERY PROCESS. VIKTAR VEDMICH PAVEL PESETSKIY AUGUST 1, 2015.
Ansible with vCloud Air Workshop
Wordpress with Mina Automated Deployment Solution Jonathan Gravato DIG 4104c.
Group Name: PNT Group Members: Prabin Joshi and Ngoc Vu.
Multi-Domain Hosting Hosting multiple domains on one server using Apache John Beckett 1/16/2013.
Apache with SSL and php Apache with ssl support should be the basic platform for providing web services... There are several different implementations.
WAMP Windows Apache MySQL and PHP i.e. “WAMP”. Why WAMP? WampServer is a Windows web development environment. It allows you to create and test web pages.
Infrastructure as code. “Enable the reconstruction of the business from nothing but a source code repository, an application data backup, and bare metal.
Sponsored by the National Science Foundation Today’s Exercise.
VIRTUAL HOSTING WITH PureFTPd And MYSQL (Quota And Bandwidth Management) BY Odoh Kenneth Emeka Sun Yu Patrick Appiah.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
IBM Express Runtime Quick Start Workshop © 2007 IBM Corporation Deploying a Solution.
Tomcat Setup BCIS 3680 Enterprise Programming. One-Click Tomcat Setup 2  This semester we’ll try to set up Tomcat with a PowerShell script.  Preparation.
Ansible and Ansible Tower 1 A simple IT automation platform November 2015 Leandro Fernandez and Blaž Zupanc.
Multi-Domain Hosting CPTE 212 “Missing Slides” for 1/22/2015 John Beckett.
1 E-Site - FTP Services Setup / install guide. 2 About FTP services can run on any desired port(s) Runs as a windows service Works for all sites installed.
Introduction to Ansible
L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.
Web and Proxy Server.
PHP using MySQL Database for Web Development (part II)
Introduction to Ansible
ONAP on Vagrant for ONAPers
Stress Free Deployments with Octopus Deploy
@ Bucharest DevOps Hacker Meetup
Site Administration Tools: Ansible
Modernize Your Operations
Efficient development and deployment of Hydra projects using Vagrant
Introduction to Dynamic Web Programming
NTP, Syslog & Secure Shell
Introduction to Ansible
6/11/2018 8:14 AM THR2175 Building and deploying existing ASP.NET applications using VSTS and Docker on Windows Marcel de Vries CTO, Xpirit © Microsoft.
SquirrelMail for Webmail
Logo here Module 3 Microsoft Azure Web App. Logo here Module Overview Introduction to App Service Overview of Web Apps Hosting Web Applications in Azure.
IT Atoumation / Conf. Mgmt...
Three modes of Hadoop.
Lab 1 introduction, debrief
Identity Federations - Installation and operation
Drupal VM and Docker4Drupal For Drupal Development Platform
Apache Web Server A PAtCHy server: developed by the Apache group formed 2/95 around a number of people who provided patch files for NCSA httpd 1.3 by Rob.
Drupal VM and Docker4Drupal as Consistent Drupal Development Platform
Intro to Config Management Using Salt Open Source
Ansible and Zabbix Rushikesh Prabhune (Software Technical Consultant)
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Network Configuration Automation at LINX
asset: Academic Survey System & Evaluation Tool
Introduction to Ansible
Presented By - Avinash Pawar
GBIF CESP Workshop, Madrid 2018 Dave Martin
Introduction to Django
SharePoint Permissions Manager
Service Template Creation from the Ground Up
Presentation transcript:

Ansible for Easy Provisioning and Application Deployment Neal Stephenson and Diego Figueroa, UIT

Why Use It Simple automation tool Low requirements: Machine with ssh server Account that can sudo (or root) Can crystalize knowledge Deploy applications to your environments only need sudo if you are going to do things that cannot be done by user that you logged in as harden ssh example

Simple Example Run a command on your inventory of hosts: ansible all -m shell -a ‘echo hi from $(hostname)’ Run a sophisticated module on your mysql servers: ansible mysql -m mysql_user -a user=oucc -a password=123456 The word after the ansible command is the host group to use which we will see on the next slide

Inventory List of your hosts Grouped into sets These groups then used to set variables and are used to determine machine roles [managed] html1 html2 mysql1 [html] I tend to use a lot of groups also special groups like :children, :vars - the latter I would avoid use group vars

YAML Syntax YAML is a clean syntax to write most data structures in. variable: value list: item 1 item 2 hash: key1: value1 key2: value2 even do array of hashes or hashes of arrays of hashes… yaml is not unique to ansible

Group Vars These are variables that are set due to host being in group in hosts. There is a default all.yml group. html.yml --- users: - name: us1 uid: 20001 - name: us2 uid: 20002 web_home: /webs web_group: web nfs_hosts: - 10.0.1.21 - 10.0.1.22 - 10.0.1.51 also use to differentiate environments DEV, QA, PROD typically, I have, groups for services and overlapping groups for environments

Roles Roles are groups of tasks, files, handlers that can be used to setup a “service” e.g. mysql role would have all the commands to install mysql, configure the database, setup root user… I normally tie roles to groups demo roles directory and inside a roles directory

Plays Plays are collections of roles and commands to do major goals. --- # comprehensive setup - name: settings for all hosts hosts: all roles: - base tags: base - name: settings for managed hosts hosts: managed sudo: true - managed tags: managed Commonly setup entire cluster of machines Ideally they should be repeatable

Demo Simple OUCC Application Deploy on UAT, QA & Production Quick Redeploy What does this entail for Change Management?

Demo Files (1) django-uat.yml: inventory: --- - hosts: appserver-uat any_errors_fatal: true vars_files: - "group_vars/common" - "group_vars/{{app}}" roles: - user - mysql - git - env - django - permissions - apache inventory: [local] localhost [appserver-uat] app05uat.uit.yorku.ca [appserver-qa] app05qa.uit.yorku.ca ...

Demo Files (2) common: oucc2016-pyork: app_domain: "{{ my_domain | default(False) }}" ssh_priv_key: ~/.ssh/id_rsa oucc2016-pyork: app_user: oucc2016 app_name: oucc2016 app_description: OUCC 2016 Ansible Demo (PYork) app_acl: valid-user install_root: oucc2016-pyork initial: "{{ run_fixtures | default(False) }}" pyork: "{{ setup_pyork | default(True) }}" mysql: "{{ uses_mysql | default(False) }}" ...

Demo Files (3) roles/user/tasks/main.yml: --- - name: Create the group for the app group: name="{{app_user}}" gid="{{uid}}" become: yes register: group - name: Create the user under which we will run the app user: name="{{app_user}}" password=! uid="{{uid}}" group="{{app_user}}" groups=ccsdev shell=/bin/bash home="/home/{{app_user}}" comment="{{app_description}}" when: group|success register: user - name: Register user SSH key authorized_key: user="{{app_user}}" key="{{lookup('file', '~/.ssh/id_rsa.pub')}}" become_user: root when: user|success

Demo Files (4) roles/apache/templates/django.conf: <VirtualHost *:80> ServerName {{app_domain}} DocumentRoot /home/{{app_user}}/{{install_root}} ErrorLog /var/log/apache2/{{app_user}}-error.log LogLevel warn CustomLog /var/log/apache2/{{app_user}}-access.log combined RedirectMatch (.*) https://{{app_domain}}$1 </VirtualHost> <VirtualHost *:443> ...

Install Demo Large play that installs a complete virtual machine environment with two apache servers, a mysql server, a tomcat server, an NFS server and a graphite server. Also installs collectd and monit on every machine.

Questions?

Thank you! Neal Stephenson neal@yorku.ca Diego Figueroa dfiguero@yorku.ca