SlideShare a Scribd company logo
ansible why ?
ansible why ?
In the name of god
Biography :
My name is : yashar esmaildokht
I am Gnu/Linux Sys/net/sec Admin & Oracle Dba
my tel : 09141100257
my resume :http://www.nofa.ir/Resume-royaflash.aspx
website :
● http://unixmen.ir
● http://oraclegeek.ir
● http://webmom.ir
my nick name : royaflash
What is ansible
Ansible is an open-source automation engine
that automates cloud provisioning,
configuration management, and application
deployment.Once installed on a control node,
Ansible, which is an agentless architecture,
connects to a managed node through the
default OpenSSH connection type.
- python-powered redically simple IT automation tool
- is optimized for easy automation, review, editing, &
auditability
- free, open source
- simply
- clear (anyone)
- fast (to learn, to setup)
- complete (modules)
- efficient (runs on OpenSSH)
- secure (without agents)
ansible why ?
ansible why ?
- configuration management
- application deployment
- multi-tier orchestration
- cloud provisioning
For what Ansible?
- agentless architecture
- management over SSH (no custom PKI-SSH-based, no
external databases, no daemons, does not leave
software installed)
- developer friendly (configuration as data, not code)
- batteries-included (usefull modules)
- dead simple
- release cycles are usually about two months long
Ansible features
Who uses Ansible?
ansible why ?
Who uses Ansible?
20.01.2014
- fabric (python library)
- capistrano (capifony)
- puppet
- chef
- saltstack
-
- idephix, magellanes,
- deployer, rocketeer (php)
Other tools
- required Python 2.6
- or Python 2.5 (with additional paramiko, PyYAML,
python-jinja2 and httplib2 modules)
- Windows isn’t supported for the control machine
(starting with 1.8 will be fully support Windows)
- includes Red Hat, Debian, CentOS, OS X, any of the
BSDs, and so on
Control Machine Requirements
- Python 2.4 or later
- if Python 2.5, then with python-simplejson modules
- ansible_python_interpreter to point at your 2.x Python
- starting in version 1.7, ansible contains support for
managing windows machines
Managed Node Requirements
ansible why ?
- 1.9-dev “Dancing In the Street”
- 1.8 “You Really Got Me” Nov 26, 2014
- new Jinja2 filters, fixed a log of modules bugs, new
system, variables, new modules, docker support, etc
- 1.7 “Summer Nights” Sep 24, 2014
Versions
Ansible Galaxy
Ansible Tower
Ansible Tower
- from git
- from os packages (recommend If you are
wishing to run the latest released version)
- from pip (recommended to use Python
package manager for other cases)
Install & Configure
- Paramiko (python ssh module)
- SSH (OpenSSH)
- local
Connection types
Ansible architecture
[web]
webserver-1.example.com
webserver-2.example.com
[db]
dbserver-1.example.com
Host Inventory: Basics
[web]
webserver-[01:25].example.com
webserver-2.example.com
[db]
dbserver-[a:f].example.com
Host Inventory: Ranges
[all:children]
all-local
all-stage
[all-local:children]
web-local
db-local
[all-stage:children]
web-stage
db-stage
Host Inventory: child groups
[web-stage:children]
web-stage-testing
web-stage-production
[db-stage:children]
db-stage-testing
db-stage-production
[web-stage-testing]
testing-red
[web-stage-production]
production
[web-local]
vagrant
[db-local]
vagrant
non standart SSH-ports:
webserver-3.example.com:2222
SSH tunnel:
myhost ansible_ssh_port=5555
ansible_ssh_host=192.168.0.1
Host Inventory: More
ansible <host-pattern> [options]
vm$ cd demo1/
vm$ ansible all -m ping
vm$ ansible all -m setup
vm$ ansible all -a "grep -c processor /proc/cpuinfo"
vm$ ansible all -a "uptime"
vm$ ansible all -a "uptime" -f 10
Demo
- playbooks
- plays
- tasks and handlers
- modules
- variables
Ansible concepts
playbooks contains plays
plays contains tasks
tasks contains modules
handels can be triggered by tasks,
and will run at the end, once
Playbooks
a tasks calls a module,
and may have parameters
Tasks
Modules
May 2013 - 72, October 2014 - 175,
February 2015 - 1933 modules on Galaxy
Modules list
- package management: yum, apt
- remove execution: command, shell
- service management: service
- file handling: copy, template
- scm: git, subversion
Modules examples
- monitoring: monit, nagios, haproxy, etc
- development: jenkins, drush, solr, scala,
maven, etc
- web: Varnish, apache, composer, tomcat,
symfony2, etc
- networking: tor, RabbitMQ, iptables, etc
- cloud: stash-docker, OpenStack, etc
Modules examples #2
Module: copy and template
Module: apt and yum
Simple playbook
- playbooks
- inventory (group vars, host vars)
- command line (ansible-playbook -e
“uservar=vagrant”)
- discovered variables (facts)
Variables
Ansible Directory Structure
Facts
- discovered variables about systems
- ansible -m setup <hostname>
Using facts
Variables (example of group-var)
Variables (example of host-vars)
- project organization tool
- reusable components
- defined filesystem structure
- show: parameterized roles
Roles
Roles
- failed_when
- changed_when
- until
- ignore_errors
- {{ lookup(‘file’, ‘test.pub’) }}
- etc
Advanced playbook features
Usage: ansible-vault [create|decrypt|edit|encrypt|rekey|
view] [--help] [options] file_name
Ansible vault
App deploy strategies
- basic file transfer (via ftp/scp)
- using Source Control
- using Build Scripts and other Tools
http://symfony.com/doc/current/cookbook/deployment/tools.html
1)Upload your modified code
2)Update your vendor dependencies (composer)
3)Running database migrations
4)Updated assetic assets
5)Clearing your cache
6)Other things
Symfony deployment
Symfony deployment
$ git pull
$ php composer.phar install
$ php app/console doctrine:migration:migrate --no-iteraction
$ php app/console assets:install web --symlink
$ php app/console assets:dump --env=prod
$ php app/console cache:clear
Directory structure
ansible why ?
1)Upload your modified code
- name: Pull sources from the repository.
git: repo={{repo}} dest={{dest}} version={{branch}}
when: project_deploy_strategy == “git”
module “synchronize” for rsync
Symfony deployment
2) Update your vendor dependencies (composer)
- name: Install composer
get_url: url=https://getcomposer.org/composer.phar
dest={{project_root}}/composer.phar mode=0755 validate_certs=no
- name: Run composer install
shell: cd {{project_root}}/releases/{{release}} && {{path}}
{{project_root}}/composer.phar install {{project_composer_opts}}
Symfony deployment
3) Running database migrations
- name: Run migrations
shell: cd {{project_root}}/releases/{{release}}
&& if $(grep doctrine-migrations-bundle composer.json);
then {{symfony2_project_php_path}} app/console
doctrine:migrations:migrate -n; fi
Symfony deployment
4) Updated assetic assets
- name: Dump assets
shell: cd {{project_root}}/releases/{{release}} &&
{{symfony2_project_php_path}} app/console
assetic:dump --env={{symfony2_project_env}}
{{symfony2_project_console_opts}}
Symfony deployment
5) Clearing your cache
- name: Clear cache
shell: cd {{project_root}}/releases/{{release}} &&
{{symfony2_project_php_path}} app/console
cache:clear --env={{symfony2_project_env}}
Symfony deployment
Easy way
https://galaxy.ansible.com/list#/roles/639
https://github.com/servergrove/ansible-symfony2
active release: "A-OK" failure deploying "APP"➙ ➙
rollback active release: "A-OK"➙
active release: "A-OK" deploying "BORKED" fail➙ ➙
Deployment rollback
https://github.com/itspoma/epam-symfony2-ansible
https://galaxy.ansible.com/
Roman R.
Resources
Thanks!
-questions?

