SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
ANSIBLE INSIDE IDEATO
Alessandro Mazzoli
Sysadmin@Ideato
am@ideato.it
@alendmazz
WHY ANSIBLE
we will consider some facts:
ideato’s scenario
dev needs
sysadm needs
IDEATO SCENARIO
focus on great software
development and good practices


50+VM’s to provision, configure
and maintain, no need a high
level of orchestration
DEV NEEDS
• easy CM tool to setup their
environments
• time spent to debug CM tool
error is waste
SYSADM NEEDS
• painless rolling updates

• going to mass production
environments
VS
ANSIBLE ROLES
≈
PUPPET MODULES
LEARNING CURVE
YAML vs RubyDSL
i don’t want learn Ruby or other DSL…
- name: set up user
user: name=alemazz
shell=/bin/bash
password={{ password}}
user{"$user":
managehome=>true,
ensure => present,
}
file{"/home/$user":
ensure=>directory,
mode=>755,
require=>User["$user"],
}
file{"/home/$user/.ssh":
ensure=>directory,
require=>File["/home/$user"],
}
Node specic information
Hiera
Node specic information
template Jinja + ansible vars + ansible
vault
add a yaml le on host_vars/ or group_vars for example:
—
aws_access_key: AKIA
aws_secret_key: ngxiw
and encrypt to AES: ansible-vault encrypt aws.yaml
Agentless
only SSH/SFTP/SCP are required
no central server scalability
no need to update minions or
puppet over your infrastructure
Inconsistency
• Ruby & PE
• Puppetforge modules
• Puppet skip everything
based on dep what just
failed
• Rspec needed
TOWARD MASS
PRODUCTION SYSTEM
DEMO: ELASTICSEARCH CLUSTER ON
AWS
USING ANSIBLE
our demo will be on AWS multi AZ……
Why Elasticsearch is t for CM management
tools like Ansible?
Lot of sys adm conguration tips for a cluster
environment
• java settings( jmx, mlockall….)
• sysctl settings( swappiness, max_map,count..)
• ulimit settings

Do I have to change these settings by hand
repeated for n° instance times?
NOTHANKS!
As a mention before Ansible has a plenty of
sysadm modules:

- name: firewalld applying conf
firewalld: service=elasticsearch
permanent=true zone=public state=enabled
tags:
- firewall

