Automate DBA tasks with Ansible describes using Ansible to automate database administration tasks. The document discusses installing and configuring Ansible, using modules to execute tasks, organizing tasks into playbooks and roles, and using templates. It provides an example of using Ansible to install an Oracle 11g database including creating directories, templating a response file, running the installer, and applying patches with a custom Oracle patching module.
DATABASE AUTOMATION with Thousands of database, monitoring and backupSaewoong Lee
This is my presentation document at AnsibleFest 2018 in Austin, Texas.
This topic is ‘Database Automation with thousands of database, monitoring and backup’.
In this document I want to tell you database automation using Ansible.
So I expect to give more confidence to infra engineer like me.
The presentation covers improvements made to the redo logs in MySQL 8.0 and their impact on the MySQL performance and Operations. This covers the MySQL version still MySQL 8.0.30.
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...Severalnines
This presentation by Krzysztof Książek at Percona Live 2017 in Santa Clara, California gives detailed descriptions and comparisons of the leading open source database load balancing technologies
DATABASE AUTOMATION with Thousands of database, monitoring and backupSaewoong Lee
This is my presentation document at AnsibleFest 2018 in Austin, Texas.
This topic is ‘Database Automation with thousands of database, monitoring and backup’.
In this document I want to tell you database automation using Ansible.
So I expect to give more confidence to infra engineer like me.
The presentation covers improvements made to the redo logs in MySQL 8.0 and their impact on the MySQL performance and Operations. This covers the MySQL version still MySQL 8.0.30.
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...Severalnines
This presentation by Krzysztof Książek at Percona Live 2017 in Santa Clara, California gives detailed descriptions and comparisons of the leading open source database load balancing technologies
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
MySQL InnoDB Cluster is a very easy HA solution to deploy. However it's also a very customizable solution able to respond to most needs. During this session I will give an overview of settings that you may tune like those related to quorum lost, level of consistency, but also some you may not know like how to change recovery system, effect of increasing the event horizon. We will also discus about maintenance operations like how to stream large transactions, how to deal with DDL in multi-primary environments...
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesMarkus Michalewicz
This presentation discusses operational best practices considering the increasing tendency to use automation to tackle repetitive tasks, which changes how best practices are applied. The presentation therefore introduces and explains which Oracle tools can and should be used to apply best practices. It also discusses "smart features" that one will benefit from automatically after upgrading to Oracle RAC 12c Rel. 2. This presentation was first presented during UKOUG Tech17.
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11Kenny Gryp
Oracle's MySQL solutions make it easy to setup various database architectures and achieve high availability with the introduction MySQL InnoDB Cluster and MySQL InnoDB ReplicaSet meeting various high availability requirements. MySQL InnoDB ClusterSet provides a popular disaster recovery solution.
Completely built in-house and supported by Oracle, many enterprises large and small have adopted these solutions into business critical applications.
In this presentation the various database architecture solutions for high availability and disaster recovery will be covered and help you choose the right solutions based on your business requirements.
->Introduction
->>What is Ansible?
->>Ansible history
->Basic concepts
->>Inventory
->>Playbook
->>Role
->>Module
->>Plugin
->Diving into Ansible roles
->>Getting started
->>Create a role
->>Roles under the hood
->>How to use roles?
How Netflix Tunes EC2 Instances for PerformanceBrendan Gregg
CMP325 talk for AWS re:Invent 2017, by Brendan Gregg. "
At Netflix we make the best use of AWS EC2 instance types and features to create a high performance cloud, achieving near bare metal speed for our workloads. This session will summarize the configuration, tuning, and activities for delivering the fastest possible EC2 instances, and will help other EC2 users improve performance, reduce latency outliers, and make better use of EC2 features. We'll show how we choose EC2 instance types, how we choose between EC2 Xen modes: HVM, PV, and PVHVM, and the importance of EC2 features such SR-IOV for bare-metal performance. SR-IOV is used by EC2 enhanced networking, and recently for the new i3 instance type for enhanced disk performance as well. We'll also cover kernel tuning and observability tools, from basic to advanced. Advanced performance analysis includes the use of Java and Node.js flame graphs, and the new EC2 Performance Monitoring Counter (PMC) feature released this year."
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
As proxies (and database routers) go, the first one I ever used was the now deprecated MySQL Proxy. Since then, I've managed to use MariaDB MaxScale quite a bit (including its fork AirBnB MaxScale), played around with ProxySQL in recent time, and also started taking a look at MySQL Router. In this quick 20-minute overview, we'll discuss why these three exist, a feature comparison, and reasons when to use the right tool for the job.
An inroduction to Terraform, a tool that helps you deploy and change your infrastructure as code. Given at Rencontres Mondiales du Logiciel libre (RMLL) 2017
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...ScaleGrid.io
Compare top PostgreSQL high availability frameworks - PostgreSQL Automatic Failover (PAF), Replication Manager (repmgr) and Patroni to improve your app uptime. ScaleGrid blog - https://scalegrid.io/blog/whats-the-best-postgresql-high-availability-framework-paf-vs-repmgr-vs-patroni-infographic/
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...Athens Big Data
Title: MLOps Workshop: The Full ML Lifecycle - How to Use ML in Production
Speakers: Spyros Cavadias (https://www.linkedin.com/in/spyros-cavadias/), Konstantinos Pittas (https://www.linkedin.com/in/konstantinos-pittas-83310270/), Thanos Gkinakos (https://www.linkedin.com/in/thanos-gkinakos-03582a128/)
Date: Saturday, December 17, 2022
Event: https://www.meetup.com/athens-big-data/events/289927468/
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
MySQL InnoDB Cluster is a very easy HA solution to deploy. However it's also a very customizable solution able to respond to most needs. During this session I will give an overview of settings that you may tune like those related to quorum lost, level of consistency, but also some you may not know like how to change recovery system, effect of increasing the event horizon. We will also discus about maintenance operations like how to stream large transactions, how to deal with DDL in multi-primary environments...
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesMarkus Michalewicz
This presentation discusses operational best practices considering the increasing tendency to use automation to tackle repetitive tasks, which changes how best practices are applied. The presentation therefore introduces and explains which Oracle tools can and should be used to apply best practices. It also discusses "smart features" that one will benefit from automatically after upgrading to Oracle RAC 12c Rel. 2. This presentation was first presented during UKOUG Tech17.
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11Kenny Gryp
Oracle's MySQL solutions make it easy to setup various database architectures and achieve high availability with the introduction MySQL InnoDB Cluster and MySQL InnoDB ReplicaSet meeting various high availability requirements. MySQL InnoDB ClusterSet provides a popular disaster recovery solution.
Completely built in-house and supported by Oracle, many enterprises large and small have adopted these solutions into business critical applications.
In this presentation the various database architecture solutions for high availability and disaster recovery will be covered and help you choose the right solutions based on your business requirements.
->Introduction
->>What is Ansible?
->>Ansible history
->Basic concepts
->>Inventory
->>Playbook
->>Role
->>Module
->>Plugin
->Diving into Ansible roles
->>Getting started
->>Create a role
->>Roles under the hood
->>How to use roles?
How Netflix Tunes EC2 Instances for PerformanceBrendan Gregg
CMP325 talk for AWS re:Invent 2017, by Brendan Gregg. "
At Netflix we make the best use of AWS EC2 instance types and features to create a high performance cloud, achieving near bare metal speed for our workloads. This session will summarize the configuration, tuning, and activities for delivering the fastest possible EC2 instances, and will help other EC2 users improve performance, reduce latency outliers, and make better use of EC2 features. We'll show how we choose EC2 instance types, how we choose between EC2 Xen modes: HVM, PV, and PVHVM, and the importance of EC2 features such SR-IOV for bare-metal performance. SR-IOV is used by EC2 enhanced networking, and recently for the new i3 instance type for enhanced disk performance as well. We'll also cover kernel tuning and observability tools, from basic to advanced. Advanced performance analysis includes the use of Java and Node.js flame graphs, and the new EC2 Performance Monitoring Counter (PMC) feature released this year."
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
As proxies (and database routers) go, the first one I ever used was the now deprecated MySQL Proxy. Since then, I've managed to use MariaDB MaxScale quite a bit (including its fork AirBnB MaxScale), played around with ProxySQL in recent time, and also started taking a look at MySQL Router. In this quick 20-minute overview, we'll discuss why these three exist, a feature comparison, and reasons when to use the right tool for the job.
An inroduction to Terraform, a tool that helps you deploy and change your infrastructure as code. Given at Rencontres Mondiales du Logiciel libre (RMLL) 2017
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...ScaleGrid.io
Compare top PostgreSQL high availability frameworks - PostgreSQL Automatic Failover (PAF), Replication Manager (repmgr) and Patroni to improve your app uptime. ScaleGrid blog - https://scalegrid.io/blog/whats-the-best-postgresql-high-availability-framework-paf-vs-repmgr-vs-patroni-infographic/
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...Athens Big Data
Title: MLOps Workshop: The Full ML Lifecycle - How to Use ML in Production
Speakers: Spyros Cavadias (https://www.linkedin.com/in/spyros-cavadias/), Konstantinos Pittas (https://www.linkedin.com/in/konstantinos-pittas-83310270/), Thanos Gkinakos (https://www.linkedin.com/in/thanos-gkinakos-03582a128/)
Date: Saturday, December 17, 2022
Event: https://www.meetup.com/athens-big-data/events/289927468/
Nathan Vonnahme's presentation on writing custom plugins for Nagios.
The presentation was given during the Nagios World Conference North America held Sept 25-28th, 2012 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/nwcna
Leveraging Docker for Hadoop build automation and Big Data stack provisioningDataWorks Summit
Apache Bigtop as an open source Hadoop distribution, focuses on developing packaging, testing and deployment solutions that help infrastructure engineers to build up their own customized big data platform as easy as possible. However, packages deployed in production require a solid CI testing framework to ensure its quality. Numbers of Hadoop component must be ensured to work perfectly together as well. In this presentation, we'll talk about how Bigtop deliver its containerized CI framework which can be directly replicated by Bigtop users. The core revolution here are the newly developed Docker Provisioner that leveraged Docker for Hadoop deployment and Docker Sandbox for developer to quickly start a big data stack. The content of this talk includes the containerized CI framework, technical detail of Docker Provisioner and Docker Sandbox, a hierarchy of docker images we designed, and several components we developed such as Bigtop Toolchain to achieve build automation.
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti
PyCon Ireland - Python DevOps flows with Ansible, Packer & Kubernetes - Mihai Criveti
https://www.youtube.com/watch?v=lO884XAdddQ
1 Packer: Image Build Automation
2 OpenSCAP: Automate Security Baselines
3 Ansible: Provisioning and Configuration Management
4 Molecule: Test your Ansible Playbooks on Docker, Vagrant or Cloud
5 Vagrant: Test images with vagrant
6 Package Python Applications with setuptools
7 Kubernetes: Container Orchestration at Scale
8 DevOps Culture and Practice
Lean Drupal Repositories with Composer and DrushPantheon
Composer is the industry-standard PHP dependency manager that is now in use in Drupal 8 core. This session will show the current best practices for using Composer, drupal-composer, drupal-scaffold, Drush, Drupal Console and Drush site-local aliases to streamline your Drupal 7 and Drupal 8 site repositories for optimal use on teams.
A bit of history, frustration-driven development, and why and how we started looking into Puppet at Opera Software. What we're doing, successes, pain points and what we're going to do with Puppet and Config Management next.
OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...NETWAYS
I gave a talk titled "Continuous Integration in data centers“ at OSDC in 2013, presenting ways how to realize continuous integration/delivery with Jenkins and related tools.Three years later we gained new tools in our continuous delivery pipeline, including Docker, Gerrit and Goss. Over the years we also had to deal with different problems caused by faster release cycles, a growing team and gaining new projects. We therefore established code review in our pipeline, improved our test infrastructure and invested in our infrastructure automation.In this talk I will discuss the lessons we learned over the last years, demonstrate how a proper continuous delivery pipeline can improve your life and how open source tools like Jenkins, Docker and Gerrit can be leveraged for setting up such an environment.
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko Fwdays
In this presentation, I will recount the challenges my team and I faced over the past year and how we overcame obstacles and achieved our goals.
Even for greenfield projects, our journey had its share of surprises. Despite living in 2023, we still encountered common problems that many think are long-solved. I'll delve into topics such as defining DNS zones across multiple environments, dealing with ineffective build artifacts from mature development teams, GitHub Actions for CI/CD, versioning, cost optimization, and the potential pitfalls of adopting GitOps in combination with a "reuse as much as possible" mentality.
So, join me as we explore the trade-offs and lessons learned from these real-world scenarios. With this presentation, you'll gain valuable insights to help you navigate similar challenges quickly and confidently.
Have you ever wondered how search works while visiting an e-commerce site, internal website, or searching through other types of online resources? Look no further than this informative session on the ways that taxonomies help end-users navigate the internet! Hear from taxonomists and other information professionals who have first-hand experience creating and working with taxonomies that aid in navigation, search, and discovery across a range of disciplines.
This presentation, created by Syed Faiz ul Hassan, explores the profound influence of media on public perception and behavior. It delves into the evolution of media from oral traditions to modern digital and social media platforms. Key topics include the role of media in information propagation, socialization, crisis awareness, globalization, and education. The presentation also examines media influence through agenda setting, propaganda, and manipulative techniques used by advertisers and marketers. Furthermore, it highlights the impact of surveillance enabled by media technologies on personal behavior and preferences. Through this comprehensive overview, the presentation aims to shed light on how media shapes collective consciousness and public opinion.
This presentation by Morris Kleiner (University of Minnesota), was made during the discussion “Competition and Regulation in Professions and Occupations” held at the Working Party No. 2 on Competition and Regulation on 10 June 2024. More papers and presentations on the topic can be found out at oe.cd/crps.
This presentation was uploaded with the author’s consent.
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Orkestra
UIIN Conference, Madrid, 27-29 May 2024
James Wilson, Orkestra and Deusto Business School
Emily Wise, Lund University
Madeline Smith, The Glasgow School of Art
0x01 - Newton's Third Law: Static vs. Dynamic AbusersOWASP Beja
f you offer a service on the web, odds are that someone will abuse it. Be it an API, a SaaS, a PaaS, or even a static website, someone somewhere will try to figure out a way to use it to their own needs. In this talk we'll compare measures that are effective against static attackers and how to battle a dynamic attacker who adapts to your counter-measures.
About the Speaker
===============
Diogo Sousa, Engineering Manager @ Canonical
An opinionated individual with an interest in cryptography and its intersection with secure software development.
Acorn Recovery: Restore IT infra within minutesIP ServerOne
Introducing Acorn Recovery as a Service, a simple, fast, and secure managed disaster recovery (DRaaS) by IP ServerOne. A DR solution that helps restore your IT infra within minutes.
5. ABOUT PYTHIAN
Pythian’s 400+ IT professionals
help companies adopt and
manage disruptive technologies
to better compete
(c) The Pythian Group Inc., 2017 5
6. TECHNICAL EXPERTISE
(c) The Pythian Group Inc., 2017 6
Infrastructure: Transforming and
managing the IT infrastructure
that supports the business
DevOps: Providing critical velocity
in software deployment by adopting
DevOps practices
Cloud: Using the disruptive
nature of cloud for accelerated,
cost-effective growth
Databases: Ensuring databases
are reliable, secure, available and
continuously optimized
Big Data: Harnessing the transformative
power of data on a massive scale
Advanced Analytics: Mining data for
insights & business transformation
using data science
9. ansible engine
• Open - source automation engine
• Owned by RedHat
▪ Available for Red Hat Enterprise Linux, CentOS, Debian, Ubuntu, OEL …
▪ Windows support - only as a target machine
• Written in Python
• Agentless architecture
• Git repository: https://github.com/ansible/ansible
(c) The Pythian Group Inc., 2017 9
10. ansible consist of …
architecture
• Inventory configuration
• Modules
• Playbooks
• Roles
(c) The Pythian Group Inc., 2017 10
11. ansible architecture
architecture
• Two types of servers: controlling machines and nodes (targets)
• Targets are managed by a controlling machine over SSH, WINRM
(c) The Pythian Group Inc., 2017 11
control machine
web servers
database servers
orchestrates (SSH, WINRM) no agents
12. ansible installation
• RPMs for Enterprise Linux 6, 7 are available from yum via EPEL
http://fedoraproject.org/wiki/EPEL
• Add EPEL on OEL7, RHEL7 or CentOS
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install epel-release-latest-7.noarch.rpm
• Install Ansible
yum install ansible
(c) The Pythian Group Inc., 2017 12
13. ansible installation
OSX
• Installation is done via pip
• Install Xcode
• Install pip and ansible
sudo easy_install pip
pip install ansible
• For more information see:
http://docs.ansible.com/ansible/intro_installation.html#latest-release-via-yum
(c) The Pythian Group Inc., 2017 13
14. ansible configuration files
• Ansible configuration file: /etc/ansible/ansible.cfg
• Define the hosts in a ‘hosts’ file, by default in /etc/ansible/hosts
List all defined hosts: ansible all --list-hosts
(c) The Pythian Group Inc., 2017 14
...
db8.example.org
[webservers]
app1.example.org
app2.example.org
[dbservers]
db1.example.org ansible_host=... ansible_port=... ansible_ssh_private_key_file=... ansible_user=...
db2.example.org
15. ansible – windows support
• Control machine requires pywinrm, a Python module for the Windows Remote
Management (WinRM)
(c) The Pythian Group Inc., 2017 15
Option Local Accounts Active Directory Accounts Credential Delegation
Basic Yes No No
Certificate Yes No No
Kerberos No Yes Yes
NTLM Yes Yes No
CredSSP Yes Yes Yes
16. ansible – windows support
example configuration with kerberos
• Kerberos configuration file /etc/krb5.conf
(c) The Pythian Group Inc., 2017 16
...
[realms]
WINGROUP.AD = {
kdc = win-hrms-srv.WINGROUP.AD
admin_server = win-hrms-srv.WINGROUP.AD
default_domain = WINGROUP.AD
}
[domain_realm]
.wingroup.ad = WINGROUP.AD
wingroup.ad = WINGROUP.AD
17. ansible – windows support
‘hosts’ file
• Inventory/hosts
(c) The Pythian Group Inc., 2017 17
...
[windows]
win-hrms-srv.wingroup.ad
[windows:vars]
ansible_user = iarsov@WINGROUP.AD
ansible_password = ********
ansible_connection = winrm
ansible_port = 5986
ansible_winrm_server_cert_validation =ignore
19. modules
• Library plugins , always are executed on target machine
• Ansible comes with large number of modules
• Each module supports specific number of arguments
(c) The Pythian Group Inc., 2017 19
ansible vm12r1 -m copy -a "src=/tmp/file.txt dest=/tmp/file.txt"
SSH password:
vm12r1 | SUCCESS => {
"changed": true,
"checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"dest": "/tmp/file.txt",
"gid": 500,
"group": "dba",
...
}
target module argumentargument
20. custom modules
developing modules
• First check if similar module already exist
• http://docs.ansible.com/ansible/latest/list_of_all_modules.html
• GitHub (all module updates): https://github.com/ansible/ansible/labels/module
• Not enough documentation regarding development
• If you want additional checks on control machine use action_plugins
(c) The Pythian Group Inc., 2017 20
21. • Test module date.py code
(c) The Pythian Group Inc., 2017 21
developing modules
our first custom module
#!/usr/bin/python
import datetime
import json
date = str(datetime.datetime.now())
print(json.dumps({
"time" : date
}))
ansible ansible-demo --module-path=/home/ansible -m date
ansible-demo | SUCCESS => {
"changed": false,
"time": "2017-08-31 14:48:10.978621”
}
22. ansible execution
• The modules are copied and executed on target machines
• Destination can be controlled with local_tmp in ansible.cfg
Execution steps:
1. Create local temporary directory: $HOME/.ansible/tmp/ansible-tmp-xxx/ansiballz_cache
2. Copy module
3. Execute module
4. Return result in JSON format
5. Clear (remove) ansible-tmp-xxx/ansiballz_cache
(c) The Pythian Group Inc., 2017 22
23. ad-hoc task execution
• The “ping” example
• Ad-hoc tasks are run with ansible command
• Ansible uses SSH authentication, you need to specify an user
(c) The Pythian Group Inc., 2017 23
ansible vm12r1 -m ping -u root -k
SSH password:
vm12r1 | SUCCESS => {
"changed": false,
"ping": "pong"
}
target module user
25. YAML basic rules
YAML Ain't Markup Language
• Human readable data structure
• Less complex than JSON or XML
• YAML is case sensitive
• Does not allow tabs. You must use spaces.
YAML XML
(c) The Pythian Group Inc., 2017 25
db_list:
- oracle_owner: oracle
oracle_home: /u01/app...
sid: orcl
...
<db_list>
<oracle_owner>oracle</oracle_owner>
<oracle_home>/u01/app...</oracle_home>
<sid>orcl</sid>
...
</db_list>
26. • Organize the “play” tasks
• Playbook’s language is YAML
• Each play contains set of tasks
• Tasks are executed one at a time in order
against all matched targets
• Command ansible-playbook
Play example:
playbook.yml
- hosts: dbservers
user: root
tasks:
- name: ping hostname
ping:
- name: create directory
file: path=/home/ansible/bgoug2017 state=directory
playbooks
(c) The Pythian Group Inc., 2017 26
27. - hosts: dbservers
user: root
tasks:
- name: ping hostname
ping:
- hosts: webservers
user: root
tasks:
- name: create directory
file: path=/home/ansible/bgoug2017 state=directory
• Playbooks can contain multiple plays
• Split tasks performed per different host groups
playbooks
(c) The Pythian Group Inc., 2017 27
28. Variables file definition (var_def.yml)
Playbook file definition
- hosts: “{{ hostname }}“
user: “{{ user }}“
vars_files:
- var_def.yml
tasks:
- name: create directory
file: path={{ dir_path }} state=directory
using variables
variables
(c) The Pythian Group Inc., 2017 28
hostname: ansible-demo
dir_path: /home/ansible/bgoug2017
user: root
• Variables are used using the Jinja2
templating system
• You can also use variables in Templates
• Variables are referenced with double
curly brackets: {{ variable_name }}
29. variables
(c) The Pythian Group Inc., 2017 29
- hosts: “{{ hostname }}“
user: “{{ user }}“
tasks:
- name: create directory
file: path={{ dir_path }} state=directory
vars:
- hostname: ansible-demo
user: root
dir_path: /home/ansible/bgoug2017
• Variables can be defined within the playbook
30. variables
(c) The Pythian Group Inc., 2017 30
ansible-playbook demo2.yml -k --extra-vars="dir_path=/home/ansible/bgoug2017 user=root
hostname=ansible-demo“
SSH password:
PLAY [ansible-demo]
***************************************************************************************
ok: [ansible-demo]
TASK [create directory]
***************************************************************************************
ok: [ansible-demo]
PLAY RECAP
***************************************************************************************
ansible-demo : ok=2 changed=0 unreachable=0 failed=0
• Variables can also be defined from command line
31. ansible – windows support
• Playbook wintest.yml
(c) The Pythian Group Inc., 2017 31
---
- name: Windows demo
hosts: windows
tasks:
- name: Create directory "D:ansiblebgoug2017"
win_command: Powershell.exe "mkdir D:ansiblebgoug2017"
33. roles
how to organize the tasks?
• Represent “automation” within ansible
• You can define variables for all roles or per role
• Not complex at all. No hidden magic.
• Supports automatic load of main.yml file for tasks, handlers, variables, meta
definitions and role “default” variables
(c) The Pythian Group Inc., 2017 33
35. role dependencies
• Role dependencies are defined in meta/main.yml file
• Allows you to reference other roles before running a role
(c) The Pythian Group Inc., 2017 35
---
dependencies:
- { role: common }
...
dbswinstall.yml
roles/
common/
dbinstall/
files/
meta/
main.yml
tasks/
...
36. Templates
Introduction to ansible templating
• Sometimes pre-defined configuration files are needed for installation
• An example is the Oracle dbca configuration file
• Templating allows ansible variables substitution within templates
(c) The Pythian Group Inc., 2017 36
37. Templates
...
#-------------------------------------------------------------------------------
# Specify the hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames
# and network interfaces)
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME={{ ansible_hostname }}
#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME={{ oracle_group }}
...
(c) The Pythian Group Inc., 2017 37
38. Templates
• Source template file is copied to target destination and variables are substituted
(c) The Pythian Group Inc., 2017 38
- name: create 11g installer response file
template:
src: db_11204.rsp.j2
dest: /tmp/db_11204.rsp
owner: "{{ oracle_user }}"
group: "{{ oracle_group }}"
mode: 0640
43. oracle database install
installation of oracle 11.2.0.4 software
- name: install base software
command: "{{ swlib_path }}/11204/installer/database/runInstaller -silent
-ignorePrereq -ignoreSysPrereqs -waitforcompletion -responseFile
/tmp/db_11204.rsp"
register: install_db_software
args:
creates: "{{ oracle_home }}"
failed_when: "'skipped' not in install_db_software.stdout and
'Successfully Setup Software.' not in install_db_software.stdout“
(c) The Pythian Group Inc., 2017 43
44. oracle database install
installation of oracle 11.2.0.4 software
- name: run root-script orainstRoot.sh
command: "{{ oracle_base }}/../oraInventory/orainstRoot.sh"
when: "'skipped' not in install_db_software.stdout"
become: true
become_user: root
become_method: sudo
(c) The Pythian Group Inc., 2017 44
45. oracle database install
installation of oracle 11.2.0.4 software
- name: run root-script root.sh from ORACLE_HOME
command: "{{ oracle_home }}/root.sh"
when: "'skipped' not in install_db_software.stdout"
become: true
become_user: root
become_method: sudo
- name: clean up installer response file
file:
path: /tmp/db_11204.rsp
state: absent
(c) The Pythian Group Inc., 2017 45
46. orapatch
custom module
• Can be used to apply PSU on 10g, 11g and 12c
• Written in Python (~1500 lines of code)
In summary:
• You need to specify:
• oracle home path, PSU or DBBP patch ID, whether to patch only the oracle home
binaries, all databases or specific set of databases
• It will automatically:
• stop OH services, apply PSU or DBBP according specified settings, start back the
services as before the patching
(c) The Pythian Group Inc., 2017 46
47. always executed
orapatch
workflow
(c) The Pythian Group Inc., 2017 47
Check OPatch
minimum version
Check conflicts
against OH
Patch OH
Patch DB
Patch OH OJVM
Patch DB OJVM
End logger
session
Fetch orapatch
logfile
Start logger
session
Push SQL
scripts
48. - name: Patch oracle software
serial: 1
vars_prompt:
- name: "root_password"
prompt: "Enter root password (press enter to skip)"
private: yes
- name: "root_password_confirm"
prompt: "Enter root password again (press enter to skip)"
private: yes
pre_tasks:
- assert:
that: root_password == root_password_confirm
msg: "Root password missmatch."
hosts: database
user: oracle
roles:
- orapatch
(c) The Pythian Group Inc., 2017 48
49. orapatch
vars/main.yml
db_list:
- oracle_owner: oracle
oracle_home_path: /oracle/app/oracle/product/12.2.0.1/db1
patch_directory: "12.1.0.2/psu"
run_only_checks: False
patch: True
patch_id: 26129945
patch_only_oh: True
patch_ojvm: False
patch_db_all: False
patch_db_list: "orcl" patch specific databases
patch all databases for specified OH
apply OJVM PSU
patch only oracle specified oracle home
run only prerequisite checks
oracle home to patch
directory where patch binaries are located
(c) The Pythian Group Inc., 2017 49
57. ansible blog posts
• AUTOMATINC ORACLE RMAN BACKUP CONFIGURATION ON LINUX WITH ANSIBLE
https://www.pythian.com/blog/automating-oracle-rman-backup-configuration-linux-ansible
• CREATING ANSIBLE CUSTOM MODULE FOR AWR REPORT GENERATION
https://www.pythian.com/blog/creating-ansible-custom-module-for-awr-reports-generation
• SIMPLE STEPS TO PERFORM OPATCH MAINTENANCE WITH ANSIBLE
https://www.pythian.com/blog/opatch-maintenance-with-ansible
• ANSIBLE AND AWS AUTOMATION
https://www.pythian.com/blog/ansible-and-aws-automation
More at: https://www.pythian.com/blog/?s=ansible
(c) The Pythian Group Inc., 2017 57