More Related Content

PPTX
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
PPTX
Automating with Ansible
PPTX
Introduction to ansible
PDF
Ansible
PDF
IT Automation with Ansible
PDF
Automation with ansible
PPT
Ansible presentation
PDF
Ansible Introduction
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Automating with Ansible
Introduction to ansible
Ansible
IT Automation with Ansible
Automation with ansible
Ansible presentation
Ansible Introduction

What's hot (20)

PPTX
Introduction to Ansible
PDF
Ansible - Introduction
PDF
Ansible
ODP
Introduction to Ansible
PPTX
Best practices for ansible
PPTX
Ansible presentation
PDF
Ansible
PDF
Ansible
PDF
Ansible Automation Platform.pdf
PDF
Ansible - Hands on Training
PDF
DevOps Meetup ansible
PDF
Ansible 101
PDF
DevOps with Ansible
PDF
OpenShift 4, the smarter Kubernetes platform
PPTX
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
PDF
Ansible, best practices
PPTX
Ansible presentation
PDF
Ansible
PDF
Gitlab ci-cd
PDF
Network Automation with Ansible
Introduction to Ansible
Ansible - Introduction
Ansible
Introduction to Ansible
Best practices for ansible
Ansible presentation
Ansible
Ansible
Ansible Automation Platform.pdf
Ansible - Hands on Training
DevOps Meetup ansible
Ansible 101
DevOps with Ansible
OpenShift 4, the smarter Kubernetes platform
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible, best practices
Ansible presentation
Ansible
Gitlab ci-cd
Network Automation with Ansible
Ad

