SlideShare a Scribd company logo
Devops for
databases
Osama Mustafa
About me
oFounder/CEO for Gurus Solutions
oLeader & Director for JAOUG
oOracle ACE Director
o6x of OCI, 4x AWS and 5x Azure
oAutomation Lover
oStart as DBA and still working on different Of Databases.
o Author of two books and working on my 3rd one.
oPresenter & Contributor in Oracle Community
oPublished articles in different magazines
oBlogger on osamaoracle.com
My Books
Agenda
Questions & Answers.
Automation Examples.
How DevOps will make DBA life Easier ?
Understand the DevOps ? What , Why , When
?
DevOps is a software development
method that stresses communication,
collaboration, integration, automation and
measurement of cooperation between
software developers and other IT
professionals.
DevOps is sometimes treated
as a concept, a philosophy, a
job role or a set of tools.
DevOps is not all about
automation, but it enables fast
feedback loops and encourages
a culture of collaboration
Evolution of DevOps
Dev Vs Ops
Why DevOps ?
1. Speed deployment processes
2. Enable fast response to changing business requirements
3. Reduce the risk of production changes causing outages
4. Break down silos
Is DevOps Agile ?
• When a task becomes (extremely) repetitive.
• The Task will take so much manual work.
• The task output either will be too much or less.
• Some other reason why to use DevOps :-
• Eliminate human interaction.
• Errors, things not able to work.
• Differences in paths
• Differences in settings
Why DevOps With Oracle -
Problem
• Terraform
• Ansible
• Jenkins
• Puppet
• Chef
• Salt
Oracle Using DevOps – Tools
Examples
Tools How it work Focusing
Terraform Agentless Admin Focused , IAAC
Ansible agentless Admin Focused , Configuration
Management
Jenkins Agentless Dev and can be work for admin
also, CI/CD
Puppet agent based Dev Focused
Chef agent based Dev Focused
Salt Agent, Agentless Admin Focused
How Ansible works ?
• Agentless:
Ansible doesn’t require agents to be installed on your target servers.
Instead, it connects through the secured SSH protocol to execute its tasks.
• Facts:
Facts are a set of variables that Ansible will collect on target hosts at run
time. Those variables are then usable within your scripts. Facts are almost
all information you may need from a target host like the IPs, NICs, Devices,
etc. You can even add your fact like the list of Oracle instance running with
their Oracle Home for example.
Two levels:
• You can use the so-called ad-hoc command line tool. This tool will permit
you with one command line to execute actions, like creating OS users, on
multiple servers.
• Then you may want to script a set of operations. For that purpose, you’ll
use Playbook. A playbook is a file contention your sequence of operations
in a YAML format.
• RHEL/CentOS Linux
• $ sudo yum install ansible
• Debian/Ubuntu Linux
• $ sudo apt-get install software-properties-common
• $ sudo apt-add-repository ppa:ansible/ansible
• $ sudo apt-get update
• $ sudo apt-get install ansible
• Install Ansible using pip
• $ sudo pip install ansible
• Github
• $ git clone git://github.com/ansible/ansible.git
• $ cd ./ansible
• $ source ./hacking/env-setup
Note : you need to have passwordless SSH connectivity from the Ansible host to the Oracle
servers
Install Ansible
• Automate a single task on one or more managed nodes. Ad-hoc commands are quick and easy,
but they are not reusable. So why learn about ad-hoc commands first? Ad-hoc commands
demonstrate the simplicity and power of Ansible.
• Ad-hoc commands are great for tasks you repeat rarely. For example, if you want to power off
all the machines in your lab for Christmas vacation, you could execute a quick one-liner in
Ansible without writing a playbook. An ad-hoc command looks like this:
• $ ansible [pattern] -m [module] -a "[module options]“
• Ad-hoc tasks can be used to reboot servers, copy files, manage packages and users, and much
more. You can use any Ansible module in an ad-hoc task
•
Ansible ad-Hoc command line tool
Ansible
Modules
Ansible ad-Hoc
command line
tool Use Cases
Rebooting servers
•I want to reboot all the servers in group called “WebServer” , I have 10 webserver.
•ansible Webserver -a "/sbin/reboot“Rebooting
Managing file
•SCP to transfer many files to multiple machines in parallel.
•ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts"Managing
Managing users and groups
•You can create, manage, and remove user accounts on your managed nodes with ad-hoc
tasks:
•ansible all -m user -a "name=foo password=<crypted password here>"
Managing
• Now that you can run ad-hoc commands, you may be interested in combining multiple
modules to perform more elaborate actions. Instead of putting all commands sequentially into
a bash script, Ansible provides the concept of playbook. A playbook is a YAML formatted file
in which you list the modules sequentially to be executed on a group of hosts. This is an
example:
Ansible PlayBook
Use Ansible to Install RDBMS 19c
Control Server
Ansible
Python
Managed Server
Server#1
Managed Server
Server#2
/etc/ansible/hosts
[Server#1]
192.168.1.1
[Server#2]
192.168.1.2
[dbservers]
192.168.1.1
192.168.1.2
oracle19c_rdbmsinstall.yml
- hosts: dbservers
user: root
roles: -
- dbsoftware19c_install
roles/dbsoftware19c_install/files/Software_installation.r
sp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbi
nstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION={{ oracle_inventory }}
ORACLE_HOME={{ oracle_home }}
ORACLE_BASE={{ oracle_base }}
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=oinstall
oracle.install.db.OSDGDBA_GROUP=oinstall
oracle.install.db.OSKMDBA_GROUP=oinstall
oracle.install.db.OSRACDBA_GROUP=dba
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES
• cd /etc/ansible
• ansible-playbook oracle19c_rdbmsinstall.yml
Error:
ansible
requires a
json
module,
none
found!
This means the python-simplejson rpm is not installed
In our case: to
add the install of
pythonsimplejson
to the playbook
•install python-simplejson rpm
Purpose: run
command without
the need for
python
Resolution: raw
module
Use Ansible to Upgrade
pre_upgrade.yml
Upgrade.yml
Final.ym
l
• Oracle Cloud Infrastructure Ansible Modules Collection Sample
• Compute
• Database
• Object Storage
• Launch a Compute Instance
• Set Up an Autonomous Database
• List Objects and Buckets
• Delete Objects
• OCI Ansible Modules
• Block Volume
• Compute
• Container Engine for Kubernetes
• Database
• File Storage
• IAM
• Load Balancing
Ansible Playbook for OCI
Launch
a Compute Instance
• generates a temporary host-specific
SSH key-pair
• specifies the public key from that
key-pair to connect to the instance
during instance launch and
• demonstrates how the newly
launched instance can be connected
to using SSH.
https://github.com/oracle/oci-ansible-
collection/tree/master/samples/compute/launch_compute_instance
• Set up an Autonomous Database with Autonomous Transaction
Processing.
• List all the Autonomous Transaction Processing instances available
in a compartment, filtered by display name.
• Get the "facts" for a specified database.
• Stop and start an Autonomous Database.
• Delete an Autonomous Database.
Set Up an Autonomous Database
https://github.com/oracle/oci-ansible-
collection/tree/master/samples/database/autonomous_database
Delete
Objects
https://github.com/oracle/oci-ansible-
collection/tree/master/samples/object_storage/delete_objects
Terraform
• Terraform is a tool for building, changing, and
versioning infrastructure safely and
efficiently. Terraform can manage existing and
popular service providers as well as custom in-
house solutions. Configuration files describe
to Terraform the components needed to run a
single application or your entire datacenter.
• Advantages of Terraform
1. Platform Agnostic
2. State Management
3. Operator Confidence
Install Terraform
• Terraform and integrated providers available for all major operating
environments:
• Linux (x86 & ARM)
• FreeBSD (x86 & ARM)
• OpenBSD (x86)
• Windows (x86)
• Mac OS X (x86)
• Solaris (x86)
• Installation
• Download the terraform binary for your OS
• Integrated providers automatically downloaded/installed when needed
• Non-integrated providers: manual download of the binary provider
needed
• Frequent updates advised
• Easy on Oracle Linux 7 (ol7_developer on public yum,
ol7_x86_64_developer on ULN)
• # yum install terraform (Installation)
• # yum upgrade terraform (Upgrade)
Terraform
Commands
• terraform init
• Before initial use or after upgrade
• terraform plan
• terraform apply
• terraform apply –-auto-approve
• terraform destroy
• terraform destroy -force
Terraform Variables
Variables must be defined in a .tf file
values can be assigned
during
definition with « default = »
Variables can be used anywhere in .tf files
Input variables from environment variables
(TF_VAR_name)
$ export TF_VAR_access_key="xxxxxxxx"
$ export TF_VAR_secret_key="xxxxxxxx"
Input variables from
command line
Input variables from one or more files
Default file name is terraform.tfvars
If not default name, just give the name(s) of
file(s)
Terraform Output
Outputs are optional but useful to display
relevant information
public IP randomly assigned (AWS, OCI, OCI-C)
Temporary password for Windows instances in OCI
Outputs are displayed at the end of « terraform
apply » or with « terraform output »
Terraform data-source
Useful to automatically get objects names or IDs
that are needed to create resources
Alternative is to hard-code names/IDs
Examples of data sources within OCI
Get the list of Availability Domains (name different in each
tenant)
Best Practice
• Putting all code in main.tf is a good idea when you are getting started or writing an example
code. In all other cases you will be better having several files split logically like this:
• main.tf - call modules, locals and data-sources to create all resources
• variables.tf - contains declarations of variables used in main.tf
• outputs.tf - contains outputs from the resources created in main.tf
• terraform.tfvars should not be used anywhere except composition.
Example – Single Web Server
main.tf terraform {
required_version = ">= 0.12"
}
# -------------------------------------------------------
# CONFIGURE OUR AWS CONNECTION
# -------------------------------------------------------
provider "aws" {
region = "us-east-2"
}
# ----------------------------
# DEPLOY A SINGLE EC2 INSTANCE
# ----------------------------
resource "aws_instance" "example" {
# Ubuntu Server 18.04 LTS (HVM), SSD Volume Type in
us-east-2
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
vpc_security_group_ids = [aws_security_group.instance.id]
user_data = <<-EOF
#!/bin/bash
echo "Hello, World" > index.html
nohup busybox httpd -f -p "${var.server_port}" &
EOF
tags = {
Name = "terraform-example"
}
}
# ------------------------------------------------------------
# CREATE THE SECURITY GROUP THAT'S APPLIED TO THE
EC2 INSTANCE
resource "aws_security_group" "instance" {
name = "terraform-example-instance"
# Inbound HTTP from anywhere
ingress {
from_port = var.server_port
to_port = var.server_port
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
variable "server_port" {
description = "The port the server will use for
HTTP requests"
type = number
default = 8080
}
outputs.tf
variables.tf
output "public_ip" {
value = aws_instance.example.public_ip
description = "The public IP of the web server"
}
Thank you!
Twitter
@OsamaOracle
My Blog
OsamaOracle.com
LinkedIn
https://jo.linkedin.com/in/osamamustafa

More Related Content

What's hot

Dockerfile
Dockerfile Dockerfile
Dockerfile
Jeffrey Ellin
 
Docker intro
Docker introDocker intro
Docker intro
Oleg Z
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
Ravindu Fernando
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
Eueung Mulyana
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
Gourav Varma
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
Yajushi Srivastava
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
Sourabh Saxena
 
presentation on Docker
presentation on Dockerpresentation on Docker
presentation on Docker
Virendra Ruhela
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Edureka!
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
Juneyoung Oh
 
Oracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 VersionOracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 Version
Markus Michalewicz
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
Mehmet Ali Aydın
 
OpenStack Framework Introduction
OpenStack Framework IntroductionOpenStack Framework Introduction
OpenStack Framework Introduction
Jason TC HOU (侯宗成)
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon Web Services Korea
 
(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive
Amazon Web Services
 
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Amazon Web Services
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017
Docker, Inc.
 
AutoUpgrade and Best Practices
AutoUpgrade and Best PracticesAutoUpgrade and Best Practices
AutoUpgrade and Best Practices
Jitendra Singh
 
AWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDSAWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDS
Amazon Web Services Japan
 

What's hot (20)

Dockerfile
Dockerfile Dockerfile
Dockerfile
 
Docker intro
Docker introDocker intro
Docker intro
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
presentation on Docker
presentation on Dockerpresentation on Docker
presentation on Docker
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
Oracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 VersionOracle Multitenant meets Oracle RAC - IOUG 2014 Version
Oracle Multitenant meets Oracle RAC - IOUG 2014 Version
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
OpenStack Framework Introduction
OpenStack Framework IntroductionOpenStack Framework Introduction
OpenStack Framework Introduction
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
 
(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive
 
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017
 
AutoUpgrade and Best Practices
AutoUpgrade and Best PracticesAutoUpgrade and Best Practices
AutoUpgrade and Best Practices
 
AWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDSAWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDS
 

Similar to DevOps for database

Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
MyNOG
 
ansible_rhel.pdf
ansible_rhel.pdfansible_rhel.pdf
ansible_rhel.pdf
ssuser6d347b
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
Alex S
 
No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
Jeff Potts
 
Ansible intro
Ansible introAnsible intro
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
 
Ansible.pdf
Ansible.pdfAnsible.pdf
Ansible.pdf
shaikshazil1
 
Ansible a tool for dev ops
Ansible a tool for dev opsAnsible a tool for dev ops
Ansible a tool for dev ops
René Ribaud
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with oci
DonghuKIM2
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
Yulia Shcherbachova
 
Ansible Devops North East - slides
Ansible Devops North East - slides Ansible Devops North East - slides
Ansible Devops North East - slides
InfinityPP
 
Ansible is Our Wishbone
Ansible is Our WishboneAnsible is Our Wishbone
Ansible is Our Wishbone
Mydbops
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
M Malai
 
Avoid boring work_v2
Avoid boring work_v2Avoid boring work_v2
Avoid boring work_v2
Marcin Przepiórowski
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modulesmohamedmoharam
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Suresh Kumar
 

Similar to DevOps for database (20)

Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
ansible_rhel.pdf
ansible_rhel.pdfansible_rhel.pdf
ansible_rhel.pdf
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Ansible.pdf
Ansible.pdfAnsible.pdf
Ansible.pdf
 
Ansible a tool for dev ops
Ansible a tool for dev opsAnsible a tool for dev ops
Ansible a tool for dev ops
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with oci
 
Ansible
AnsibleAnsible
Ansible
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
Ansible Devops North East - slides
Ansible Devops North East - slides Ansible Devops North East - slides
Ansible Devops North East - slides
 
Ansible is Our Wishbone
Ansible is Our WishboneAnsible is Our Wishbone
Ansible is Our Wishbone
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
 
Avoid boring work_v2
Avoid boring work_v2Avoid boring work_v2
Avoid boring work_v2
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 

More from Osama Mustafa

Case study for software architect
Case study for software architectCase study for software architect
Case study for software architect
Osama Mustafa
 
Does cloud mean the end of the dba
Does cloud mean the end of the dbaDoes cloud mean the end of the dba
Does cloud mean the end of the dba
Osama Mustafa
 
Using git hub for your code
Using git hub for your codeUsing git hub for your code
Using git hub for your code
Osama Mustafa
 
DevOps Project
DevOps Project DevOps Project
DevOps Project
Osama Mustafa
 
Java business service
Java business serviceJava business service
Java business service
Osama Mustafa
 
Steps creating data_integration_services
Steps creating data_integration_servicesSteps creating data_integration_services
Steps creating data_integration_services
Osama Mustafa
 
Build, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using DockerBuild, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa
 
Oracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single node
Osama Mustafa
 
Helping implementer dealing with famous siebel based system messages and er...
Helping implementer dealing with famous siebel   based system messages and er...Helping implementer dealing with famous siebel   based system messages and er...
Helping implementer dealing with famous siebel based system messages and er...
Osama Mustafa
 
Weblogic and docker
Weblogic and dockerWeblogic and docker
Weblogic and docker
Osama Mustafa
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dba
Osama Mustafa
 
Ebs clone r12.2.4
Ebs clone r12.2.4Ebs clone r12.2.4
Ebs clone r12.2.4
Osama Mustafa
 
Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation
Osama Mustafa
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c Installation
Osama Mustafa
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2
Osama Mustafa
 
OBIA Installation
OBIA Installation OBIA Installation
OBIA Installation
Osama Mustafa
 
Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.
Osama Mustafa
 
Eouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafaEouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafa
Osama Mustafa
 
Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2
Osama Mustafa
 
Enable oracle database vault
Enable oracle database vaultEnable oracle database vault
Enable oracle database vault
Osama Mustafa
 

More from Osama Mustafa (20)

Case study for software architect
Case study for software architectCase study for software architect
Case study for software architect
 
Does cloud mean the end of the dba
Does cloud mean the end of the dbaDoes cloud mean the end of the dba
Does cloud mean the end of the dba
 
Using git hub for your code
Using git hub for your codeUsing git hub for your code
Using git hub for your code
 
DevOps Project
DevOps Project DevOps Project
DevOps Project
 
Java business service
Java business serviceJava business service
Java business service
 
Steps creating data_integration_services
Steps creating data_integration_servicesSteps creating data_integration_services
Steps creating data_integration_services
 
Build, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using DockerBuild, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using Docker
 
Oracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single node
 
Helping implementer dealing with famous siebel based system messages and er...
Helping implementer dealing with famous siebel   based system messages and er...Helping implementer dealing with famous siebel   based system messages and er...
Helping implementer dealing with famous siebel based system messages and er...
 
Weblogic and docker
Weblogic and dockerWeblogic and docker
Weblogic and docker
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dba
 
Ebs clone r12.2.4
Ebs clone r12.2.4Ebs clone r12.2.4
Ebs clone r12.2.4
 
Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c Installation
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2
 
OBIA Installation
OBIA Installation OBIA Installation
OBIA Installation
 
Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.
 
Eouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafaEouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafa
 
Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2
 
Enable oracle database vault
Enable oracle database vaultEnable oracle database vault
Enable oracle database vault
 

Recently uploaded

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
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
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
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
 
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
 
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
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
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
 
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
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
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
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 

Recently uploaded (20)

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
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...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
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...
 
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
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
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
 
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...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
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
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

DevOps for database

  • 2. About me oFounder/CEO for Gurus Solutions oLeader & Director for JAOUG oOracle ACE Director o6x of OCI, 4x AWS and 5x Azure oAutomation Lover oStart as DBA and still working on different Of Databases. o Author of two books and working on my 3rd one. oPresenter & Contributor in Oracle Community oPublished articles in different magazines oBlogger on osamaoracle.com
  • 4. Agenda Questions & Answers. Automation Examples. How DevOps will make DBA life Easier ? Understand the DevOps ? What , Why , When ?
  • 5. DevOps is a software development method that stresses communication, collaboration, integration, automation and measurement of cooperation between software developers and other IT professionals. DevOps is sometimes treated as a concept, a philosophy, a job role or a set of tools. DevOps is not all about automation, but it enables fast feedback loops and encourages a culture of collaboration
  • 8. Why DevOps ? 1. Speed deployment processes 2. Enable fast response to changing business requirements 3. Reduce the risk of production changes causing outages 4. Break down silos
  • 10. • When a task becomes (extremely) repetitive. • The Task will take so much manual work. • The task output either will be too much or less. • Some other reason why to use DevOps :- • Eliminate human interaction. • Errors, things not able to work. • Differences in paths • Differences in settings Why DevOps With Oracle - Problem
  • 11. • Terraform • Ansible • Jenkins • Puppet • Chef • Salt Oracle Using DevOps – Tools Examples
  • 12. Tools How it work Focusing Terraform Agentless Admin Focused , IAAC Ansible agentless Admin Focused , Configuration Management Jenkins Agentless Dev and can be work for admin also, CI/CD Puppet agent based Dev Focused Chef agent based Dev Focused Salt Agent, Agentless Admin Focused
  • 13.
  • 15. • Agentless: Ansible doesn’t require agents to be installed on your target servers. Instead, it connects through the secured SSH protocol to execute its tasks. • Facts: Facts are a set of variables that Ansible will collect on target hosts at run time. Those variables are then usable within your scripts. Facts are almost all information you may need from a target host like the IPs, NICs, Devices, etc. You can even add your fact like the list of Oracle instance running with their Oracle Home for example. Two levels: • You can use the so-called ad-hoc command line tool. This tool will permit you with one command line to execute actions, like creating OS users, on multiple servers. • Then you may want to script a set of operations. For that purpose, you’ll use Playbook. A playbook is a file contention your sequence of operations in a YAML format.
  • 16. • RHEL/CentOS Linux • $ sudo yum install ansible • Debian/Ubuntu Linux • $ sudo apt-get install software-properties-common • $ sudo apt-add-repository ppa:ansible/ansible • $ sudo apt-get update • $ sudo apt-get install ansible • Install Ansible using pip • $ sudo pip install ansible • Github • $ git clone git://github.com/ansible/ansible.git • $ cd ./ansible • $ source ./hacking/env-setup Note : you need to have passwordless SSH connectivity from the Ansible host to the Oracle servers Install Ansible
  • 17. • Automate a single task on one or more managed nodes. Ad-hoc commands are quick and easy, but they are not reusable. So why learn about ad-hoc commands first? Ad-hoc commands demonstrate the simplicity and power of Ansible. • Ad-hoc commands are great for tasks you repeat rarely. For example, if you want to power off all the machines in your lab for Christmas vacation, you could execute a quick one-liner in Ansible without writing a playbook. An ad-hoc command looks like this: • $ ansible [pattern] -m [module] -a "[module options]“ • Ad-hoc tasks can be used to reboot servers, copy files, manage packages and users, and much more. You can use any Ansible module in an ad-hoc task • Ansible ad-Hoc command line tool Ansible Modules
  • 18. Ansible ad-Hoc command line tool Use Cases Rebooting servers •I want to reboot all the servers in group called “WebServer” , I have 10 webserver. •ansible Webserver -a "/sbin/reboot“Rebooting Managing file •SCP to transfer many files to multiple machines in parallel. •ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts"Managing Managing users and groups •You can create, manage, and remove user accounts on your managed nodes with ad-hoc tasks: •ansible all -m user -a "name=foo password=<crypted password here>" Managing
  • 19. • Now that you can run ad-hoc commands, you may be interested in combining multiple modules to perform more elaborate actions. Instead of putting all commands sequentially into a bash script, Ansible provides the concept of playbook. A playbook is a YAML formatted file in which you list the modules sequentially to be executed on a group of hosts. This is an example: Ansible PlayBook
  • 20. Use Ansible to Install RDBMS 19c Control Server Ansible Python Managed Server Server#1 Managed Server Server#2 /etc/ansible/hosts [Server#1] 192.168.1.1 [Server#2] 192.168.1.2 [dbservers] 192.168.1.1 192.168.1.2 oracle19c_rdbmsinstall.yml - hosts: dbservers user: root roles: - - dbsoftware19c_install
  • 21. roles/dbsoftware19c_install/files/Software_installation.r sp oracle.install.responseFileVersion=/oracle/install/rspfmt_dbi nstall_response_schema_v19.0.0 oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION={{ oracle_inventory }} ORACLE_HOME={{ oracle_home }} ORACLE_BASE={{ oracle_base }} oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=oper oracle.install.db.OSBACKUPDBA_GROUP=oinstall oracle.install.db.OSDGDBA_GROUP=oinstall oracle.install.db.OSKMDBA_GROUP=oinstall oracle.install.db.OSRACDBA_GROUP=dba SECURITY_UPDATES_VIA_MYORACLESUPPORT=false DECLINE_SECURITY_UPDATES=true oracle.installer.autoupdates.option=SKIP_UPDATES
  • 22. • cd /etc/ansible • ansible-playbook oracle19c_rdbmsinstall.yml
  • 23. Error: ansible requires a json module, none found! This means the python-simplejson rpm is not installed In our case: to add the install of pythonsimplejson to the playbook •install python-simplejson rpm Purpose: run command without the need for python Resolution: raw module
  • 24. Use Ansible to Upgrade pre_upgrade.yml Upgrade.yml Final.ym l
  • 25. • Oracle Cloud Infrastructure Ansible Modules Collection Sample • Compute • Database • Object Storage • Launch a Compute Instance • Set Up an Autonomous Database • List Objects and Buckets • Delete Objects • OCI Ansible Modules • Block Volume • Compute • Container Engine for Kubernetes • Database • File Storage • IAM • Load Balancing Ansible Playbook for OCI
  • 26. Launch a Compute Instance • generates a temporary host-specific SSH key-pair • specifies the public key from that key-pair to connect to the instance during instance launch and • demonstrates how the newly launched instance can be connected to using SSH. https://github.com/oracle/oci-ansible- collection/tree/master/samples/compute/launch_compute_instance
  • 27. • Set up an Autonomous Database with Autonomous Transaction Processing. • List all the Autonomous Transaction Processing instances available in a compartment, filtered by display name. • Get the "facts" for a specified database. • Stop and start an Autonomous Database. • Delete an Autonomous Database. Set Up an Autonomous Database https://github.com/oracle/oci-ansible- collection/tree/master/samples/database/autonomous_database
  • 29. Terraform • Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in- house solutions. Configuration files describe to Terraform the components needed to run a single application or your entire datacenter. • Advantages of Terraform 1. Platform Agnostic 2. State Management 3. Operator Confidence
  • 30. Install Terraform • Terraform and integrated providers available for all major operating environments: • Linux (x86 & ARM) • FreeBSD (x86 & ARM) • OpenBSD (x86) • Windows (x86) • Mac OS X (x86) • Solaris (x86) • Installation • Download the terraform binary for your OS • Integrated providers automatically downloaded/installed when needed • Non-integrated providers: manual download of the binary provider needed • Frequent updates advised • Easy on Oracle Linux 7 (ol7_developer on public yum, ol7_x86_64_developer on ULN) • # yum install terraform (Installation) • # yum upgrade terraform (Upgrade)
  • 31. Terraform Commands • terraform init • Before initial use or after upgrade • terraform plan • terraform apply • terraform apply –-auto-approve • terraform destroy • terraform destroy -force
  • 32. Terraform Variables Variables must be defined in a .tf file values can be assigned during definition with « default = » Variables can be used anywhere in .tf files Input variables from environment variables (TF_VAR_name) $ export TF_VAR_access_key="xxxxxxxx" $ export TF_VAR_secret_key="xxxxxxxx" Input variables from command line Input variables from one or more files Default file name is terraform.tfvars If not default name, just give the name(s) of file(s)
  • 33. Terraform Output Outputs are optional but useful to display relevant information public IP randomly assigned (AWS, OCI, OCI-C) Temporary password for Windows instances in OCI Outputs are displayed at the end of « terraform apply » or with « terraform output »
  • 34. Terraform data-source Useful to automatically get objects names or IDs that are needed to create resources Alternative is to hard-code names/IDs Examples of data sources within OCI Get the list of Availability Domains (name different in each tenant)
  • 35. Best Practice • Putting all code in main.tf is a good idea when you are getting started or writing an example code. In all other cases you will be better having several files split logically like this: • main.tf - call modules, locals and data-sources to create all resources • variables.tf - contains declarations of variables used in main.tf • outputs.tf - contains outputs from the resources created in main.tf • terraform.tfvars should not be used anywhere except composition.
  • 36. Example – Single Web Server main.tf terraform { required_version = ">= 0.12" } # ------------------------------------------------------- # CONFIGURE OUR AWS CONNECTION # ------------------------------------------------------- provider "aws" { region = "us-east-2" } # ---------------------------- # DEPLOY A SINGLE EC2 INSTANCE # ---------------------------- resource "aws_instance" "example" { # Ubuntu Server 18.04 LTS (HVM), SSD Volume Type in us-east-2 ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" vpc_security_group_ids = [aws_security_group.instance.id] user_data = <<-EOF #!/bin/bash echo "Hello, World" > index.html nohup busybox httpd -f -p "${var.server_port}" & EOF tags = { Name = "terraform-example" } } # ------------------------------------------------------------ # CREATE THE SECURITY GROUP THAT'S APPLIED TO THE EC2 INSTANCE resource "aws_security_group" "instance" { name = "terraform-example-instance" # Inbound HTTP from anywhere ingress { from_port = var.server_port to_port = var.server_port protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } }
  • 37. variable "server_port" { description = "The port the server will use for HTTP requests" type = number default = 8080 } outputs.tf variables.tf output "public_ip" { value = aws_instance.example.public_ip description = "The public IP of the web server" }
  • 38.