SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Michal Haták
AUTOMATION FOR EVERYONE
Michal Haták
• INIZIO Internet Media
• Python / PHP / JS / AWS
• @Twistacz
• github.com/Twista
Automation
• Minimize or reduce human intervention
• Faster
• Less error prone
• Reproducible
Shell scripts ?
• Hard to write
• Hard to maintain
• Error prone
Ansible ?
• Configuration Management
• Application Deployment
• Multi-Tier Orchestration
Why Ansible ?
• Agent-less (just SSH)
• Easy
• YAML - no coding required
• Modules
Concept
• Inventories
• Modules
• Plays and Playbooks
• Tasks
• Facts and Variables
• Templates
• Roles
# inventory.ini
[webserver]
wpweekend ansible_host=10.88.88.10
[localws]
local ansible_connection=local
Inventory - list of machines / groups
The super-power of Modules
Cloud

Clustering

Commands

Database

Files

Inventory

Messaging

Monitoring
Network

Notification

Packaging

Source Control

System

Utilities

Web Infrastructure

Windows
# main.yml
- name: task name
module_name:
param_name_1 = param_value_1
- name: task 2 name
module_name: param1 = val1 param2 = val2
Playbooks and Plays
# main.yml
- name: download and extract WordPress
unarchive:
src=http://wordpress.org/wordpress-{{ wp_version }}.tar.gz
dest={{ target_directory }}
copy=no
creates={{ target_directory }}/wordpress
Playbooks and Plays
# main.yml
- name: create WordPress database
mysql_db: name={{ wp_db_name }} state=present
- name: create WordPress database user
mysql_user:
name={{ wp_db_user }}
password={{ wp_db_password }}
priv={{ wp_db_name }}.*:ALL
host='localhost'
state=present
Playbooks and Plays
- name: change SSH port
hosts: aws_launched
tasks:
- name: SSH port in configuration is 12345
replace:
dest=/etc/ssh/sshd_config
regexp='^Port 22$'
replace='Port 12345'
backup=yes
become: True
tags: ssh
- name: SSH service restarted
service: name=ssh state=restarted
become: True
tags: ssh
Playbooks and Plays
- name: bower package
npm: state=present global=yes name=bower
- name: bower packages
bower: path={{ install_dir }}/app/static
sudo: no
tags: deploy
Playbooks and Plays
- name: git installed
apt: state=present name=git
- name: clone destination exists
file: state=directory path={{ install_directory }}
- name: repository is at given tag/commit or latest master
git: repo={{ repository_url }}.git
dest={{ install_directory }}
version={{ version }}
tags: deploy
Playbooks and Plays
- name: system packages present
apt: state=present name={{ item }}
with_items:
- python-dev
- python-pip
- python-lxml
Playbooks and Plays
Facts and Variables
• Work with machine data (hostname, ip, OS, devices)
• Custom variables to re-use roles and playbooks
# group_vars/all
target_directory: /tmp/wpweekend
wp_version: 4.5.2
# These are the WordPress database settings
wp_db_name: wordpress
wp_db_user: wordpress
wp_db_password: secret
Facts and Variables
# templates/wp-config.php.j2
<?php
define('DB_NAME', '{{ wp_db_name }}');
define('DB_USER', '{{ wp_db_user }}');
define('DB_PASSWORD', '{{ wp_db_password }}');
...
{{ wp_salt.stdout }}
....
Templates
.
└── my-role
├── README.md
├── defaults
│   └── main.yml
├── files
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── tasks
│   └── main.yml
├── templates
├── tests
│   ├── inventory
│   └── test.yml
└── vars
└── main.yml
Roles
Demo
Links
• docs.ansible.com
• https://medium.com/@Twistacz
• http://www.root.cz/serialy/konfiguracni-a-orchestracni-nastroj-
ansible/
Thanks!
Questions ?

Weitere ähnliche Inhalte

Was ist angesagt?

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 CloudWesley Beary
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?shirou wakayama
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to AnsibleCédric Delgehier
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Žilvinas Kuusas
 
What's new in Ansible 2.0
What's new in Ansible 2.0What's new in Ansible 2.0
What's new in Ansible 2.0Allan Denot
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with TerraformMario IC
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Idan Tohami
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricksbcoca
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them AllTim Fairweather
 
Ansible basics workshop
Ansible basics workshopAnsible basics workshop
Ansible basics workshopDavid Karban
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practicesBas Meijer
 
Advance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul IntiAdvance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul IntiSahil Davawala
 
Automating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSAutomating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSChris Brown
 
Managing Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with AnsibleManaging Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with Ansiblefmaccioni
 
docker build with Ansible
docker build with Ansibledocker build with Ansible
docker build with AnsibleBas Meijer
 

