Continuous Integration In challenging environments w/ Ansible. PyCon5 Italy, Cesare Placanica



Similar documents
depl Documentation Release depl contributors

Ansible. Configuration management tool and ad hoc solution. Marcel Nijenhof

Ansible. swiss army knife orchestration

Utilizing Ansible to Manage a Highly Available MySQL Environment

Introduction to CloudScript

Infrastructure as data with Ansible for easier Continuous Delivery

Extending Remote Desktop for Large Installations. Distributed Package Installs

How to Backup XenServer VM with VirtualIQ

Ansible in Depth WHITEPAPER. ansible.com

Preparing for the Installation

Using Vagrant for Magento development. Alexander

Installing IBM Websphere Application Server 7 and 8 on OS4 Enterprise Linux

Practical continuous deployment

When flexibility met simplicity: The friendship of OpenStack and Ansible

INASP: Effective Network Management Workshops

Skip the But it Works on My Machine Excuse with Vagrant

Cloud-init. Marc Skinner - Principal Solutions Architect Michael Heldebrant - Solutions Architect Red Hat

TIBCO ActiveMatrix BusinessWorks Plug-in for TIBCO Managed File Transfer Software Installation

DevKey Documentation. Release 0.1. Colm O Connor

Automated Configuration of Open Stack Instances at Boot Time

Deploying Your Application On Public Cloud

ICS 351: Today's plan

Monitoring Clearswift Gateways with SCOM

Adafruit's Raspberry Pi Lesson 6. Using SSH

Introduction to HDFS. Prasanth Kothuri, CERN

Advanced Systems Management with Machinery

CS 2112 Lab: Version Control

Jenkins and Chef Infrastructure CI and Application Deployment

Linux System Administration on Red Hat

TEST AUTOMATION FRAMEWORK

Working with Docker on Microsoft Azure

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Getting Started with the CLI and APIs using Cisco Openstack Private Cloud

Remote Access to Unix Machines

Using Network Attached Storage with Linux. by Andy Pepperdine

PrimeRail Installation Notes Version A June 9,

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

Triple-E class Continuous Delivery

Continuous Integration using Docker & Jenkins

WebLogic Server Administration

LAE Enterprise Server Installation Guide

Continuous Delivery for Alfresco Solutions. Satisfied customers and happy developers with!! Continuous Delivery!

Version Control Your Jenkins Jobs with Jenkins Job Builder

Creating a dynamic software deployment solution using free/libre software

Installing TeamCall Server on Mac OS X

DevOps Course Content

Backing Up Your System With rsnapshot

ABRAHAM ARCHITECTURE OF A CLOUD SERVICE USING PYTHON TECHNOLOGIES

IBM WebSphere Application Server V8.5 lab Basic Liberty profile administration using the job manager

Contents Set up Cassandra Cluster using Datastax Community Edition on Amazon EC2 Installing OpsCenter on Amazon AMI References Contact

Laboration 3 - Administration

Configure NFS Staging for ACS 5.x Backup on Windows and Linux

Introduction to Cloud Computing

Of Pets and Cattle and Hearts

Installing a Symantec Backup Exec Agent on a SnapScale Cluster X2 Node or SnapServer DX1 or DX2. Summary

Author A.Kishore/Sachin VNC Background

OS X Modular Imaging and Deployment using Free and Open Source Tools

CONNECTING TO DEPARTMENT OF COMPUTER SCIENCE SERVERS BOTH FROM ON AND OFF CAMPUS USING TUNNELING, PuTTY, AND VNC Client Utilities

Version Control with Subversion

Linux command line. An introduction to the Linux command line for genomics. Susan Fairley

Configuring the BBj Jetty Web Server (rev10.02) for OSAS

TP1: Getting Started with Hadoop

Using a login script for deployment of Kaspersky Network Agent to Mac OS X clients

USER GUIDE. Snow Inventory Client for Unix Version Release date Document date

More about Continuous Integration:

Rsync: The Best Backup System Ever

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Software Automated Testing

Installing and running COMSOL on a Linux cluster

Introduction to HDFS. Prasanth Kothuri, CERN

Red Hat System Administration 1(RH124) is Designed for IT Professionals who are new to Linux.

McAfee Network Threat Response (NTR) 4.0

Programming for GCSE Topic H: Operating Systems

Beyond Windows: Using the Linux Servers and the Grid

Oracle EXAM - 1Z Oracle Weblogic Server 11g: System Administration I. Buy Full Product.

Creating a DUO MFA Service in AWS

The Linux Operating System and Linux-Related Issues

Instructions for Accessing the Advanced Computing Facility Supercomputing Cluster at the University of Kansas

Upgrading a Single Node Cisco UCS Director Express, page 2. Supported Upgrade Paths to Cisco UCS Director Express for Big Data, Release 2.

A candidate following a programme of learning leading to this unit will be able to:

Authentication in a Heterogeneous Environment

HDFS Cluster Installation Automation for TupleWare

Author: Sumedt Jitpukdebodin. Organization: ACIS i-secure. ID: My Blog:

IT6204 Systems & Network Administration. (Optional)

Introduction to Running Computations on the High Performance Clusters at the Center for Computational Research

BIRT Application and BIRT Report Deployment Functional Specification

Deploy and Manage Hadoop with SUSE Manager. A Detailed Technical Guide. Guide. Technical Guide Management.

OpenMake Dynamic DevOps Suite 7.5 Road Map. Feature review for Mojo, Meister, CloudBuilder and Deploy+

Managing Access Control in PresSTORE