- name: sysctl configs
sysctl: name=fs.file-max value=64000 state=present
tags:
- sysctl
Here’ s come AWS
AWS provides a special plugin for discovery your ES
instances inside your cluster just by
their security group!
discovery.type: ec2
discovery.zen.ping.multicast.enabled: false
discovery.ec2.groups: my_security_group
I don’t have to update the other node -1 configurations
if i need to replace or add a new node!!
Create our instances--
- hosts: localhost
connection: local
vars_files:
- host_vars/el.yml
vars:
security_group: elsg
instance_type: t2.medium
image: ami-7cc4f661
region: eu-central-1
keypair: example.pem
n_instances: "1"
tasks:
- name: Launch Instance to Frankfurt av 1
ec2:
group: elsg
instance_type: "{{ instance_type }}"
image: ami-7cc4f661
wait: true
region: eu-central-1
keypair: "{{ keypair }}"
vpc_subnet_id: subnet-id
count: "1"
register: ec2
with_items: ec2_instances_fav1
…
- name: Launch Instance to Frankfurt av 2
ec2:
group: elsg
instance_type: "{{ instance_type}}"
image: ami-7cc4f661
wait: true
region: eu-central-1
keypair: "{{ keypair }}"
vpc_subnet_id: subnet-id2
count: "2"
register: ec2
with_items: ec2_instances_fav2
remote_user: centos
gather_facts: True
sudo: false
ansible-playbook -i inventories/local/local
el-aws_create-instance.yml
---
- name: ensure pip is installed for curator
yum: name=python-pip state=installed enablerepo=epel
tags:
- curator
sudo: true
- stat: path=/opt/jre-8u45-linux-x64.rpm
register: jre_exists
tags:
- jre
- name: Install Elasticsearch Curator and required dependencies.
pip: "name={{ item }}"
with_items:
- elasticsearch-curator
- argparse
tags:
- curator
sudo: true
- name: download Oracle Java JRE Runtime
command: 'wget -q -O /opt/jre-8u45-linux-x64.rpm --no-cookies --no-check-certificate —header
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"
"http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jre-8u45-linux-x64.rpm"'
when: jre_exists.stat.exists == False
- name: install Oracle Java JRE Runtime
yum: name="/opt/jre-8u45-linux-x64.rpm" state=present
tags:
- jre
Set up ES cluster(1/4)
- stat: path=/opt/elasticsearch-1.5.1.noarch.rpm
register: el_exists
tags:
- elinstall
- name: download Elasticsearch
command: 'wget -q -O /opt/elasticsearch-1.5.1.noarch.rpm https://download.elastic.co/elasticsearch/elasticsearch/
elasticsearch-1.5.1.noarch.rpm'
when: el_exists.stat.exists == False
- name: install Elasticsearch
yum: name="/opt/elasticsearch-1.5.1.noarch.rpm" state=present
tags:
- elinstall
- name: install plugins
command: "{{ item }} chdir=/usr/share/elasticsearch/bin/"
with_items:
- ./plugin -install elasticsearch/elasticsearch-cloud-aws/2.5.1
- ./plugin -install royrusso/elasticsearch-HQ
ignore_errors: true
tags:
- plugin
Set up ES cluster(2/4)
-
name: copy conf to mem limit unlimited
copy: src=99-elastic-nproc.conf dest=/etc/security/limits.d/99-elastic-nproc.conf owner=root mode=0640
tags:
- ulimit
sudo: true
-
name: sysctl configs
sysctl: name=vm.swappiness value=0 state=present
tags:
- sysctl
sudo: true
-
name: sysctl configs
sysctl: name=vm.max_map_count=262144 value=0 state=present
tags:
- sysctl
sudo: true
-
name: sysctl configs
sysctl: name=fs.file-max value=64000 state=present
tags:
- sysctl
sudo: true
-
name: disable swap
command: swapoff -a
tags:
- swap
sudo: true
Set up ES cluster(3/4)
-
name: set up elasticsearch.yaml
template: src=elasticsearch.j2 dest=/etc/elasticsearch/elasticsearch.yml owner=root mode=0644 backup=yes
tags:
- elconf
-
name: ensure exists log directory and data directory
file: path={{ item }} state=directory owner=elasticsearch
with_items:
- /var/data/elasticsearch
- /var/log/elasticsearch
tags:
- directory
sudo: true
-
name: start elastic
service: name=elasticsearch state=restarted enabled=yes
-
name: copy json accounts
copy: src=accounts.json dest=/home/centos owner=centos mode=0640
tags:
- accounts
sudo: true
Set up ES cluster(4/4)
Ansible provides a special plugin to nd the running
instances inside your EC2 account…
it’s called dynamic inventory
ansible-playbook -i inventories/dynamic/ec2.py
el-aws_deploy-instance.yml
./ec2.py —list
"eu-central-1b": [
“5*.2*.8*.4*”,
“5*.2*.3*.9*”,
“5*.2*.4*.3*”
],
Insert some data
let’s try to insert a sample bank dataset, here a small part of it:
{
"account_number": 0,
"balance": 16623,
"firstname": "Bradshaw",
"lastname": "Mckenzie",
"age": 29,
"gender": "F",
"address": "244 Columbus Place",
"employer": "Euron",
"email": "bradshawmckenzie@euron.com",
"city": "Hobucken",
"state": “CO"
}
curl -XPOST 'localhost:9200/bank/account/
_bulk?pretty' --data-binary @accounts.json
Let’s see the output
Elastic HQ
What we have achieved?
• a mass production system without handy configuration
• a fully reproducible environment
• scalability
• availability
• exit staff proof
• fully documentated by the code
• reduced stress
……………………………………………………
state of the art
&
current workflow
I’m almost a DevOps
Current workflow
Assumptions:
dev environment = local environment
developers usingVagrant and Ansible to congure
their environment
deploys are via Idephix or rsync
dev asks to sysadmins to provision staging & prod
sysadmins add their roles
to production environment !!
roles repo is inside local network,
remote dev can’t obtain that roles
we haven’t a single source of code for
Ansible roles
we don’t share efforts on roles
Issues
we got rolling updates on all machines
though Ansible
on newer machines we have some
sysadmin roles like:
• distrib role
• security role
• s3 role
• vpn role
but we haven’t any application oriented
roles like webserver role or php role on
stag/prod
easiest workflow
sysadmin will provision staging and
production using same roles that dev use
•developers deploy app code
•syasadmin deploy roles
2nd workflow
developers also deploy the infrastructural code
Can Idephix be also a
provisioner ??
Resources
http://www.ansible.com/home
https://docs.ansible.com/playbooks_vault.html
https://puppetlabs.com/
http://docs.puppetlabs.com/hiera/1/
https://www.elastic.co/
https://github.com/elastic/elasticsearch-cloud-aws
https://github.com/ansible/ansible/blob/devel/plugins/inventory/ec2.py
http://pavelpolyakov.com/2014/08/14/elasticsearch-cluster-on-aws-
part-2-conguring-the-elasticsearch/
https://github.com/royrusso/elasticsearch-HQ
http://getidephix.com/
Questions???