Was ist angesagt? (20)

ansible why ?
ansible why ?ansible why ?
ansible why ?
 
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
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
 
What's new in Ansible 2.0
What's new in Ansible 2.0What's new in Ansible 2.0
What's new in Ansible 2.0
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
 
Ansible basics workshop
Ansible basics workshopAnsible basics workshop
Ansible basics workshop
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
Advance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul IntiAdvance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul Inti
 
Automating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSAutomating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWS
 
Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)
 
Managing Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with AnsibleManaging Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with Ansible
 
docker build with Ansible
docker build with Ansibledocker build with Ansible
docker build with Ansible
 
Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3
 

Andere mochten auch

Validating XML - Avoiding the pain
Validating XML - Avoiding the painValidating XML - Avoiding the pain
Validating XML - Avoiding the painTobias Schlitt
 
Debugování s XDebug
Debugování s XDebugDebugování s XDebug
Debugování s XDebugTaste Medio
 
Profiling PHP Applications
Profiling PHP ApplicationsProfiling PHP Applications
Profiling PHP ApplicationsMichal Haták
 
What makes a good developer from a management perspective
What makes a good developer from a management perspectiveWhat makes a good developer from a management perspective
What makes a good developer from a management perspectiveBrnoPHP
 
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...Péhápkaři
 
Čtvrtkon #44 - Symfony php framework
Čtvrtkon #44 - Symfony php frameworkČtvrtkon #44 - Symfony php framework
Čtvrtkon #44 - Symfony php frameworkMartin Zeman
 
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS clustercommit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS clusterJakub Kulhan
 
Symfony vs Nette vs Phalcon
Symfony vs Nette vs PhalconSymfony vs Nette vs Phalcon
Symfony vs Nette vs PhalconVojta Svoboda
 
Microservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflowMicroservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflowJakub Nesetril
 
Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)
Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)
Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)Martin Zeman
 
FTP deployment Devel 2015
FTP deployment Devel 2015FTP deployment Devel 2015
FTP deployment Devel 2015David Grudl
 
A Beginners Guide to noSQL
A Beginners Guide to noSQLA Beginners Guide to noSQL
A Beginners Guide to noSQLMike Crabb
 
Dealing with Enterprise Level Data
Dealing with Enterprise Level DataDealing with Enterprise Level Data
Dealing with Enterprise Level DataMike Crabb
 

Andere mochten auch (13)

Validating XML - Avoiding the pain
Validating XML - Avoiding the painValidating XML - Avoiding the pain
Validating XML - Avoiding the pain
 
Debugování s XDebug
Debugování s XDebugDebugování s XDebug
Debugování s XDebug
 
Profiling PHP Applications
Profiling PHP ApplicationsProfiling PHP Applications
Profiling PHP Applications
 
What makes a good developer from a management perspective
What makes a good developer from a management perspectiveWhat makes a good developer from a management perspective
What makes a good developer from a management perspective
 
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...
Martin Froněk - Jak využít soft skills ve svůj prospěch 2 (15. sraz přátel PH...
 
Čtvrtkon #44 - Symfony php framework
Čtvrtkon #44 - Symfony php frameworkČtvrtkon #44 - Symfony php framework
Čtvrtkon #44 - Symfony php framework
 
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS clustercommit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
commit => #GitHub => #CircleCI => #Docker => #Kubernetes #AWS cluster
 
Symfony vs Nette vs Phalcon
Symfony vs Nette vs PhalconSymfony vs Nette vs Phalcon
Symfony vs Nette vs Phalcon
 
Microservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflowMicroservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflow
 
Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)
Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)
Moje první aplikace v Symfony 3 + překvapení (4. sraz přátel Symfony v Praze)
 
FTP deployment Devel 2015
FTP deployment Devel 2015FTP deployment Devel 2015
FTP deployment Devel 2015
 
A Beginners Guide to noSQL
A Beginners Guide to noSQLA Beginners Guide to noSQL
A Beginners Guide to noSQL
 
Dealing with Enterprise Level Data
Dealing with Enterprise Level DataDealing with Enterprise Level Data
Dealing with Enterprise Level Data
 

Ähnlich wie Ansible

A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of AnsibleDevOps Ltd.
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestrationPaolo Tonin
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as CodeAllan Shone
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Ilya Haykinson
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operationsgrim_radical
 
Ansible at work
Ansible at workAnsible at work
Ansible at workBas Meijer
 
Cloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the CloudCloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the Cloudpetriojala123
 
Get-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for EvilGet-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for Eviljaredhaight
 
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are BadFunctional Hostnames and Why they are Bad
Functional Hostnames and Why they are BadPuppet
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with PuppetAlessandro Franceschi
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk GötzNETWAYS
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasaggarrett honeycutt
 
