SlideShare a Scribd company logo
What's new in Ansible 2.0
Allan Denot
∙ 2 year experience with Ansible
∙ 3 years experience with AWS
∙ Senior DevOps Engineer at Odecee
∙ Co-founder of spikenode.com
@denot allandenot.com
Allan Denot @denot allandenot.com
∙ Brazilian
∙ 5 years in Australia
New in Ansible 2.0
What’s New
Refactoring
● Improved variable management
● Better use of OOP
● Internal APIs
Many new modules
Language features
Release Date
September 8th:
Testing v2
git clone https://github.com/ansible/ansible.git
cd ansible
. v2/hacking/env-setup
Strategies
- hosts: all
gather_facts: no
strategy: free
tasks:
- pause: seconds={{ 10 |random}}
- debug: msg="msg_1"
- pause: seconds={{ 10 |random}}
- debug: msg="msg_2"
- pause: seconds={{ 10 |random}}
- debug: msg="msg_3"
Execution Strategies
Example playbook:
Execution Strategies
strategy: linear (default)
TASK [debug msg=msg_1]
**********************************************************
ok: [host3] => { "msg": "msg_1", "changed": false}
ok: [host4] => { "msg": "msg_1", "changed": false}
ok: [host2] => { "msg": "msg_1", "changed": false}
ok: [host1] => { "msg": "msg_1", "changed": false}
TASK [debug msg=msg_2]
**********************************************************
ok: [host4] => {"msg": "msg_2", "changed": false}
ok: [host1] => {"msg": "msg_2", "changed": false}
ok: [host2] => {"msg": "msg_2", "changed": false}
ok: [host3] => {"msg": "msg_2", "changed": false}
TASK [debug msg=msg_3]
**********************************************************
ok: [host1] => {"msg": "msg_3", "changed": false}
ok: [host2] => {"msg": "msg_3", "changed": false}
ok: [host3] => {"msg": "msg_3", "changed": false}
ok: [host4] => {"msg": "msg_3", "changed": false}
PLAY [<no name specified>]
******************************************************
ok: [host3] => {"msg": "msg_1", "changed": false}
ok: [host4] => {"msg": "msg_1", "changed": false}
ok: [host2] => {"msg": "msg_1", "changed": false}
ok: [host4] => {"msg": "msg_2", "changed": false}
ok: [host2] => {"msg": "msg_2", "changed": false}
ok: [host4] => {"msg": "msg_3", "changed": false}
ok: [host1] => {"msg": "msg_1", "changed": false}
ok: [host2] => {"msg": "msg_3", "changed": false}
ok: [host3] => {"msg": "msg_2", "changed": false}
ok: [host3] => {"msg": "msg_3", "changed": false}
ok: [host1] => {"msg": "msg_2", "changed": false}
ok: [host1] => {"msg": "msg_3", "changed": false}
strategy: free
Blocks
tasks:
- yum: name={{ item }} state=installed
with_items:
- httpd
- memcached
when: ansible_distribution == 'CentOS'
become: true
become_user: root
- template: src=templates/src.j2 dest=/etc/foo.conf
when: ansible_distribution == 'CentOS'
become: true
become_user: root
- service: name=bar state=started enabled=True
when: ansible_distribution == 'CentOS'
become: true
become_user: root
Blocks
Until 1.9:
REPETITIONREPETITIONREPETITIONREPETITIONREPETITION
tasks:
- block:
- yum: name={{ item }} state=installed
with_items:
- httpd
- memcached
- template: src=templates/src.j2 dest=/etc/foo.conf
- service: name=bar state=started enabled=True
when: ansible_distribution == 'CentOS'
become: true
become_user: root
Blocks
2.0:
tasks:
- block:
- name: Shell script to connect the app to a monitoring service.
script: monitoring-connect.sh
rescue:
- name: This will only run in case of an error in the block.
debug: msg="There was an error in the block."
always:
- name: This will always run, no matter what.
debug: msg="This always executes."
Blocks for Error Handling
2.0:
Modules
Modules
Notorious additions
package - generic OS package manager
- name: install the latest version of ntpdate
package: name=ntpdate state=latest
# This uses a variable as this changes per distro.
- name: remove the apache package
package : name={{apache}} state=absent
expect - executes a command and responds to prompt
- expect:
command: passwd username
responses:
(?i)password: "MySekretPa$$word
find - return a list of files based on criteria
# Recursively find /tmp files older than 4 weeks and equal or greater than 1 megabyte
- find: paths="/tmp" age="4w" size="1m" recurse=yes
# Recursively find /var/tmp files with last access time greater than 3600 seconds
- find: paths="/var/tmp" age="3600" age_stamp=atime recurse=yes
# find /var/log files equal or greater than 10 megabytes ending with .log or .log.gz
- find: paths="/var/tmp" patterns="*.log","*.log.gz" size="10m"
Modules
EC2
iam
ec2_win_password
ec2_ami_find
ec2_ami_copy
ec2_vpc_subnet
ec2_vpc_igw
ecs_task
ecs_cluster
ecs_taskdefinition
ec2_elb_facts
s3_logging
s3_bucket
s3_lifecycle
dynamodb_table
route53_zone
route53_health_check
IAM
EC2 windows
EC2 AMI
VPC
ECS
ELB
S3
DYNAMODB
ROUTE53
Compatibility
Playbooks
Playbooks should be 100% compatible,
no changes required.
Using 2.0 modules TODAY
1 Go to https://github.com/ansible/ansible-modules-core/
Using 2.0 modules TODAY
2 Browse to the module
3
Using 2.0 modules TODAY
4 Save the module file (or copy/paste)
Using 2.0 modules TODAY
5 Save under: library/cloud/amazon/iam2.py
6 Use it normally: tasks:
- name: Create two new IAM users with API keys
iam2:
iam_type: user
name: "{{ item }}"
state: present
password: "{{ temp_pass }}"
access_key_state: create
with_items:
- jcleese
- mpython
And finally...
There’s a good chance that Tower will be open sourced…
Questions?
Links
github.com/adenot
allandenot.com
spikenode.com