Viewers also liked (20)

PDF
AWS as a code - using ansible
PDF
Ansible - General Concepts and Summary
DOC
Proyecto upel
PDF
Kapiti Coast Visitors Guide 2017 Website v2
PPTX
Connect transmit regional seminar preston
PDF
DIA DEL PADRE:HOMENAJE POSTERGADO
PDF
کتاب لینوکس برای همه نسخه ۰٫۳
PDF
BeagleBone_Black
PDF
Geeks not gender
DOC
PDF
PPTX
Bubble tea
PDF
RK Decorators_Company Profile V1.0
DOCX
PPTX
APRENDIZAJE POR DESCUBRIMIENTO Y SIGNIFICATIVO
DOCX
Definición de proyecto socioeducativo
DOCX
Dos amigos inseparables cuento
PPTX
Grajsove implikature
PPTX
Lernerwörterbücher Deutsch - Eine Auswahl 2016
AWS as a code - using ansible
Ansible - General Concepts and Summary
Proyecto upel
Kapiti Coast Visitors Guide 2017 Website v2
Connect transmit regional seminar preston
DIA DEL PADRE:HOMENAJE POSTERGADO
کتاب لینوکس برای همه نسخه ۰٫۳
BeagleBone_Black
Geeks not gender
Bubble tea
RK Decorators_Company Profile V1.0
APRENDIZAJE POR DESCUBRIMIENTO Y SIGNIFICATIVO
Definición de proyecto socioeducativo
Dos amigos inseparables cuento
Grajsove implikature
Lernerwörterbücher Deutsch - Eine Auswahl 2016
Ad

Similar to ansible why ? (20)

PPTX
Deploying Symfony2 app with Ansible
PDF
Ansible_Basics_ppt.pdf
PDF
Ansible is the simplest way to automate. MoldCamp, 2015
PPTX
SESSION Ansible how to deploy and push resources
PDF
Ansible Tutorial.pdf
PPTX
Basics of Ansible - Sahil Davawala
PPTX
Ansible
PDF
Ansible automation tool with modules
PDF
Ansible & Salt - Vincent Boon
PPTX
Ansible as configuration management tool for devops
PPTX
Ansible Hands On
PDF
Containerization is more than the new Virtualization: enabling separation of ...
PDF
Ansible with oci
PDF
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
PDF
Ansible is Our Wishbone
PDF
Ansible is the simplest way to automate. SymfonyCafe, 2015
PDF
#OktoCampus - Workshop : An introduction to Ansible
PPTX
Go Faster with Ansible (AWS meetup)
PPTX
DevOps for database
PPTX
Ansible Devops North East - slides
Deploying Symfony2 app with Ansible
Ansible_Basics_ppt.pdf
Ansible is the simplest way to automate. MoldCamp, 2015
SESSION Ansible how to deploy and push resources
Ansible Tutorial.pdf
Basics of Ansible - Sahil Davawala
Ansible
Ansible automation tool with modules
Ansible & Salt - Vincent Boon
Ansible as configuration management tool for devops
Ansible Hands On
Containerization is more than the new Virtualization: enabling separation of ...
Ansible with oci
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone
Ansible is the simplest way to automate. SymfonyCafe, 2015
#OktoCampus - Workshop : An introduction to Ansible
Go Faster with Ansible (AWS meetup)
DevOps for database
Ansible Devops North East - slides

More from Yashar Esmaildokht (20)