There s a variety of software that can be used, but the approach described here uses freely available Cygwin software: (1) Cygwin/X (2) Cygwin/openssh

OnCommand Performance Manager 1.1

Déployer son propre cloud avec OpenStack. GULL François Deppierraz

How To Boot A Cloud Instance On Ubuntu (Oracle) On Ubuntusa (Orca) On A Ubuntu Cloud Instance (Ora) On An Ubuntu 3.5

Python and Google App Engine

Building a Continuous Integration Pipeline with Docker

Enabling Active Directory Authentication with ESX Server 1

APPLICATION NOTE. How to build pylon applications for ARM

Putting It All Together. Vagrant Drush Version Control

One solution for all your Source Configuration Management Needs

Transcription:

Continuous Integration In challenging environments w/ Ansible. PyCon5 Italy, Cesare Placanica

Who am I Work for Cisco Photonics Italy Network Management Technology Group keobox@gmail.com

Cisco Prime Optical (Mostly) Java Application. Server: runs on RH Linux. There s a GUI installer but the GUI can be turned off using a response file. Client: Downloaded via Java Webstart.

The Problem There s a bunch of official servers for the build process (Jenkins). There s a bunch of development virtual machine for the developers, roughly one for developer. We want to install our application from official servers to development servers.

But

The Environment Vogons devservers Build spool Dev tools

The (challenging) Environment No sudo access to Vogon s servers. Limited access to Jenkins: for some users only. Sudo access to devservers for every developer. NFS builds spool directory accessible by both groups: vogons and devservers. NFS dev tools directory accessible by both groups.

Doubts and concerns It is not possible to install applications on a Vogon s server (no Puppet master). Use Fabric? Use Chef or Saltstack?

Wish you were here

Ansible 101 No Agent, like Fabric, uses only ssh. Centralized configuration file. Pluggable, modular. Plenty of plugins (for less challenging environments). Supports groups and roles. YAML.

Ansible 102 Comes with two command line tools for: Ad-hoc commands. Orchestration = Playbooks. ansible -i ~/etc/hosts devservers -m ping ansible -i ~/etc/hosts devservers -u root -a cat /etc/shadow ansible-playbook -i ~/etc/hosts devservers install. yml

Playbook 101 Is written in YAML. A playbook is a list of plays. A play is a list of tasks, played by a user on a group.

Tasks 101 A task can be defined in a playbook or in a task file written in YAML. A task file contains one ore more things to do. A task uses the Ansible s plugin functionalities. A task uses Ansible s variables. A task uses user defined variables.

Requirements Master: Python w/ Ansible on the host where ansible is running: a Vogon s server or another devservers. Target: a devserver w/ at least Python 2.6 or lesser with simplejson installed.

The Solution Vogons devservers px-build ansible-playbook Build spool Dev tools

The Solution Hi, can you please generate a SSH key for pxbuild named ci_rsa and give us the public key? Sure!

The Solution: hosts file [devservers] arthur trillian [devservers:vars] ansible_python_interpreter=/sw/packages/python/2.7.1 /bin/python launch_dir=/data/cdimage/disk1 nfs_dir=/builds/cdimages/latest target_build_dir=/data/cdimage target_inst_dir=/cisco/primeopticalserver

The Solution: install.yml --- hosts: devservers tasks: - include: tasks/checkinstalled.yml - include: tasks/remove-tar.yml - include: tasks/expand-tar.yml - include: tasks/response-file.yml - hosts: devservers user: root tasks: - include: tasks/install.yml - include: postinstall.yml

The solution: deploy.yml --- hosts: devservers user: root tasks: - include: tasks/check-tar-exists.yml - include: tasks/uninstall.yml - include: install.yml

The Solution: checkinstalled.yml An example of if. --# check if server already installed tasks - name: check if server is installed action: command ls {{ target_inst_dir }} register: result ignore_errors: True - fail: msg="server is already installed" when: result success

The Solution: response-file.yml Example of template module. --# prepare response file tasks - name: remove response file action: command rm -f /tmp/ctm.properties - name: transfer installation response file action: template src=./templates/ctm.properties.j2 dest=/tmp/ctm.properties

The Solution: jinja2 template DB_IP_ADDRESS={{ ansible_eth0["ipv4"]["address"] }} SERVER_HOSTNAME={{ ansible_fqdn }} SERVER_IP_ADDRESS={{ ansible_eth0["ipv4"]["address"] }} SUDO_GROUP=root USER_INSTALL_DIR={{ target_inst_dir }}

The Solution: bash glue ci.sh is a glue shell script invoked by Jenkins running on a Vogon s server as px-build user. #!/bin/sh. /opt/dev-tools/python/linux/2.7.4/python/bin/activate (cd /opt/dev-tools/lazyjack/release/ansible && ansibleplaybook --private-key=~/.ssh/ci_rsa -i hosts deploy.yml)

LazyJack

LazyJack LazyJack is a set of Eclipse plugins, python scripts and Unix aliases that aids the developers to be process compliant. The project was started by my colleague Stefano Iasi, I m a contributor.

Gotcha! Thank to Ansible, any host in the devservers group can install any other host of the same group. I ve integrated Ansible in LazyJack to bypass the GUI installer. bootstrap installs all the stuff in ~/etc/lazyjack buildinstall invokes the ansible-playbook command. A developer can use buildinstall directly.

Takeaways Ansible is very easy and well documented! Central configuration file is a win. Parallen by default (5 processes). Playbooks (orchestration) and configuration are separated. It s very easy to reuse tasks and make them modular. Python plugins included (but I used a few).

Q&A

So Long, and Thanks for All the Fish. (Douglas Adams)