Weitere ähnliche Inhalte

Was ist angesagt?

Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0Phil Sturgeon
 
Everything as Code with Terraform
Everything as Code with TerraformEverything as Code with Terraform
Everything as Code with TerraformMitchell Pronschinske
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkMichael Peacock
 
New in php 7
New in php 7New in php 7
New in php 7Vic Metcalfe
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkShahar Evron
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony TechniquesKris Wallsmith
 
AnsibleFest 2014 - Role Tips and Tricks
AnsibleFest 2014 - Role Tips and TricksAnsibleFest 2014 - Role Tips and Tricks
AnsibleFest 2014 - Role Tips and Tricksjimi-c
 
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014Amazon Web Services
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteBram Vogelaar
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stackBram Vogelaar
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaJon Moore
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUNCong Zhang
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyondjimi-c
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherMichele Orselli
 
PofEAA and SQLAlchemy
PofEAA and SQLAlchemyPofEAA and SQLAlchemy
PofEAA and SQLAlchemyInada Naoki
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupGreg DeKoenigsberg
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Kris Wallsmith
 

Was ist angesagt? (20)

Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 
Everything as Code with Terraform
Everything as Code with TerraformEverything as Code with Terraform
Everything as Code with Terraform
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
 
New in php 7
New in php 7New in php 7
New in php 7
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
AnsibleFest 2014 - Role Tips and Tricks
AnsibleFest 2014 - Role Tips and TricksAnsibleFest 2014 - Role Tips and Tricks
AnsibleFest 2014 - Role Tips and Tricks
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stack
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and Lua
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to another
 
PofEAA and SQLAlchemy
PofEAA and SQLAlchemyPofEAA and SQLAlchemy
PofEAA and SQLAlchemy
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
 

Ähnlich wie Ansible inside

Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and ContainersRodolfo Carvalho
 
Configuration Management and Provisioning Are Different
Configuration Management and Provisioning Are DifferentConfiguration Management and Provisioning Are Different
Configuration Management and Provisioning Are DifferentCarlos Nunez
 