Learning Puppet basic thing
Learning Puppet basic thing Learning Puppet basic thing
Learning Puppet basic thing DaeHyung Lee
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeSarah Z
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop AutomationRui Lapa
 

Ähnlich wie Ansible (20)

A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestration
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as Code
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operations
 
Ansible at work
Ansible at workAnsible at work
Ansible at work
 
Cloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the CloudCloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the Cloud
 
Get-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for EvilGet-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for Evil
 
Automation day red hat ansible
   Automation day red hat ansible    Automation day red hat ansible
Automation day red hat ansible
 
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are BadFunctional Hostnames and Why they are Bad
Functional Hostnames and Why they are Bad
 
Puppet
PuppetPuppet
Puppet
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
Learning Puppet basic thing
Learning Puppet basic thing Learning Puppet basic thing
Learning Puppet basic thing
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop Automation
 

Kürzlich hochgeladen

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Ansible

  • 2. Michal Haták • INIZIO Internet Media • Python / PHP / JS / AWS • @Twistacz • github.com/Twista
  • 3. Automation • Minimize or reduce human intervention • Faster • Less error prone • Reproducible
  • 4. Shell scripts ? • Hard to write • Hard to maintain • Error prone
  • 5. Ansible ? • Configuration Management • Application Deployment • Multi-Tier Orchestration
  • 6. Why Ansible ? • Agent-less (just SSH) • Easy • YAML - no coding required • Modules
  • 7. Concept • Inventories • Modules • Plays and Playbooks • Tasks • Facts and Variables • Templates • Roles
  • 8. # inventory.ini [webserver] wpweekend ansible_host=10.88.88.10 [localws] local ansible_connection=local Inventory - list of machines / groups
  • 9. The super-power of Modules Cloud
 Clustering
 Commands
 Database
 Files
 Inventory
 Messaging
 Monitoring Network
 Notification
 Packaging
 Source Control
 System
 Utilities
 Web Infrastructure
 Windows
  • 10. # main.yml - name: task name module_name: param_name_1 = param_value_1 - name: task 2 name module_name: param1 = val1 param2 = val2 Playbooks and Plays
  • 11. # main.yml - name: download and extract WordPress unarchive: src=http://wordpress.org/wordpress-{{ wp_version }}.tar.gz dest={{ target_directory }} copy=no creates={{ target_directory }}/wordpress Playbooks and Plays
  • 12. # main.yml - name: create WordPress database mysql_db: name={{ wp_db_name }} state=present - name: create WordPress database user mysql_user: name={{ wp_db_user }} password={{ wp_db_password }} priv={{ wp_db_name }}.*:ALL host='localhost' state=present Playbooks and Plays
  • 13. - name: change SSH port hosts: aws_launched tasks: - name: SSH port in configuration is 12345 replace: dest=/etc/ssh/sshd_config regexp='^Port 22$' replace='Port 12345' backup=yes become: True tags: ssh - name: SSH service restarted service: name=ssh state=restarted become: True tags: ssh Playbooks and Plays
  • 14. - name: bower package npm: state=present global=yes name=bower - name: bower packages bower: path={{ install_dir }}/app/static sudo: no tags: deploy Playbooks and Plays
  • 15. - name: git installed apt: state=present name=git - name: clone destination exists file: state=directory path={{ install_directory }} - name: repository is at given tag/commit or latest master git: repo={{ repository_url }}.git dest={{ install_directory }} version={{ version }} tags: deploy Playbooks and Plays
  • 16. - name: system packages present apt: state=present name={{ item }} with_items: - python-dev - python-pip - python-lxml Playbooks and Plays
  • 17. Facts and Variables • Work with machine data (hostname, ip, OS, devices) • Custom variables to re-use roles and playbooks
  • 18. # group_vars/all target_directory: /tmp/wpweekend wp_version: 4.5.2 # These are the WordPress database settings wp_db_name: wordpress wp_db_user: wordpress wp_db_password: secret Facts and Variables
  • 19. # templates/wp-config.php.j2 <?php define('DB_NAME', '{{ wp_db_name }}'); define('DB_USER', '{{ wp_db_user }}'); define('DB_PASSWORD', '{{ wp_db_password }}'); ... {{ wp_salt.stdout }} .... Templates
  • 20. . └── my-role ├── README.md ├── defaults │   └── main.yml ├── files ├── handlers │   └── main.yml ├── meta │   └── main.yml ├── tasks │   └── main.yml ├── templates ├── tests │   ├── inventory │   └── test.yml └── vars └── main.yml Roles
  • 21. Demo
  • 22. Links • docs.ansible.com • https://medium.com/@Twistacz • http://www.root.cz/serialy/konfiguracni-a-orchestracni-nastroj- ansible/