More Related Content

What's hot

Odoo Performance Limits
Odoo Performance LimitsOdoo Performance Limits
Odoo Performance Limits
Odoo
 
Big data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands OnBig data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands On
hkbhadraa
 
Cyansible
CyansibleCyansible
Cyansible
Alan Norton
 
Kube-AWS
Kube-AWSKube-AWS
Kube-AWS
CoreOS
 
The Puppet Master on the JVM - PuppetConf 2014
The Puppet Master on the JVM - PuppetConf 2014The Puppet Master on the JVM - PuppetConf 2014
The Puppet Master on the JVM - PuppetConf 2014
Puppet
 
Kubernetes DNS Horror Stories
Kubernetes DNS Horror StoriesKubernetes DNS Horror Stories
Kubernetes DNS Horror Stories
Laurent Bernaille
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
Diacode
 
VPC by Default時代のアクセス制御
VPC by Default時代のアクセス制御VPC by Default時代のアクセス制御
VPC by Default時代のアクセス制御
真吾 吉田
 
Making the most out of kubernetes audit logs
Making the most out of kubernetes audit logsMaking the most out of kubernetes audit logs
Making the most out of kubernetes audit logs
Laurent Bernaille
 
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the CloudAWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
Sharma Podila
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
SV Ruby on Rails Meetup
 
Building Docker images with Puppet
Building Docker images with PuppetBuilding Docker images with Puppet
Building Docker images with Puppet
Nick Jones
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Puppet
 
An Introduction to Kube-Lego
An Introduction to Kube-LegoAn Introduction to Kube-Lego
An Introduction to Kube-Lego
Matthew Barker
 
Evolution of kube-proxy (Brussels, Fosdem 2020)
Evolution of kube-proxy (Brussels, Fosdem 2020)Evolution of kube-proxy (Brussels, Fosdem 2020)
Evolution of kube-proxy (Brussels, Fosdem 2020)
Laurent Bernaille
 
Self Created Load Balancer for MTA on AWS
Self Created Load Balancer for MTA on AWSSelf Created Load Balancer for MTA on AWS
Self Created Load Balancer for MTA on AWSsharu1204
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
rmcleay
 
Kubernetes 1.3 - Highlights
Kubernetes 1.3 - HighlightsKubernetes 1.3 - Highlights
Kubernetes 1.3 - Highlights
Matthew Barker
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverAltitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Fastly
 
Paris Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with KafkaParis Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with Kafka
Florian Hussonnois
 

What's hot (20)

Odoo Performance Limits
Odoo Performance LimitsOdoo Performance Limits
Odoo Performance Limits
 
Big data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands OnBig data lambda architecture - Streaming Layer Hands On
Big data lambda architecture - Streaming Layer Hands On
 
Cyansible
CyansibleCyansible
Cyansible
 