PDF
ceph csi vs rook and its benefit and future
PDF
firewalling in linux and netfilter and iptables
PDF
the refrence of Oracle Database - The 0.4 release
PDF
The Refrence Of DevOps -The 0.5 release
PDF
Ceph RADOS Gateway (RGW) - s3 swift -object storage
PDF
oracle mysql/mariadb api -the connect engine
PDF
what is staging in database (oracle and mariadb |mysql)
PDF
devops and bcp (bussiness continues planning)
PDF
maxscale and spider engine for performance and security and clustering
PDF
DevOps reference - Devops metadologhy - devops technologhy
PDF
louad balancing vs api getway vs reverse proxy
PDF
Ceph: A Powerful, Scalable, and Flexible Storage Solution
PDF
how install and config sdn in proxmox virtualization
PDF
service registery and the service discovery
PDF
PDF
nbd and it's benefits
PDF
مرجع oracle mysql |mariadb
PDF
openstack designate
PDF
bcache and cachefs its benefits.
PDF
Systemd and its various uses and capabilities.
ceph csi vs rook and its benefit and future
firewalling in linux and netfilter and iptables
the refrence of Oracle Database - The 0.4 release
The Refrence Of DevOps -The 0.5 release
Ceph RADOS Gateway (RGW) - s3 swift -object storage
oracle mysql/mariadb api -the connect engine
what is staging in database (oracle and mariadb |mysql)
devops and bcp (bussiness continues planning)
maxscale and spider engine for performance and security and clustering
DevOps reference - Devops metadologhy - devops technologhy
louad balancing vs api getway vs reverse proxy
Ceph: A Powerful, Scalable, and Flexible Storage Solution
how install and config sdn in proxmox virtualization
service registery and the service discovery
nbd and it's benefits
مرجع oracle mysql |mariadb
openstack designate
bcache and cachefs its benefits.
Systemd and its various uses and capabilities.

Recently uploaded (20)