Julien Simon "Scaling ML from 0 to millions of users"
Julien Simon "Scaling ML from 0 to millions of users"Julien Simon "Scaling ML from 0 to millions of users"
Julien Simon "Scaling ML from 0 to millions of users"Fwdays
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestrationPaolo Tonin
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
Automating aws infrastructure and code deployments using Ansible @WebEngage
Automating aws infrastructure and code deployments using Ansible @WebEngageAutomating aws infrastructure and code deployments using Ansible @WebEngage
Automating aws infrastructure and code deployments using Ansible @WebEngageVishal Uderani
 
Ufo Ship for AWS ECS
Ufo Ship for AWS ECSUfo Ship for AWS ECS
Ufo Ship for AWS ECSTung Nguyen
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of AnsibleDevOps Ltd.
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcachedSkills Matter
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetAchieve Internet
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpresoke4qqq
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Prajal Kulkarni
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as CodeAllan Shone
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with ociDonghuKIM2
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Simon McCartney
 
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019Provectus
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStackPuppet
 

Ähnlich wie Ansible inside (20)

Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
Configuration Management and Provisioning Are Different
Configuration Management and Provisioning Are DifferentConfiguration Management and Provisioning Are Different
Configuration Management and Provisioning Are Different
 
Julien Simon "Scaling ML from 0 to millions of users"
Julien Simon "Scaling ML from 0 to millions of users"Julien Simon "Scaling ML from 0 to millions of users"
Julien Simon "Scaling ML from 0 to millions of users"
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestration
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Automating aws infrastructure and code deployments using Ansible @WebEngage
Automating aws infrastructure and code deployments using Ansible @WebEngageAutomating aws infrastructure and code deployments using Ansible @WebEngage
Automating aws infrastructure and code deployments using Ansible @WebEngage
 
Ufo Ship for AWS ECS
Ufo Ship for AWS ECSUfo Ship for AWS ECS
Ufo Ship for AWS ECS
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcached
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as Code
 
Ansible
AnsibleAnsible
Ansible
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with oci
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013
 
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 

Mehr von Ideato

serverless, a next level for devops
serverless, a next level for devopsserverless, a next level for devops
serverless, a next level for devopsIdeato
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudIdeato
 
Jenkins with superpowers
Jenkins with superpowersJenkins with superpowers
Jenkins with superpowersIdeato
 
Ansible pill09wp
Ansible pill09wpAnsible pill09wp
Ansible pill09wpIdeato
 
Elk devops
Elk devopsElk devops
Elk devopsIdeato
 
TogetherJS
TogetherJS TogetherJS
TogetherJS Ideato
 

Mehr von Ideato (6)

serverless, a next level for devops
serverless, a next level for devopsserverless, a next level for devops
serverless, a next level for devops
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in Cloud
 
Jenkins with superpowers
Jenkins with superpowersJenkins with superpowers
Jenkins with superpowers
 
Ansible pill09wp
Ansible pill09wpAnsible pill09wp
Ansible pill09wp
 
Elk devops
Elk devopsElk devops
Elk devops
 
TogetherJS
TogetherJS TogetherJS
TogetherJS
 

KĂźrzlich hochgeladen

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂşjo
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