Kube-AWS
Kube-AWSKube-AWS
Kube-AWS
 
The Puppet Master on the JVM - PuppetConf 2014
The Puppet Master on the JVM - PuppetConf 2014The Puppet Master on the JVM - PuppetConf 2014
The Puppet Master on the JVM - PuppetConf 2014
 
Kubernetes DNS Horror Stories
Kubernetes DNS Horror StoriesKubernetes DNS Horror Stories
Kubernetes DNS Horror Stories
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
VPC by Default時代のアクセス制御
VPC by Default時代のアクセス制御VPC by Default時代のアクセス制御
VPC by Default時代のアクセス制御
 
Making the most out of kubernetes audit logs
Making the most out of kubernetes audit logsMaking the most out of kubernetes audit logs
Making the most out of kubernetes audit logs
 
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the CloudAWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
 
Building Docker images with Puppet
Building Docker images with PuppetBuilding Docker images with Puppet
Building Docker images with Puppet
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
 
An Introduction to Kube-Lego
An Introduction to Kube-LegoAn Introduction to Kube-Lego
An Introduction to Kube-Lego
 
Evolution of kube-proxy (Brussels, Fosdem 2020)
Evolution of kube-proxy (Brussels, Fosdem 2020)Evolution of kube-proxy (Brussels, Fosdem 2020)
Evolution of kube-proxy (Brussels, Fosdem 2020)
 
Self Created Load Balancer for MTA on AWS
Self Created Load Balancer for MTA on AWSSelf Created Load Balancer for MTA on AWS
Self Created Load Balancer for MTA on AWS
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
 
Kubernetes 1.3 - Highlights
Kubernetes 1.3 - HighlightsKubernetes 1.3 - Highlights
Kubernetes 1.3 - Highlights
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverAltitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
 
Paris Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with KafkaParis Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with Kafka
 

Similar to What's new in Ansible 2.0

Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for Dummies
Łukasz Proszek
 
Learning Puppet basic thing
Learning Puppet basic thing Learning Puppet basic thing
Learning Puppet basic thing
DaeHyung Lee
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with oci
DonghuKIM2
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
Wesley Beary
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
Dave Cross
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Wesley Beary
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REX
Saewoong Lee
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
Arie Bregman
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
Nikhil Mungel
 
os lab assignment.pdf
os lab assignment.pdfos lab assignment.pdf
os lab assignment.pdf
SadamunAhemedBiplob2
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
DevOps Ltd.
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language Parser
Yodalee
 
Puppet
PuppetPuppet
MariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructuresMariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructures
Federico Razzoli
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
Greg DeKoenigsberg
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
Alessandro Franceschi
 
Ansible fest Presentation slides
Ansible fest Presentation slidesAnsible fest Presentation slides
Ansible fest Presentation slides
Aaron Carey
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
Murali Boyapati
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
Workhorse Computing
 

Similar to What's new in Ansible 2.0 (20)

Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for Dummies
 
Learning Puppet basic thing
Learning Puppet basic thing Learning Puppet basic thing
Learning Puppet basic thing
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with oci
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REX
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
 
os lab assignment.pdf
os lab assignment.pdfos lab assignment.pdf
os lab assignment.pdf
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language Parser
 
Five
FiveFive
Five
 
Puppet
PuppetPuppet
Puppet
 
MariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructuresMariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructures
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Ansible fest Presentation slides
Ansible fest Presentation slidesAnsible fest Presentation slides
Ansible fest Presentation slides
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 