PDF
Volvo EC300D L EC300DL excavator weight Manuals.pdf
PPTX
Intro to ISO 9001 2015.pptx for awareness
PPTX
1. introduction-to-bvcjdhjdfffffffffffffffffffffffffffffffffffmicroprocessors...
PDF
industrial engineering and safety system
PDF
Volvo EC290C NL EC290CNL engine Manual.pdf
PDF
120725175041.pdfhjjjjjjjjjjjjjjjjjjjjjjh
PDF
Delivers.ai: 2020–2026 Autonomous Journey
PDF
Volvo ecr58 plus Service Manual Download
PDF
How Much does a Volvo EC290C NL EC290CNL Weight.pdf
PPTX
capstoneoooooooooooooooooooooooooooooooooo
PPTX
Gayatri Cultural Educational Society.pptx
PPTX
Lecture 3b C Library xnxjxjxjxkx_ ESP32.pptx
PDF
3-REasdfghjkl;[poiunvnvncncn-Process.pdf
PDF
Journal Meraj.pdfuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
PDF
Renesas R-Car_Cockpit_overview210214-Gen4.pdf
PPT
Kaizen for Beginners and how to implement Kaizen
PDF
Caterpillar CAT 312B L EXCAVATOR (2KW00001-UP) Operation and Maintenance Manu...
PDF
Caterpillar Cat 315C Excavator (Prefix CJC) Service Repair Manual Instant Dow...
PPTX
Chapter-1.pptxhhhhhhhhhhhhhhhhhhhhhhhhhh
PPTX
Paediatric History & Clinical Examination.pptx
Volvo EC300D L EC300DL excavator weight Manuals.pdf
Intro to ISO 9001 2015.pptx for awareness
1. introduction-to-bvcjdhjdfffffffffffffffffffffffffffffffffffmicroprocessors...
industrial engineering and safety system
Volvo EC290C NL EC290CNL engine Manual.pdf
120725175041.pdfhjjjjjjjjjjjjjjjjjjjjjjh
Delivers.ai: 2020–2026 Autonomous Journey
Volvo ecr58 plus Service Manual Download
How Much does a Volvo EC290C NL EC290CNL Weight.pdf
capstoneoooooooooooooooooooooooooooooooooo
Gayatri Cultural Educational Society.pptx
Lecture 3b C Library xnxjxjxjxkx_ ESP32.pptx
3-REasdfghjkl;[poiunvnvncncn-Process.pdf
Journal Meraj.pdfuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
Renesas R-Car_Cockpit_overview210214-Gen4.pdf
Kaizen for Beginners and how to implement Kaizen
Caterpillar CAT 312B L EXCAVATOR (2KW00001-UP) Operation and Maintenance Manu...
Caterpillar Cat 315C Excavator (Prefix CJC) Service Repair Manual Instant Dow...
Chapter-1.pptxhhhhhhhhhhhhhhhhhhhhhhhhhh
Paediatric History & Clinical Examination.pptx

ansible why ?

Editor's Notes

  • #6: yet another система керування конфігураціями, для автоматизації ручної рутини особливість - простота, при великій гнучкості you can get started in minutes located on github any ручні роботи автоматизувати
  • #9: it can configure systems and deploy the applications and orchestrate more advanced (просунутий) IT tasks: such as continuous deployments or zero downtime rolling updates +докер -вагран
  • #10: configurations are text It reads like English uses SSH to execute modules on remote machines without having to install any systems management software comes with a large selection of modules for automating common tasks modules can be written in any language -- if you would like to add extensions in bash, Python, Ruby, or even C, you are welcome to do so
  • #11: Jira, Confluence, HipChat from 2012, downloaded &amp;gt;1kk
  • #13: top 10 python projects on github, new contributor added every ~1.3 days 7 commits to dev-branch every day
  • #14: some for deploy, some for system tasks fabric is a Python (2.5-2.7) library for application deployment or systems administration tasks over SSH It provides a basic suite of operations, and uploading/downloading files python syntax (from fabric.api import run) capistrano: pre-post hooks (beforeX / afterX) rollback ant/phing
  • #15: client, local-machine requirements (вимога) for Ansible are extremely minimal (надзвичайно мінімальним) ansible runs on a central computer Python 2.5 + paramiko / PyYAML / python-jinja2 / httplib2
  • #16: raw module do not need “python-simplejson” module more
  • #18: 1.9 = танці на вулиці // stable release 26 листопада 2014 24 вересня 2014 every 2 month release
  • #19: перед тем, как переходити до техничних деталей analogue: packagist, npmjs, rubygems.org
  • #20: saas service =&amp;gt; software as a service =&amp;gt; пз як послуга
  • #21: demo free basic = 100$/month, up to 100 nodes, annual contract only enterprise = 50$/host/per-year, 8x5 support premium = 70$/host/per-year, 24x7 support 10 hosts = premium = 60$/per-month
  • #22: from git == to get all the latest features (новейшие функции), keep up to date with the development release cycles are usually about two months long
  • #23: it&amp;apos;s important to understand how Ansible is communicating with remote machines over SSH by default =&amp;gt; Ansible 1.3 try to use native OpenSSH when possible as fallback =&amp;gt; high-quality (высокое качество) Python implementation of OpenSSH called ‘paramiko’ In Ansible 1.2 and before - defalut is Paramiko When speaking with remote machines, Ansible will by default assume (вважати) you are using SSH keys local =&amp;gt; when node == control machine
  • #24: Inventory can be sourced from simple text files, the cloud, or configuration management databases
  • #25: інвентар with hosts describe infrastructure of your app servers the things in brackets are group names, used for classifying systems, are controlling for what purpose It is ok to put systems in more than one group, for instance a server could be both a webserver and a dbserver
  • #26: pattern діапазони
  • #28: custom connection settings group-vars / host-vars
  • #29: default: /etc/ansible/ (!!!) ansible is NOT just about running commands, it also has powerful configuration management and deployment features
  • #30: концепти, поняття
  • #31: playbooks define configuration policy and orchestration workflows YAML - зручний для читання людиною формат серіалізаціі даних, близький до мов розмітки декларативность описания всего позволяет читать хорошо написанные плейбуки как английский текст
  • #33: Модулей очень много, они есть на любой вкус и цвет При помощи модулей мы можем развернуть машину в облаке выполнить команду шела, управлять базами данных, создавать файлы и папки, копировать шаблоны, отправлять сообщения в очереди, управлять сетевой инфраструктурой, писать сообщения в чаты и много чего еще. травень 2013 = 72, Жовтень = 175, лютий2015 = овер2000
  • #36: over2000 modules on Galaxy
  • #39: tags
  • #45: best practice
  • #49: feature from ansible 1.5 allows keeping encrypted data (in source control) сховище
  • #51: other things: Tagging a particular version of your code Running any tests Removal of any unnecessary files Clearing of external cache systems cron tasks
  • #54: time to implementation
  • #55: Tagging a particular version of your code Running any tests Removal of any unnecessary files Clearing of external cache systems cron tasks
  • #56: Tagging a particular version of your code Running any tests Removal of any unnecessary files Clearing of external cache systems cron tasks
  • #57: Tagging a particular version of your code Running any tests Removal of any unnecessary files Clearing of external cache systems cron tasks
  • #58: Tagging a particular version of your code Running any tests Removal of any unnecessary files Clearing of external cache systems cron tasks
  • #59: use with_install (cache:clear, assets:install, assets:dump)