KĂźrzlich hochgeladen (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Ansible inside

  • 1. ANSIBLE INSIDE IDEATO Alessandro Mazzoli Sysadmin@Ideato am@ideato.it @alendmazz
  • 2. WHY ANSIBLE we will consider some facts: ideato’s scenario dev needs sysadm needs
  • 3. IDEATO SCENARIO focus on great software development and good practices 
 50+VM’s to provision, congure and maintain, no need a high level of orchestration
  • 4. DEV NEEDS • easy CM tool to setup their environments • time spent to debug CM tool error is waste
  • 5. SYSADM NEEDS • painless rolling updates
 • going to mass production environments
  • 6. VS
  • 9. YAML vs RubyDSL i don’t want learn Ruby or other DSL… - name: set up user user: name=alemazz shell=/bin/bash password={{ password}} user{"$user": managehome=>true, ensure => present, } file{"/home/$user": ensure=>directory, mode=>755, require=>User["$user"], } file{"/home/$user/.ssh": ensure=>directory, require=>File["/home/$user"], }
  • 11. Node specic information template Jinja + ansible vars + ansible vault add a yaml le on host_vars/ or group_vars for example: — aws_access_key: AKIA aws_secret_key: ngxiw and encrypt to AES: ansible-vault encrypt aws.yaml
  • 12. Agentless only SSH/SFTP/SCP are required no central server scalability no need to update minions or puppet over your infrastructure
  • 13. Inconsistency • Ruby & PE • Puppetforge modules • Puppet skip everything based on dep what just failed • Rspec needed
  • 14.
  • 15. TOWARD MASS PRODUCTION SYSTEM DEMO: ELASTICSEARCH CLUSTER ON AWS USING ANSIBLE
  • 16. our demo will be on AWS multi AZ……
  • 17. Why Elasticsearch is t for CM management tools like Ansible? Lot of sys adm conguration tips for a cluster environment • java settings( jmx, mlockall….) • sysctl settings( swappiness, max_map,count..) • ulimit settings
 Do I have to change these settings by hand repeated for n° instance times? NOTHANKS!
  • 18. As a mention before Ansible has a plenty of sysadm modules:
 - name: firewalld applying conf firewalld: service=elasticsearch permanent=true zone=public state=enabled tags: - firewall
 - name: sysctl configs sysctl: name=fs.file-max value=64000 state=present tags: - sysctl
  • 19. Here’ s come AWS AWS provides a special plugin for discovery your ES instances inside your cluster just by their security group! discovery.type: ec2 discovery.zen.ping.multicast.enabled: false discovery.ec2.groups: my_security_group I don’t have to update the other node -1 congurations if i need to replace or add a new node!!
  • 20.
  • 21. Create our instances-- - hosts: localhost connection: local vars_files: - host_vars/el.yml vars: security_group: elsg instance_type: t2.medium image: ami-7cc4f661 region: eu-central-1 keypair: example.pem n_instances: "1" tasks: - name: Launch Instance to Frankfurt av 1 ec2: group: elsg instance_type: "{{ instance_type }}" image: ami-7cc4f661 wait: true region: eu-central-1 keypair: "{{ keypair }}" vpc_subnet_id: subnet-id count: "1" register: ec2 with_items: ec2_instances_fav1
  • 22. … - name: Launch Instance to Frankfurt av 2 ec2: group: elsg instance_type: "{{ instance_type}}" image: ami-7cc4f661 wait: true region: eu-central-1 keypair: "{{ keypair }}" vpc_subnet_id: subnet-id2 count: "2" register: ec2 with_items: ec2_instances_fav2 remote_user: centos gather_facts: True sudo: false ansible-playbook -i inventories/local/local el-aws_create-instance.yml
  • 23. --- - name: ensure pip is installed for curator yum: name=python-pip state=installed enablerepo=epel tags: - curator sudo: true - stat: path=/opt/jre-8u45-linux-x64.rpm register: jre_exists tags: - jre - name: Install Elasticsearch Curator and required dependencies. pip: "name={{ item }}" with_items: - elasticsearch-curator - argparse tags: - curator sudo: true - name: download Oracle Java JRE Runtime command: 'wget -q -O /opt/jre-8u45-linux-x64.rpm --no-cookies --no-check-certificate —header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jre-8u45-linux-x64.rpm"' when: jre_exists.stat.exists == False - name: install Oracle Java JRE Runtime yum: name="/opt/jre-8u45-linux-x64.rpm" state=present tags: - jre Set up ES cluster(1/4)
  • 24. - stat: path=/opt/elasticsearch-1.5.1.noarch.rpm register: el_exists tags: - elinstall - name: download Elasticsearch command: 'wget -q -O /opt/elasticsearch-1.5.1.noarch.rpm https://download.elastic.co/elasticsearch/elasticsearch/ elasticsearch-1.5.1.noarch.rpm' when: el_exists.stat.exists == False - name: install Elasticsearch yum: name="/opt/elasticsearch-1.5.1.noarch.rpm" state=present tags: - elinstall - name: install plugins command: "{{ item }} chdir=/usr/share/elasticsearch/bin/" with_items: - ./plugin -install elasticsearch/elasticsearch-cloud-aws/2.5.1 - ./plugin -install royrusso/elasticsearch-HQ ignore_errors: true tags: - plugin Set up ES cluster(2/4)
  • 25. - name: copy conf to mem limit unlimited copy: src=99-elastic-nproc.conf dest=/etc/security/limits.d/99-elastic-nproc.conf owner=root mode=0640 tags: - ulimit sudo: true - name: sysctl configs sysctl: name=vm.swappiness value=0 state=present tags: - sysctl sudo: true - name: sysctl configs sysctl: name=vm.max_map_count=262144 value=0 state=present tags: - sysctl sudo: true - name: sysctl configs sysctl: name=fs.file-max value=64000 state=present tags: - sysctl sudo: true - name: disable swap command: swapoff -a tags: - swap sudo: true Set up ES cluster(3/4)
  • 26. - name: set up elasticsearch.yaml template: src=elasticsearch.j2 dest=/etc/elasticsearch/elasticsearch.yml owner=root mode=0644 backup=yes tags: - elconf - name: ensure exists log directory and data directory file: path={{ item }} state=directory owner=elasticsearch with_items: - /var/data/elasticsearch - /var/log/elasticsearch tags: - directory sudo: true - name: start elastic service: name=elasticsearch state=restarted enabled=yes - name: copy json accounts copy: src=accounts.json dest=/home/centos owner=centos mode=0640 tags: - accounts sudo: true Set up ES cluster(4/4)
  • 27. Ansible provides a special plugin to nd the running instances inside your EC2 account… it’s called dynamic inventory ansible-playbook -i inventories/dynamic/ec2.py el-aws_deploy-instance.yml ./ec2.py —list "eu-central-1b": [ “5*.2*.8*.4*”, “5*.2*.3*.9*”, “5*.2*.4*.3*” ],
  • 28. Insert some data let’s try to insert a sample bank dataset, here a small part of it: { "account_number": 0, "balance": 16623, "firstname": "Bradshaw", "lastname": "Mckenzie", "age": 29, "gender": "F", "address": "244 Columbus Place", "employer": "Euron", "email": "bradshawmckenzie@euron.com", "city": "Hobucken", "state": “CO" } curl -XPOST 'localhost:9200/bank/account/ _bulk?pretty' --data-binary @accounts.json
  • 31. What we have achieved? • a mass production system without handy conguration • a fully reproducible environment • scalability • availability • exit staff proof • fully documentated by the code • reduced stress ……………………………………………………
  • 32.
  • 33. state of the art & current workflow
  • 35. Current workflow Assumptions: dev environment = local environment developers usingVagrant and Ansible to congure their environment deploys are via Idephix or rsync dev asks to sysadmins to provision staging & prod
  • 36. sysadmins add their roles to production environment !!
  • 37. roles repo is inside local network, remote dev can’t obtain that roles we haven’t a single source of code for Ansible roles we don’t share efforts on roles Issues
  • 38. we got rolling updates on all machines though Ansible on newer machines we have some sysadmin roles like: • distrib role • security role • s3 role • vpn role but we haven’t any application oriented roles like webserver role or php role on stag/prod
  • 39. easiest workflow sysadmin will provision staging and production using same roles that dev use •developers deploy app code •syasadmin deploy roles
  • 40. 2nd workflow developers also deploy the infrastructural code
  • 41. Can Idephix be also a provisioner ??