What's new in Ansible 2.0

  • 1. What's new in Ansible 2.0
  • 2. Allan Denot ∙ 2 year experience with Ansible ∙ 3 years experience with AWS ∙ Senior DevOps Engineer at Odecee ∙ Co-founder of spikenode.com @denot allandenot.com
  • 3. Allan Denot @denot allandenot.com ∙ Brazilian ∙ 5 years in Australia
  • 5. What’s New Refactoring ● Improved variable management ● Better use of OOP ● Internal APIs Many new modules Language features
  • 7. Testing v2 git clone https://github.com/ansible/ansible.git cd ansible . v2/hacking/env-setup
  • 9. - hosts: all gather_facts: no strategy: free tasks: - pause: seconds={{ 10 |random}} - debug: msg="msg_1" - pause: seconds={{ 10 |random}} - debug: msg="msg_2" - pause: seconds={{ 10 |random}} - debug: msg="msg_3" Execution Strategies Example playbook:
  • 10. Execution Strategies strategy: linear (default) TASK [debug msg=msg_1] ********************************************************** ok: [host3] => { "msg": "msg_1", "changed": false} ok: [host4] => { "msg": "msg_1", "changed": false} ok: [host2] => { "msg": "msg_1", "changed": false} ok: [host1] => { "msg": "msg_1", "changed": false} TASK [debug msg=msg_2] ********************************************************** ok: [host4] => {"msg": "msg_2", "changed": false} ok: [host1] => {"msg": "msg_2", "changed": false} ok: [host2] => {"msg": "msg_2", "changed": false} ok: [host3] => {"msg": "msg_2", "changed": false} TASK [debug msg=msg_3] ********************************************************** ok: [host1] => {"msg": "msg_3", "changed": false} ok: [host2] => {"msg": "msg_3", "changed": false} ok: [host3] => {"msg": "msg_3", "changed": false} ok: [host4] => {"msg": "msg_3", "changed": false} PLAY [<no name specified>] ****************************************************** ok: [host3] => {"msg": "msg_1", "changed": false} ok: [host4] => {"msg": "msg_1", "changed": false} ok: [host2] => {"msg": "msg_1", "changed": false} ok: [host4] => {"msg": "msg_2", "changed": false} ok: [host2] => {"msg": "msg_2", "changed": false} ok: [host4] => {"msg": "msg_3", "changed": false} ok: [host1] => {"msg": "msg_1", "changed": false} ok: [host2] => {"msg": "msg_3", "changed": false} ok: [host3] => {"msg": "msg_2", "changed": false} ok: [host3] => {"msg": "msg_3", "changed": false} ok: [host1] => {"msg": "msg_2", "changed": false} ok: [host1] => {"msg": "msg_3", "changed": false} strategy: free
  • 12. tasks: - yum: name={{ item }} state=installed with_items: - httpd - memcached when: ansible_distribution == 'CentOS' become: true become_user: root - template: src=templates/src.j2 dest=/etc/foo.conf when: ansible_distribution == 'CentOS' become: true become_user: root - service: name=bar state=started enabled=True when: ansible_distribution == 'CentOS' become: true become_user: root Blocks Until 1.9: REPETITIONREPETITIONREPETITIONREPETITIONREPETITION
  • 13. tasks: - block: - yum: name={{ item }} state=installed with_items: - httpd - memcached - template: src=templates/src.j2 dest=/etc/foo.conf - service: name=bar state=started enabled=True when: ansible_distribution == 'CentOS' become: true become_user: root Blocks 2.0:
  • 14. tasks: - block: - name: Shell script to connect the app to a monitoring service. script: monitoring-connect.sh rescue: - name: This will only run in case of an error in the block. debug: msg="There was an error in the block." always: - name: This will always run, no matter what. debug: msg="This always executes." Blocks for Error Handling 2.0:
  • 16. Modules Notorious additions package - generic OS package manager - name: install the latest version of ntpdate package: name=ntpdate state=latest # This uses a variable as this changes per distro. - name: remove the apache package package : name={{apache}} state=absent expect - executes a command and responds to prompt - expect: command: passwd username responses: (?i)password: "MySekretPa$$word find - return a list of files based on criteria # Recursively find /tmp files older than 4 weeks and equal or greater than 1 megabyte - find: paths="/tmp" age="4w" size="1m" recurse=yes # Recursively find /var/tmp files with last access time greater than 3600 seconds - find: paths="/var/tmp" age="3600" age_stamp=atime recurse=yes # find /var/log files equal or greater than 10 megabytes ending with .log or .log.gz - find: paths="/var/tmp" patterns="*.log","*.log.gz" size="10m"
  • 19. Playbooks Playbooks should be 100% compatible, no changes required.
  • 20. Using 2.0 modules TODAY 1 Go to https://github.com/ansible/ansible-modules-core/
  • 21. Using 2.0 modules TODAY 2 Browse to the module 3
  • 22. Using 2.0 modules TODAY 4 Save the module file (or copy/paste)
  • 23. Using 2.0 modules TODAY 5 Save under: library/cloud/amazon/iam2.py 6 Use it normally: tasks: - name: Create two new IAM users with API keys iam2: iam_type: user name: "{{ item }}" state: present password: "{{ temp_pass }}" access_key_state: create with_items: - jcleese - mpython
  • 25.
  • 26. There’s a good chance that Tower will be open sourced…