oradb
Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >=4.3.0
- , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'biemond-oradb', '3.0.19'
Learn more about managing modules with a PuppetfileDocumentation
Oracle Database puppet module
Only for Puppet >= 4.3 and uses the latest puppet 4 features like
- Strong data typing
- Internal hiera module data
- uses Facts array
- epp templating instead of erb
For Puppet 3, 4 you have to use the latest 2.x version of this oradb module
source code is located at puppet4_3_data branch
created by Edwin Biemond biemond.blogspot.com Github homepage
If you need support, checkout the ora_install from Enterprise Modules
With version >= 2.0.0 all manifest parameters are in lowercase and in snakestyle instead of camelcase
Dependency with
- puppetlabs/concat >= 1.0.0
- puppetlabs/stdlib >= 4.0.0
Should work on Docker, for Solaris and on all Linux version like RedHat, CentOS, Ubuntu, Debian, Suse SLES or OracleLinux
- CentOS 7.3 vagrant box with Oracle Database 19.0.0.0 with pluggable databases 19.3 pluggable db puppet 4 vagrant box
- CentOS 7.3 vagrant box with Oracle Database 19.0.0.0 on NFS ASM ASM puppet 4 vagrant box
- CentOS 7.3 vagrant box with Oracle Database 18.0.0.0 with pluggable databases 18.3 pluggable db puppet 4 vagrant box
- CentOS 7.3 vagrant box with Oracle Database 18.0.0.0 on NFS ASM ASM puppet 4 vagrant box
- CentOS 7.3 vagrant box with Oracle Database 12.2.0.1 with pluggable databases 12c pluggable db puppet 4 vagrant box
- Docker image of Oracle Database 12.1 SE Docker Oracle Database 12.1.0.1
- CentOS 7.2 vagrant box with Oracle Database 12.1 and Enterprise Manager 13.2.0.0 Enterprise puppet 4 vagrant box
- CentOS 6.7 vagrant box with Oracle Database 12.1 and Enterprise Manager 12.1.0.5 Enterprise puppet 4 vagrant box
- CentOS 7.3 vagrant box with Oracle Database 18.0.0.0 (18.3) on NFS ASM ASM puppet 4 vagrant box
- CentOS 7.3 vagrant box with Oracle Database 12.2.0.1 on NFS ASM ASM puppet 4 vagrant box
- CentOS 7.2 vagrant box with Oracle Database 12.1.0.2 on NFS ASM ASM puppet 4 vagrant box
- CentOS 6.6 vagrant box with Oracle Database 11.2.0.4 on NFS ASM ASM puppet 4 vagrant box
- CentOS 6.6 vagrant box with Oracle Database 12.1.0.2 with pluggable databases 12c pluggable db puppet 4 vagrant box
- CentOS 6.5 vagrant box with Oracle Database 11.2.0.4 and GoldenGate 12.1.2 coherence goldengate vagrant box
Should work for Puppet >= 4.0
Oracle Database Features
- Oracle Grid 11.2.0.4, 12.1.0.1, 12.1.0.2, 12.2.0.1, 18.0.0.0, 19.0.0.0 Linux / Solaris installation
- Oracle Database 12.1.0.1, 12.1.0.2, 12.2.0.1, 18.0.0.0, 19.0.0.0 Linux / Solaris installation
- Oracle Database 11.2.0.1, 11.2.0.3, 11.2.0.4 Linux / Solaris installation
- Oracle Database Instance 11.2, 12.1, 12.2, 18.3, 19.3 with pluggable database or provide your own db template
- Oracle Database Client 19.0.0.0, 18.0.0.0, 12.2.0.1, 12.1.0.1, 12.1.0.2, 11.2.0.4, 11.2.0.1 Linux / Solaris installation
- Oracle Database Net configuration
- Oracle Database Listener
- Tnsnames entry
- Listener entry in tnsnames.ora
- Oracle ASM
- Oracle RAC
- OPatch upgrade
- Apply OPatch also for clusterware
- Create database instances, also based on your own template or seeded template
- Stop/Start database instances with db_control puppet resource type
Enterprise Manager
- Enterprise Manager Server 13.2.0.0, 12.1.0.4, 12.1.0.5, 13 & 12c cloud installation / configuration
- Agent installation via AgentPull.sh & AgentDeploy.sh
GoldenGate
- GoldenGate 12.3.0, 12.2.1, 12.1.2, 11.2.1
Repository Creation Utility (RCU)
- Installs RCU repositoy for Oracle SOA Suite / Webcenter ( 11.1.1.6.0 and 11.1.1.7.0 ) / Oracle Identity Management ( 11.1.2.1 )
Oracle RAC
In combination with the ora_rac module of Bert Hajee (https://forge.puppetlabs.com/hajee/ora_rac)
Oracle Database resource types
- db_control, start stop or a restart a database instance also used by dbactions manifest.pp
- db_opatch, used by the opatch.pp manifest
- db_rcu, used by the rcu.pp manifest
- db_listener, start stop or a restart the oracle listener ( supports refreshonly )
In combination with the oracle module of Bert Hajee (http://forge.puppetlabs.com/hajee/oracle) you can also create
- create a tablespace
- create a user with the required grants and quota's
- create one or more roles
- create one or more services
- change a database init parameter (Memory or SPFILE)
Some manifests like installdb.pp, opatch.pp or rcusoa.pp supports an alternative mountpoint for the big oracle files. When not provided it uses the files location of the oradb puppet module else you can use $puppet_download_mnt_point => "/mnt" or "oradb/" or "xxxx/"
Oracle Big files and alternate download location
Some manifests like oradb:installdb, opatch or rcu supports an alternative mountpoint for the big oracle setup/install files. When not provided it uses the files folder located in the orawls puppet module else you can use $source =>
- "/mnt"
- "/vagrant"
- "oradb/" (default)
when the files are also locally accessible then you can also set $remote_file => false this will not move the files to the download folder, just extract or install
Virtualbox 5 & BCA Operation failed
You can get this 12c error BCA Operation failed when you use Virtualbox 5
There is an issue related with this
The workaround seems to be here
But for the purposes of doing an automatic installation is not a good workaround, so I would suggest is someone faces the same problem just downgrade to virtualbox 4 the last release until that ticket is closed
Installation, Disk or memory issues
# hiera
hosts:
'emdb.example.com':
ip: "10.10.10.15"
host_aliases: 'emdb'
'localhost':
ip: "127.0.0.1"
host_aliases: 'localhost.localdomain,localhost4,localhost4.localdomain4'
$host_instances = hiera('hosts', {})
create_resources('host',$host_instances)
# disable the firewall
service { iptables:
enable => false,
ensure => false,
hasstatus => true,
}
# set the swap ,forge puppet module petems-swap_file
class { 'swap_file':
swapfile => '/var/swap.1',
swapfilesize => '8192000000'
}
# set the tmpfs
mount { '/dev/shm':
ensure => present,
atboot => true,
device => 'tmpfs',
fstype => 'tmpfs',
options => 'size=3500m',
}
see this chapter "Linux kernel, ulimits and required packages" for more important information
Linux kernel, ulimits and required packages
install the following module to set the database kernel parameters puppet module install fiddyspence-sysctl
install the following module to set the database user limits parameters puppet module install erwbgy-limits
$all_groups = ['oinstall','dba' ,'oper']
group { $all_groups :
ensure => present,
}
user { 'oracle' :
ensure => present,
uid => 500,
gid => 'oinstall',
groups => ['oinstall','dba','oper'],
shell => '/bin/bash',
password => '$1$DSJ51vh6$4XzzwyIOk6Bi/54kglGk3.',
home => "/home/oracle",
comment => "This user oracle was created by Puppet",
require => Group[$all_groups],
managehome => true,
}
sysctl { 'kernel.msgmnb': ensure => 'present', permanent => 'yes', value => '65536',}
sysctl { 'kernel.msgmax': ensure => 'present', permanent => 'yes', value => '65536',}
sysctl { 'kernel.shmmax': ensure => 'present', permanent => 'yes', value => '2588483584',}
sysctl { 'kernel.shmall': ensure => 'present', permanent => 'yes', value => '2097152',}
sysctl { 'fs.file-max': ensure => 'present', permanent => 'yes', value => '6815744',}
sysctl { 'net.ipv4.tcp_keepalive_time': ensure => 'present', permanent => 'yes', value => '1800',}
sysctl { 'net.ipv4.tcp_keepalive_intvl': ensure => 'present', permanent => 'yes', value => '30',}
sysctl { 'net.ipv4.tcp_keepalive_probes': ensure => 'present', permanent => 'yes', value => '5',}
sysctl { 'net.ipv4.tcp_fin_timeout': ensure => 'present', permanent => 'yes', value => '30',}
sysctl { 'kernel.shmmni': ensure => 'present', permanent => 'yes', value => '4096', }
sysctl { 'fs.aio-max-nr': ensure => 'present', permanent => 'yes', value => '1048576',}
sysctl { 'kernel.sem': ensure => 'present', permanent => 'yes', value => '250 32000 100 128',}
sysctl { 'net.ipv4.ip_local_port_range': ensure => 'present', permanent => 'yes', value => '9000 65500',}
sysctl { 'net.core.rmem_default': ensure => 'present', permanent => 'yes', value => '262144',}
sysctl { 'net.core.rmem_max': ensure => 'present', permanent => 'yes', value => '4194304', }
sysctl { 'net.core.wmem_default': ensure => 'present', permanent => 'yes', value => '262144',}
sysctl { 'net.core.wmem_max': ensure => 'present', permanent => 'yes', value => '1048576',}
class { 'limits':
config => {
'*' => { 'nofile' => { soft => '2048' , hard => '8192', },},
'oracle' => { 'nofile' => { soft => '65536' , hard => '65536', },
'nproc' => { soft => '2048' , hard => '16384', },
'stack' => { soft => '10240' ,},},
},
use_hiera => false,
}
$install = [ 'binutils.x86_64', 'compat-libstdc++-33.x86_64', 'glibc.x86_64','ksh.x86_64','libaio.x86_64',
'libgcc.x86_64', 'libstdc++.x86_64', 'make.x86_64','compat-libcap1.x86_64', 'gcc.x86_64',
'gcc-c++.x86_64','glibc-devel.x86_64','libaio-devel.x86_64','libstdc++-devel.x86_64',
'sysstat.x86_64','unixODBC-devel','glibc.i686','libXext.x86_64','libXtst.x86_64']
package { $install:
ensure => present,
}
Database install
$puppet_download_mnt_point = "oradb/"
oradb::installdb{ '12.2.0.1_Linux-x86-64':
version => '12.2.0.1',
file => 'V839960-01',
database_type => 'EE',
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.2/db',
bash_profile => true,
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
group_oper => 'oper',
download_dir => '/data/install',
zip_extract => true,
puppet_download_mnt_point => $puppet_download_mnt_point,
}
oradb::installdb{ '12.1.0.2_Linux-x86-64':
version => '12.1.0.2',
file => 'V46095-01',
database_type => 'SE',
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.1/db',
bash_profile => true,
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
group_oper => 'oper',
download_dir => '/data/install',
zip_extract => true,
puppet_download_mnt_point => $puppet_download_mnt_point,
}
or with zip_extract ( does not download or extract , software is in /install/linuxamd64_12c_database )
oradb::installdb{ '12.1.0.1_Linux-x86-64':
version => '12.1.0.1',
file => 'linuxamd64_12c_database',
database_type => 'SE',
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.1/db',
bash_profile => true,
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
group_oper => 'oper',
download_dir => '/install',
zip_extract => false,
}
or
oradb::installdb{ '112040_Linux-x86-64':
version => '11.2.0.4',
file => 'p13390677_112040_Linux-x86-64',
database_type => 'SE',
oracle_base => '/oracle',
oracle_home => '/oracle/product/11.2/db',
ee_options_selection => true,
ee_optional_components => 'oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0',
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
group_oper => 'oper',
download_dir => '/install',
zip_extract => true,
puppet_download_mnt_point => $puppet_download_mnt_point,
}
or
oradb::installdb{ '112030_Linux-x86-64':
version => '11.2.0.3',
file => 'p10404530_112030_Linux-x86-64',
database_type => 'SE',
oracle_base => '/oracle',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
group_oper => 'oper',
download_dir => '/install',
zip_extract => true,
puppet_download_mnt_point => $puppet_download_mnt_point,
}
or
oradb::installdb{ '112010_Linux-x86-64':
version => '11.2.0.1',
file => 'linux.x64_11gR2_database',
database_type => 'SE',
oracle_base => '/oracle',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
group_oper => 'oper',
download_dir => '/install',
zip_extract => true,
}
Patching
Opatchupgrade
For opatchupgrade you need to provide the Oracle support csi_number and supportId and need to be online. Or leave them empty but it needs the Expect rpm to emulate OCM
# use this on a Grid or Database home
oradb::opatchupgrade{'112000_opatch_upgrade':
oracle_home => '/oracle/product/11.2/db',
patch_file => 'p6880880_112000_Linux-x86-64.zip',
# csi_number => '11111',
# support_id => 'biemond@gmail.com',
csi_number => undef,
support_id => undef,
opversion => '11.2.0.3.6',
user => 'oracle',
group => 'dba',
download_dir => '/install',
puppet_download_mnt_point => $puppet_download_mnt_point,
require => Oradb::Installdb['112030_Linux-x86-64'],
}
oradb::opatchupgrade{'122000_opatch_upgrade_db':
oracle_home => hiera('oracle_home_dir'),
patch_file => 'p6880880_122010_Linux-x86-64.zip',
csi_number => undef,
support_id => undef,
opversion => '12.2.0.1.8',
user => hiera('oracle_os_user'),
group => hiera('oracle_os_group'),
download_dir => hiera('oracle_download_dir'),
puppet_download_mnt_point => hiera('oracle_source'),
require => Oradb::Installdb['db_linux-x64'],
}
Opatch
# october 2014 11.2.0.4.4 patch
oradb::opatch{'19121551_db_patch':
ensure => 'present',
oracle_product_home => hiera('oracle_home_dir'),
patch_id => '19121551',
patch_file => 'p19121551_112040_Linux-x86-64.zip',
user => hiera('oracle_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatchupgrade['112000_opatch_upgrade_db'],
puppet_download_mnt_point => hiera('oracle_source'),
}
Clusterware aka opatch auto
to use the new opatchauto utility(12.1) instead of opatch auto(11.2) use this parameter use_opatchauto_utility => true
oradb::opatch{'21523260_grid_patch':
ensure => 'present',
oracle_product_home => hiera('grid_home_dir'),
patch_id => '21523260',
patch_file => 'p21523260_121020_Linux-x86-64.zip',
clusterware => true,
use_opatchauto_utility => true,
bundle_sub_patch_id => '21359755', # sub patch_id of bundle patch ( else I can't detect it)
user => hiera('grid_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
puppet_download_mnt_point => hiera('oracle_source'),
require => Oradb::Opatchupgrade['121000_opatch_upgrade_asm'],
}
The old way (11g)
oradb::opatch{'18706472_grid_patch':
ensure => 'present',
oracle_product_home => hiera('grid_home_dir'),
patch_id => '18706472',
patch_file => 'p18706472_112040_Linux-x86-64.zip',
clusterware => true,
bundle_sub_patch_id => '18522515', sub patch_id of bundle patch ( else I can't detect it if it is already applied)
user => hiera('grid_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatchupgrade['112000_opatch_upgrade'],
puppet_download_mnt_point => hiera('oracle_source'),
}
# this 19791420 patch contains 2 patches (in different sub folders), one bundle and a normal one.
# we want to apply the bundle and need to provide the right value for bundle_sub_folder
oradb::opatch{'19791420_grid_patch':
ensure => 'present',
oracle_product_home => hiera('grid_home_dir'),
patch_id => '19791420',
patch_file => 'p19791420_112040_Linux-x86-64.zip',
clusterware => true,
bundle_sub_patch_id => '19121552', # sub patch_id of bundle patch ( else I can't detect it if it is already applied)
bundle_sub_folder => '19380115', # optional subfolder inside the patch zip
user => hiera('grid_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatchupgrade['112000_opatch_upgrade_asm'],
puppet_download_mnt_point => hiera('oracle_source'),
}
# the same patch applied with opatch auto to an oracle database home, this time we need to use the 19121551 as bundle_sub_patch_id
# this is the october 2014 11.2.0.4.4 patch
oradb::opatch{'19791420_grid_patch':
ensure => 'present',
oracle_product_home => hiera('oracle_home_dir'),
patch_id => '19791420',
patch_file => 'p19791420_112040_Linux-x86-64.zip',
clusterware => true,
bundle_sub_patch_id => '19121551', # sub patch_id of bundle patch ( else I can't detect it if it is already applied)
bundle_sub_folder => '19380115', # optional subfolder inside the patch zip
user => hiera('grid_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatchupgrade['112000_opatch_upgrade_asm'],
puppet_download_mnt_point => hiera('oracle_source'),
}
# same patch 19791420 but then for the oracle db home, this patch requires the bundle patch of 19791420 or
# 19121551 october 2014 11.2.0.4.4 patch
oradb::opatch{'19791420_db_patch':
ensure => 'present',
oracle_product_home => hiera('oracle_home_dir'),
patch_id => '19791420',
patch_file => 'p19791420_112040_Linux-x86-64.zip',
clusterware => false,
bundle_sub_patch_id => '19282021', # sub patch_id of bundle patch ( else I can't detect it)
bundle_sub_folder => '19282021', # optional subfolder inside the patch zip
user => hiera('oracle_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatch['19121551_db_patch'],
puppet_download_mnt_point => hiera('oracle_source'),
}
Oracle net
oradb::net{ 'config net8':
oracle_home => '/oracle/product/11.2/db',
version => '11.2' or "12.1",
user => 'oracle',
group => 'dba',
download_dir => '/install',
db_port => '1521', #optional
require => Oradb::Opatch['14727310_db_patch'],
}
Listener
db_listener{ 'startlistener':
ensure => 'running', # running|start|abort|stop
oracle_base_dir => '/oracle',
oracle_home_dir => '/oracle/product/11.2/db',
os_user => 'oracle',
listener_name => 'listener' # which is the default and optional
}
# subscribe to changes
db_listener{ 'startlistener':
ensure => 'running', # running|start|abort|stop
oracle_base_dir => '/oracle',
oracle_home_dir => '/oracle/product/11.2/db',
os_user => 'oracle',
listener_name => 'listener' # which is the default and optional
refreshonly => true,
subscribe => XXXXX,
}
# the old way which also calls db_listener type
oradb::listener{'start listener':
action => 'start', # running|start|abort|stop
oracle_base => '/oracle',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
listener_name => 'listener' # which is the default and optional
}
Database instance
oradb::database{ 'testDb_Create':
oracle_base => '/oracle',
oracle_home => '/oracle/product/11.2/db',
version => '11.2',
user => 'oracle',
group => 'dba',
download_dir => '/install',
action => 'create',
db_name => 'test',
db_domain => 'oracle.com',
db_port => '1521',
sys_password => 'Welcome01',
system_password => 'Welcome01',
data_file_destination => "/oracle/oradata",
recovery_area_destination => "/oracle/flash_recovery_area",
character_set => "AL32UTF8",
nationalcharacter_set => "UTF8",
init_params => {'open_cursors' => '1000',
'processes' => '600',
'job_queue_processes' => '4' },
sample_schema => 'TRUE',
memory_percentage => 40,
memory_total => 800,
database_type => "MULTIPURPOSE",
em_configuration => "NONE",
require => Oradb::Listener['start listener'],
}
template (not seeded)
based on your own dbt template ( not seeded )
The template must be have the following extension dbt.erb like dbtemplate_12.1.dbt.erb, use puppet_download_mnt_point parameter for the template location or add your template to the template dir of the oradb module
- Click here for an 12.2 db instance template example
- Click here for an [12.1 db instance template example](https://github.com/biemond/biemond-oradb/blob/ puppet4_3_data/templates/dbtemplate_12.1.dbt.erb)
- Click here for an 12.1 db instance variables template example
- Click here for an 12.1 db asm instance template example
- Click here for an 11.2 db asm instance template example
with a template of the oradb module
oradb::database{ 'testDb_Create':
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.1/db',
version => '12.1',
user => 'oracle',
group => 'dba',
template => 'dbtemplate_12.1', # or dbtemplate_12.1_vars, dbtemplate_11gR2_asm, this will use dbtemplate_12.1.dbt.erb example template
# template_variables => { 'location01' => '/oracle/oradata/' , 'location02' => '/oracle/oradata/' }
download_dir => '/install',
action => 'create',
db_name => 'test',
db_domain => 'oracle.com',
db_port => 1521,
sys_password => 'Welcome01',
system_password => 'Welcome01',
data_file_destination => "/oracle/oradata",
recovery_area_destination => "/oracle/flash_recovery_area",
character_set => "AL32UTF8",
nationalcharacter_set => "UTF8",
memory_percentage => 40,
memory_total => 800,
require => Oradb::Listener['start listener'],
}
or your own template on your own location
template => 'my_dbtemplate_11gR2_asm',
puppet_download_mnt_point => '/vagrant', # 'oradb' etc
seeded template
based on a seeded dbc template
use existing or copy all files to $ORACLE_HOME/assistants/dbca/templates
The template must be have the following extension dbc like General_Purpose.dbc
oradb::database{ 'testDb_Create':
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.1/db',
version => '12.1',
user => 'oracle',
group => 'dba',
template_seeded => '12.1.0.2.0_Database_Template_for_EM12_1_0_5_0_Small_deployment',
download_dir => '/install',
action => 'create',
db_name => 'test',
db_domain => 'oracle.com',
db_port => 1521,
sys_password => 'Welcome01',
system_password => 'Welcome01',
data_file_destination => "/oracle/oradata",
recovery_area_destination => "/oracle/flash_recovery_area",
character_set => "AL32UTF8",
nationalcharacter_set => "UTF8",
memory_percentage => 40,
memory_total => 800,
require => Oradb::Listener['start listener'],
}
12c container and pluggable databases
oradb::database{ 'oraDb':
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.1/db',
version => '12.1',
user => 'oracle',
group => 'dba'
download_dir => '/install',
action => 'create',
db_name => 'orcl',
db_domain => 'example.com',
sys_password => 'Welcome01',
system_password => 'Welcome01',
character_set => 'AL32UTF8',
nationalcharacter_set => 'UTF8',
sample_schema => 'FALSE',
memory_percentage => 40,
memory_total => 800,
database_type => 'MULTIPURPOSE',
em_configuration => 'NONE',
data_file_destination => '/oracle/oradata',
recovery_area_destination => '/oracle/flash_recovery_area',
init_params => {'open_cursors' => '1000',
'processes' => '600',
'job_queue_processes' => '4' },
container_database => true, <|-------
}
oradb::database_pluggable{'pdb1':
ensure => 'present',
version => '12.1',
oracle_home_dir => '/oracle/product/12.1/db',
user => 'oracle',
group => 'dba',
source_db => 'orcl',
pdb_name => 'pdb1',
pdb_admin_username => 'pdb_adm',
pdb_admin_password => 'Welcome01',
pdb_datafile_destination => "/oracle/oradata/orcl/pdb1",
create_user_tablespace => true,
log_output => true,
}
# remove the pluggable database
oradb::database_pluggable{'pdb1':
ensure => 'absent',
version => '12.1',
oracle_home_dir => '/oracle/product/12.1/db',
user => 'oracle',
group => 'dba',
source_db => 'orcl',
pdb_name => 'pdb1',
pdb_datafile_destination => "/oracle/oradata/orcl/pdb1",
log_output => true,
}
12c ASM
oradb::database{ 'oraDb':
oracle_base => lookup('oracle_base_dir'),
oracle_home => lookup('oracle_home_dir'),
version => lookup('dbinstance_version'),
user => lookup('oracle_os_user'),
group => lookup('oracle_os_group'),
download_dir => lookup('oracle_download_dir'),
action => 'create',
db_name => lookup('oracle_database_name'),
db_domain => lookup('oracle_database_domain_name'),
sys_password => lookup('oracle_database_sys_password'),
system_password => lookup('oracle_database_system_password'),
# template => 'dbtemplate_12.1_asm',
character_set => 'AL32UTF8',
nationalcharacter_set => 'UTF8',
sample_schema => 'false',
memory_percentage => 40,
memory_total => 2880,
automatic_memory_management => false,
database_type => 'MULTIPURPOSE',
em_configuration => 'NONE',
storage_type => 'ASM',
asm_snmp_password => 'Welcome01',
asm_diskgroup => '+DATA/{DB_UNIQUE_NAME}',
data_file_destination => '+DATA/{DB_UNIQUE_NAME}',
recovery_diskgroup => '+RECO',
recovery_area_destination => '+RECO',
puppet_download_mnt_point => 'oradb/',
require => Ora_asm_diskgroup['RECO@+ASM'],
}
or delete a database
oradb::database{ 'testDb_Delete':
oracle_base => '/oracle',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
download_dir => '/install',
action => 'delete',
db_name => 'test',
sys_password => 'Welcome01',
require => Oradb::Dbactions['start testDb'],
}
Database instance actions
db_control{'emrepos start':
ensure => 'running', #running|start|abort|stop
instance_name => 'test',
oracle_product_home_dir => '/oracle/product/11.2/db',
os_user => 'oracle',
}
db_control{'emrepos stop':
ensure => 'stop', #running|start|abort|stop
instance_name => 'test',
oracle_product_home_dir => '/oracle/product/11.2/db',
os_user => 'oracle',
}
# the old way
oradb::dbactions{ 'stop testDb':
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
action => 'stop',
db_name => 'test',
require => Oradb::Database['testDb'],
}
oradb::dbactions{ 'start testDb':
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
action => 'start',
db_name => 'test',
require => Oradb::Dbactions['stop testDb'],
}
# database instance with srvctl
oradb::dbactions{ 'start testDb':
oracle_home => hiera('oracle_home_dir'),
user => hiera('oracle_os_user'),
group => hiera('oracle_os_group'),
action => 'start',
db_name => 'test',
require => Oradb::Dbactions['stop testDb'],
}
# grid or asm
db_control{'instance control asm':
provider => 'srvctl',
ensure => 'start',
instance_name => '+ASM',
oracle_product_home_dir => hiera('oracle_home_dir'),
os_user => hiera('grid_os_user'),
db_type => 'grid',
}
oradb::dbactions{ 'start grid':
db_type => 'grid',
oracle_home => hiera('oracle_home_dir'),
grid_home => hiera('grid_home_dir'),
user => hiera('grid_os_user'),
group => hiera('oracle_os_group'),
action => 'start',
db_name => '+ASM',
}
# subscribe to changes
db_control{'emrepos restart':
ensure => 'running', #running|start|abort|stop
instance_name => 'test',
oracle_product_home_dir => '/oracle/product/11.2/db',
os_user => 'oracle',
refreshonly => true,
subscribe => Init_param['emrepos/memory_target'],
}
oradb::autostartdatabase{ 'autostart oracle':
oracle_home => '/oracle/product/12.1/db',
user => 'oracle',
db_name => 'test',
service_name => 'dbora',
require => Oradb::Dbactions['start testDb'],
}
Tnsnames
oradb::tnsnames{'orcl':
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
server => { myserver => { host => soadb.example.nl, port => '1521', protocol => 'TCP' }},
connect_service_name => 'soarepos.example.nl',
require => Oradb::Dbactions['start oraDb'],
}
oradb::tnsnames{'test':
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
server => { myserver => { host => soadb.example.nl, port => '1525', protocol => 'TCP' }, myserver2 => { host => soadb2.example.nl, port => '1526', protocol => 'TCP' }},
connect_service_name => 'soarepos.example.nl',
connect_server => 'DEDICATED',
require => Oradb::Dbactions['start oraDb'],
}
oradb::tnsnames{'testlistener':
entry_type => 'listener',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
server => { myserver => { host => 'soadb.example.nl', port => '1521', protocol => 'TCP' }},
require => Oradb::Dbactions['start oraDb'],
}
Grid install with ASM
$all_groups = ['oinstall','dba' ,'oper','asmdba','asmadmin','asmoper']
group { $all_groups :
ensure => present,
}
user { 'oracle' :
ensure => present,
uid => 500,
gid => 'oinstall',
groups => ['oinstall','dba','oper','asmdba'],
shell => '/bin/bash',
password => '$1$DSJ51vh6$4XzzwyIOk6Bi/54kglGk3.',
home => "/home/oracle",
comment => "This user oracle was created by Puppet",
require => Group[$all_groups],
managehome => true,
}
user { 'grid' :
ensure => present,
uid => 501,
gid => 'oinstall',
groups => ['oinstall','dba','asmadmin','asmdba','asmoper'],
shell => '/bin/bash',
password => '$1$DSJ51vh6$4XzzwyIOk6Bi/54kglGk3.',
home => "/home/grid",
comment => "This user grid was created by Puppet",
require => Group[$all_groups],
managehome => true,
}
####### NFS example
file { '/home/nfs_server_data':
ensure => directory,
recurse => false,
replace => false,
mode => '0775',
owner => 'grid',
group => 'asmadmin',
require => User['grid'],
}
class { 'nfs::server':
package => latest,
service => running,
enable => true,
}
nfs::export { '/home/nfs_server_data':
options => [ 'rw', 'sync', 'no_wdelay','insecure_locks','no_root_squash' ],
clients => [ "*" ],
require => [File['/home/nfs_server_data'],Class['nfs::server'],],
}
file { '/nfs_client':
ensure => directory,
recurse => false,
replace => false,
mode => '0775',
owner => 'grid',
group => 'asmadmin',
require => User['grid'],
}
mounts { 'Mount point for NFS data':
ensure => present,
source => 'soadbasm:/home/nfs_server_data',
dest => '/nfs_client',
type => 'nfs',
opts => 'rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0',
require => [File['/nfs_client'],Nfs::Export['/home/nfs_server_data'],]
}
exec { "/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b1 bs=1M count=7520":
user => 'grid',
group => 'asmadmin',
logoutput => true,
unless => "/usr/bin/test -f /nfs_client/asm_sda_nfs_b1",
require => Mounts['Mount point for NFS data'],
}
exec { "/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b2 bs=1M count=7520":
user => 'grid',
group => 'asmadmin',
logoutput => true,
unless => "/usr/bin/test -f /nfs_client/asm_sda_nfs_b2",
require => [Mounts['Mount point for NFS data'],
Exec["/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b1 bs=1M count=7520"]],
}
exec { "/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b3 bs=1M count=7520":
user => 'grid',
group => 'asmadmin',
logoutput => true,
unless => "/usr/bin/test -f /nfs_client/asm_sda_nfs_b3",
require => [Mounts['Mount point for NFS data'],
Exec["/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b1 bs=1M count=7520"],
Exec["/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b2 bs=1M count=7520"],],
}
exec { "/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b4 bs=1M count=7520":
user => 'grid',
group => 'asmadmin',
logoutput => true,
unless => "/usr/bin/test -f /nfs_client/asm_sda_nfs_b4",
require => [Mounts['Mount point for NFS data'],
Exec["/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b1 bs=1M count=7520"],
Exec["/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b2 bs=1M count=7520"],
Exec["/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b3 bs=1M count=7520"],],
}
$nfs_files = ['/nfs_client/asm_sda_nfs_b1','/nfs_client/asm_sda_nfs_b2','/nfs_client/asm_sda_nfs_b3','/nfs_client/asm_sda_nfs_b4']
file { $nfs_files:
ensure => present,
owner => 'grid',
group => 'asmadmin',
mode => '0664',
require => Exec["/bin/dd if=/dev/zero of=/nfs_client/asm_sda_nfs_b4 bs=1M count=7520"],
}
###### end of NFS example
oradb::installasm{ 'db_linux-x64':
version => hiera('db_version'),
file => hiera('asm_file'),
grid_type => 'HA_CONFIG',
grid_base => hiera('grid_base_dir'),
grid_home => hiera('grid_home_dir'),
ora_inventory_dir => hiera('oraInventory_dir'),
user_base_dir => '/home',
user => hiera('grid_os_user'),
group => 'asmdba',
group_install => 'oinstall',
group_oper => 'asmoper',
group_asm => 'asmadmin',
sys_asm_password => 'Welcome01',
asm_monitor_password => 'Welcome01',
asm_diskgroup => 'DATA',
disk_discovery_string => "/nfs_client/asm*",
disks => "/nfs_client/asm_sda_nfs_b1,/nfs_client/asm_sda_nfs_b2",
# disk_discovery_string => "ORCL:*",
# disks => "ORCL:DISK1,ORCL:DISK2",
disk_redundancy => "EXTERNAL",
download_dir => hiera('oracle_download_dir'),
remote_file => false,
puppet_download_mnt_point => hiera('oracle_source'),
}
# 12.2
oradb::installasm{ 'db_linux-x64':
version => lookup('db_version'),
file => lookup('asm_file'),
grid_type => 'HA_CONFIG',
grid_base => lookup('grid_base_dir'),
grid_home => lookup('grid_home_dir'),
ora_inventory_dir => lookup('oraInventory_dir'),
user => lookup('grid_os_user'),
asm_diskgroup => 'DATA',
disk_discovery_string => '/nfs_client/asm*',
disks => '/nfs_client/asm_sda_nfs_b1,/nfs_client/asm_sda_nfs_b2',
disk_redundancy => 'EXTERNAL',
remote_file => false,
puppet_download_mnt_point => lookup('oracle_source'),
}
oradb::opatchupgrade{'112000_opatch_upgrade_asm':
oracle_home => hiera('grid_home_dir'),
patch_file => 'p6880880_112000_Linux-x86-64.zip',
csi_number => undef,
support_id => undef,
opversion => '11.2.0.3.6',
user => hiera('grid_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
puppet_download_mnt_point => hiera('oracle_source'),
require => Oradb::Installasm['db_linux-x64'],
}
oradb::opatch{'19791420_grid_patch':
ensure => 'present',
oracle_product_home => hiera('grid_home_dir'),
patch_id => '19791420',
patch_file => 'p19791420_112040_Linux-x86-64.zip',
clusterware => true,
bundle_sub_patch_id => '19121552', # sub patch_id of bundle patch ( else I can't detect it)
bundle_sub_folder => '19380115', # optional subfolder inside the patch zip
user => hiera('grid_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatchupgrade['112000_opatch_upgrade_asm'],
puppet_download_mnt_point => hiera('oracle_source'),
}
oradb::installdb{ 'db_linux-x64':
version => hiera('db_version'),
file => hiera('db_file'),
database_type => 'EE',
ora_inventory_dir => hiera('oraInventory_dir'),
oracle_base => hiera('oracle_base_dir'),
oracle_home => hiera('oracle_home_dir'),
user_base_dir => '/home',
user => hiera('oracle_os_user'),
group => 'dba',
group_install => 'oinstall',
group_oper => 'oper',
download_dir => hiera('oracle_download_dir'),
remote_file => false,
puppet_download_mnt_point => hiera('oracle_source'),
require => Oradb::Opatch['19791420_grid_patch'],
}
oradb::opatchupgrade{'112000_opatch_upgrade_db':
oracle_home => hiera('oracle_home_dir'),
patch_file => 'p6880880_112000_Linux-x86-64.zip',
csi_number => undef,
support_id => undef,
opversion => '11.2.0.3.6',
user => hiera('oracle_os_user'),
group => hiera('oracle_os_group'),
download_dir => hiera('oracle_download_dir'),
puppet_download_mnt_point => hiera('oracle_source'),
require => Oradb::Installdb['db_linux-x64'],
}
oradb::opatch{'19791420_db_patch':
ensure => 'present',
oracle_product_home => hiera('oracle_home_dir'),
patch_id => '19791420',
patch_file => 'p19791420_112040_Linux-x86-64.zip',
clusterware => true,
bundle_sub_patch_id => '19121551', #,'19121552', # sub patch_id of bundle patch ( else I can't detect it)
bundle_sub_folder => '19380115', # optional subfolder inside the patch zip
user => hiera('oracle_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatchupgrade['112000_opatch_upgrade_db'],
puppet_download_mnt_point => hiera('oracle_source'),
}
oradb::opatch{'19791420_db_patch_2':
ensure => 'present',
oracle_product_home => hiera('oracle_home_dir'),
patch_id => '19791420',
patch_file => 'p19791420_112040_Linux-x86-64.zip',
clusterware => false,
bundle_sub_patch_id => '19282021', # sub patch_id of bundle patch ( else I can't detect it)
bundle_sub_folder => '19282021', # optional subfolder inside the patch zip
user => hiera('oracle_os_user'),
group => 'oinstall',
download_dir => hiera('oracle_download_dir'),
ocmrf => true,
require => Oradb::Opatch['19791420_db_patch'],
puppet_download_mnt_point => hiera('oracle_source'),
}
# with the help of the oracle and easy-type module of Bert Hajee
ora_asm_diskgroup{ 'RECO@+ASM':
ensure => 'present',
au_size => '1',
compat_asm => '11.2.0.0.0',
compat_rdbms => '10.1.0.0.0',
diskgroup_state => 'MOUNTED',
disks => {'RECO_0000' => {'diskname' => 'RECO_0000', 'path' => '/nfs_client/asm_sda_nfs_b3'},
'RECO_0001' => {'diskname' => 'RECO_0001', 'path' => '/nfs_client/asm_sda_nfs_b4'}},
redundancy_type => 'EXTERNAL',
require => Oradb::Opatch['19791420_db_patch_2'],
}
# based on a template
oradb::database{ 'oraDb':
oracle_base => hiera('oracle_base_dir'),
oracle_home => hiera('oracle_home_dir'),
version => hiera('dbinstance_version'),
user => hiera('oracle_os_user'),
group => hiera('oracle_os_group'),
download_dir => hiera('oracle_download_dir'),
action => 'create',
db_name => hiera('oracle_database_name'),
db_domain => hiera('oracle_database_domain_name'),
sys_password => hiera('oracle_database_sys_password'),
system_password => hiera('oracle_database_system_password'),
template => 'dbtemplate_11gR2_asm',
character_set => "AL32UTF8",
nationalcharacter_set => "UTF8",
sample_schema => 'FALSE',
memory_percentage => "40",
memory_total => "800",
database_type => "MULTIPURPOSE",
em_configuration => "NONE",
storage_type => "ASM",
asm_snmp_password => 'Welcome01',
asm_diskgroup => 'DATA',
recovery_diskgroup => 'RECO',
recovery_area_destination => 'RECO',
require => [Oradb::Opatch['19791420_db_patch_2'],
Ora_asm_diskgroup['RECO@+ASM'],],
}
# or not based on a template
oradb::database{ 'oraDb':
oracle_base => hiera('oracle_base_dir'),
oracle_home => hiera('oracle_home_dir'),
version => hiera('dbinstance_version'),
user => hiera('oracle_os_user'),
group => hiera('oracle_os_group'),
download_dir => hiera('oracle_download_dir'),
action => 'create',
db_name => hiera('oracle_database_name'),
db_domain => hiera('oracle_database_domain_name'),
sys_password => hiera('oracle_database_sys_password'),
system_password => hiera('oracle_database_system_password'),
character_set => "AL32UTF8",
nationalcharacter_set => "UTF8",
sample_schema => 'FALSE',
memory_percentage => "40",
memory_total => "800",
database_type => "MULTIPURPOSE",
em_configuration => "NONE",
storage_type => "ASM",
asm_snmp_password => 'Welcome01',
asm_diskgroup => 'DATA',
recovery_area_destination => 'DATA',
require => Oradb::Opatch['19791420_db_patch_2'],
}
# 12.2 on asm
oradb::database{ 'oraDb':
oracle_base => lookup('oracle_base_dir'),
oracle_home => lookup('oracle_home_dir'),
version => lookup('dbinstance_version'),
user => lookup('oracle_os_user'),
group => lookup('oracle_os_group'),
download_dir => lookup('oracle_download_dir'),
action => 'create',
db_name => lookup('oracle_database_name'),
db_domain => lookup('oracle_database_domain_name'),
sys_password => lookup('oracle_database_sys_password'),
system_password => lookup('oracle_database_system_password'),
# template => 'dbtemplate_12.1_asm',
character_set => 'AL32UTF8',
nationalcharacter_set => 'UTF8',
sample_schema => 'false',
memory_percentage => 40,
memory_total => 2880,
automatic_memory_management => false,
database_type => 'MULTIPURPOSE',
em_configuration => 'NONE',
storage_type => 'ASM',
asm_snmp_password => 'Welcome01',
asm_diskgroup => '+DATA/{DB_UNIQUE_NAME}',
data_file_destination => '+DATA/{DB_UNIQUE_NAME}',
recovery_diskgroup => '+RECO',
recovery_area_destination => '+RECO',
puppet_download_mnt_point => 'oradb/',
require => Ora_asm_diskgroup['RECO@+ASM'],
}
Oracle Database Client
oradb::client{ '12.2.0.1_Linux-x86-64':
version => '12.2.0.1',
file => 'V839967-01.zip',
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.2/client',
remote_file => false,
log_output => true,
puppet_download_mnt_point => lookup('oracle_source'),
}
or
oradb::client{ '12.1.0.1_Linux-x86-64':
version => '12.1.0.1',
file => 'linuxamd64_12c_client.zip',
oracle_base => '/oracle',
oracle_home => '/oracle/product/12.1/client',
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
download_dir => '/install',
bash_profile => true,
remote_file => true,
puppet_download_mnt_point => "oradb/",
logoutput => true,
}
or
oradb::client{ '11.2.0.1_Linux-x86-64':
version => '11.2.0.1',
file => 'linux.x64_11gR2_client.zip',
oracle_base => '/oracle',
oracle_home => '/oracle/product/11.2/client',
user => 'oracle',
group => 'dba',
group_install => 'oinstall',
download_dir => '/install',
bash_profile => true,
remote_file => false,
puppet_download_mnt_point => "/software",
logoutput => true,
}
Enterprise Manager
oradb::installem{ 'em12104':
version => '12.1.0.4',
file => 'em12104_linux64',
oracle_base_dir => '/oracle',
oracle_home_dir => '/oracle/product/12.1/em',
agent_base_dir => '/oracle/product/12.1/agent',
software_library_dir => '/oracle/product/12.1/swlib',
weblogic_user => 'weblogic',
weblogic_password => 'Welcome01',
database_hostname => 'emdb.example.com',
database_listener_port => 1521,
database_service_sid_name => 'emrepos.example.com',
database_sys_password => 'Welcome01',
sysman_password => 'Welcome01',
agent_registration_password => 'Welcome01',
deployment_size => 'SMALL',
user => 'oracle',
group => 'oinstall',
download_dir => '/install',
zip_extract => true,
puppet_download_mnt_point => '/software',
remote_file => false,
log_output => true,
}
oradb::installem{ 'em13200':
version => '13.2.0.0',
file => 'em13200p1_linux64',
oracle_base_dir => '/oracle',
oracle_home_dir => '/oracle/product/13.2/em',
agent_base_dir => '/oracle/product/13.2/agent',
software_library_dir => '/oracle/product/13.2/swlib',
weblogic_user => 'weblogic',
weblogic_password => 'Welcome01',
database_hostname => 'emdb.example.com',
database_listener_port => 1521,
database_service_sid_name => 'emrepos.example.com',
database_sys_password => 'Welcome01',
sysman_password => 'Welcome01',
agent_registration_password => 'Welcome01',
deployment_size => 'SMALL',
user => 'oracle',
group => 'oinstall',
download_dir => '/var/tmp/install',
zip_extract => false,
puppet_download_mnt_point => '/software',
remote_file => false,
log_output => true,
}
oradb::installem_agent{ 'em12104_agent':
version => '12.1.0.4',
source => 'https://10.10.10.25:7802/em/install/getAgentImage',
install_type => 'agentPull',
install_platform => 'Linux x86-64',
oracle_base_dir => '/oracle',
agent_base_dir => '/oracle/product/12.1/agent',
agent_instance_home_dir => '/oracle/product/12.1/agent/agent_inst',
sysman_user => 'sysman',
sysman_password => 'Welcome01',
agent_registration_password => 'Welcome01',
agent_port => 1830,
oms_host => '10.10.10.25',
oms_port => 7802,
em_upload_port => 4903,
user => 'oracle',
group => 'dba',
download_dir => '/var/tmp/install',
log_output => true,
oracle_hostname => 'emdb.example.com', # FQDN hostname where to install on
}
oradb::installem_agent{ 'em13200_agent':
version => '13.2.0.0',
source => 'https://10.10.10.25:7799/em/install/getAgentImage',
install_type => 'agentPull',
install_platform => 'Linux x86-64',
install_version => '13.2.0.0.0',
oracle_base_dir => '/oracle',
agent_base_dir => '/oracle/product/13.2/agent',
agent_instance_home_dir => '/oracle/product/13.2/agent/agent_inst',
sysman_user => 'sysman',
sysman_password => 'Welcome01',
agent_registration_password => 'Welcome01',
agent_port => 1830,
oms_host => '10.10.10.25',
oms_port => 7799,
em_upload_port => 4889,
oracle_hostname => 'emdb.example.com',
user => 'oracle',
group => 'dba',
download_dir => '/var/tmp/install',
log_output => true,
}
oradb::installem_agent{ 'em12104_agent2':
version => '12.1.0.4',
source => '/var/tmp/install/agent.zip',
install_type => 'agentDeploy',
oracle_base_dir => '/oracle',
agent_base_dir => '/oracle/product/12.1/agent2',
agent_instance_home_dir => '/oracle/product/12.1/agent2/agent_inst',
agent_registration_password => 'Welcome01',
agent_port => 1832,
oms_host => '10.10.10.25',
em_upload_port => 4903,
user => 'oracle',
group => 'dba',
download_dir => '/var/tmp/install',
log_output => true,
}
Oracle GoldenGate 12.1.2 and 11.2.1
$groups = ['oinstall','dba']
group { $groups :
ensure => present,
before => User['ggate'],
}
user { 'ggate' :
ensure => present,
gid => 'dba',
groups => $groups,
shell => '/bin/bash',
password => '$1$DSJ51vh6$4XzzwyIOk6Bi/54kglGk3.',
home => "/home/ggate",
comment => "This user ggate was created by Puppet",
managehome => true,
}
oradb::goldengate{ 'ggate12.1.2':
version => '12.1.2',
file => '121200_fbo_ggs_Linux_x64_shiphome.zip',
database_type => 'Oracle',
database_version => 'ORA11g',
database_home => '/oracle/product/12.1/db',
oracle_base => '/oracle',
goldengate_home => "/oracle/product/12.1/ggate",
manager_port => 16000,
user => 'ggate',
group => 'dba',
group_install => 'oinstall',
download_dir => '/install',
puppet_download_mnt_point => hiera('oracle_source'),
require => User['ggate'],
}
file { "/oracle/product/11.2.1" :
ensure => directory,
recurse => false,
replace => false,
mode => '0775',
owner => 'ggate',
group => 'dba',
require => Oradb::Goldengate['ggate12.1.2'],
}
oradb::goldengate{ 'ggate11.2.1':
version => '11.2.1',
file => 'ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip',
tar_file => 'fbo_ggs_Linux_x64_ora11g_64bit.tar',
goldengate_home => "/oracle/product/11.2.1/ggate",
user => 'ggate',
group => 'dba',
download_dir => '/install',
puppet_download_mnt_point => hiera('oracle_source'),
require => File["/oracle/product/11.2.1"],
}
oradb::goldengate{ 'ggate11.2.1_java':
version => '11.2.1',
file => 'V38714-01.zip',
tar_file => 'ggs_Adapters_Linux_x64.tar',
goldengate_home => "/oracle/product/11.2.1/ggate_java",
user => 'ggate',
group => 'dba',
group_install => 'oinstall',
download_dir => '/install',
puppet_download_mnt_point => hiera('oracle_source'),
require => File["/oracle/product/11.2.1"],
}
Oracle SOA Suite Repository Creation Utility (RCU)
product =
- soasuite
- webcenter
- all
RCU examples
soa suite repository
oradb::rcu{'DEV_PS6':
rcu_file => 'ofm_rcu_linux_11.1.1.7.0_32_disk1_1of1.zip',
product => 'soasuite',
version => '11.1.1.7',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
download_dir => '/install',
action => 'create',
db_server => 'dbagent1.alfa.local:1521',
db_service => 'test.oracle.com',
sys_password => 'Welcome01',
schema_prefix => 'DEV',
repos_password => 'Welcome02',
}
webcenter repository with a fixed temp tablespace
oradb::rcu{'DEV2_PS6':
rcu_file => 'ofm_rcu_linux_11.1.1.7.0_32_disk1_1of1.zip',
product => 'webcenter',
version => '11.1.1.7',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
download_dir => '/install',
action => 'create',
db_server => 'dbagent1.alfa.local:1521',
db_service => 'test.oracle.com',
sys_password => 'Welcome01',
schema_prefix => 'DEV',
temp_tablespace => 'TEMP',
repos_password => 'Welcome02',
}
delete a repository
oradb::rcu{'Delete_DEV3_PS5':
rcu_file => 'ofm_rcu_linux_11.1.1.6.0_disk1_1of1.zip',
product => 'soasuite',
version => '11.1.1.6',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
download_dir => '/install',
action => 'delete',
db_server => 'dbagent1.alfa.local:1521',
db_service => 'test.oracle.com',
sys_password => 'Welcome01',
schema_prefix => 'DEV3',
repos_password => 'Welcome02',
}
OIM, OAM repository, OIM needs an Oracle Enterprise Edition database
oradb::rcu{'DEV_1112':
rcu_file => 'V37476-01.zip',
product => 'oim',
version => '11.1.2.1',
oracle_home => '/oracle/product/11.2/db',
user => 'oracle',
group => 'dba',
download_dir => '/data/install',
action => 'create',
db_server => 'oimdb.alfa.local:1521',
db_service => 'oim.oracle.com',
sys_password => hiera('database_test_sys_password'),
schema_prefix => 'DEV',
repos_password => hiera('database_test_rcu_dev_password'),
puppet_download_mnt_point => $puppet_download_mnt_point,
logoutput => true,
require => Oradb::Dbactions['start oimDb'],
}
Solaris 10 kernel, ulimits and required packages
exec { "create /cdrom/unnamed_cdrom":
command => "/usr/bin/mkdir -p /cdrom/unnamed_cdrom",
creates => "/cdrom/unnamed_cdrom",
}
mount { "/cdrom/unnamed_cdrom":
device => "/dev/dsk/c0t1d0s2",
fstype => "hsfs",
ensure => "mounted",
options => "ro",
atboot => true,
remounts => false,
require => Exec["create /cdrom/unnamed_cdrom"],
}
$install = [
'SUNWarc','SUNWbtool','SUNWcsl',
'SUNWdtrc','SUNWeu8os','SUNWhea',
'SUNWi1cs', 'SUNWi15cs',
'SUNWlibC','SUNWlibm','SUNWlibms',
'SUNWsprot','SUNWpool','SUNWpoolr',
'SUNWtoo','SUNWxwfnt'
]
package { $install:
ensure => present,
adminfile => "/vagrant/pkgadd_response",
source => "/cdrom/unnamed_cdrom/Solaris_10/Product/",
require => [Exec["create /cdrom/unnamed_cdrom"],
Mount["/cdrom/unnamed_cdrom"]
],
}
package { 'SUNWi1of':
ensure => present,
adminfile => "/vagrant/pkgadd_response",
source => "/cdrom/unnamed_cdrom/Solaris_10/Product/",
require => Package[$install],
}
# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcsl SUNWdtrc
# pkgadd -d /cdrom/unnamed_cdrom/Solaris_10/Product/ -r response -a response SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcsl SUNWdtrc
$all_groups = ['oinstall','dba' ,'oper']
group { $all_groups :
ensure => present,
}
user { 'oracle' :
ensure => present,
uid => 500,
gid => 'oinstall',
groups => ['oinstall','dba','oper'],
shell => '/bin/bash',
password => '$1$DSJ51vh6$4XzzwyIOk6Bi/54kglGk3.',
home => "/home/oracle",
comment => "This user oracle was created by Puppet",
require => Group[$all_groups],
managehome => true,
}
$execPath = "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:"
exec { "projadd max-shm-memory":
command => "projadd -p 102 -c 'ORADB' -U oracle -G dba -K 'project.max-shm-memory=(privileged,4G,deny)' ORADB",
require => [ User["oracle"],
Package['SUNWi1of'],
Package[$install],
],
unless => "projects -l | grep -c ORADB",
path => $execPath,
}
exec { "projmod max-sem-ids":
command => "projmod -s -K 'project.max-sem-ids=(privileged,100,deny)' ORADB",
subscribe => Exec["projadd max-shm-memory"],
require => Exec["projadd max-shm-memory"],
refreshonly => true,
path => $execPath,
}
exec { "projmod max-shm-ids":
command => "projmod -s -K 'project.max-shm-ids=(privileged,100,deny)' ORADB",
require => Exec["projmod max-sem-ids"],
subscribe => Exec["projmod max-sem-ids"],
refreshonly => true,
path => $execPath,
}
exec { "projmod max-sem-nsems":
command => "projmod -s -K 'process.max-sem-nsems=(privileged,256,deny)' ORADB",
require => Exec["projmod max-shm-ids"],
subscribe => Exec["projmod max-shm-ids"],
refreshonly => true,
path => $execPath,
}
exec { "projmod max-file-descriptor":
command => "projmod -s -K 'process.max-file-descriptor=(basic,65536,deny)' ORADB",
require => Exec["projmod max-sem-nsems"],
subscribe => Exec["projmod max-sem-nsems"],
refreshonly => true,
path => $execPath,
}
exec { "projmod max-stack-size":
command => "projmod -s -K 'process.max-stack-size=(privileged,32MB,deny)' ORADB",
require => Exec["projmod max-file-descriptor"],
subscribe => Exec["projmod max-file-descriptor"],
refreshonly => true,
path => $execPath,
}
exec { "usermod oracle":
command => "usermod -K project=ORADB oracle",
require => Exec["projmod max-stack-size"],
subscribe => Exec["projmod max-stack-size"],
refreshonly => true,
path => $execPath,
}
exec { "ndd 1":
command => "ndd -set /dev/tcp tcp_smallest_anon_port 9000",
require => Exec["usermod oracle"],
path => $execPath,
}
exec { "ndd 2":
command => "ndd -set /dev/tcp tcp_largest_anon_port 65500",
require => Exec["ndd 1"],
path => $execPath,
}
exec { "ndd 3":
command => "ndd -set /dev/udp udp_smallest_anon_port 9000",
require => Exec["ndd 2"],
path => $execPath,
}
exec { "ndd 4":
command => "ndd -set /dev/udp udp_largest_anon_port 65500",
require => Exec["ndd 3"],
path => $execPath,
}
exec { "ulimit -S":
command => "ulimit -S -n 4096",
require => Exec["ndd 4"],
path => $execPath,
}
exec { "ulimit -H":
command => "ulimit -H -n 65536",
require => Exec["ulimit -S"],
path => $execPath,
}
Solaris 11 kernel, ulimits and required packages
package { ['shell/ksh', 'developer/assembler']:
ensure => present,
}
$install = "pkg:/group/prerequisite/oracle/oracle-rdbms-server-12-1-preinstall"
package { $install:
ensure => present,
}
$groups = ['oinstall','dba' ,'oper' ]
group { $groups :
ensure => present,
}
user { 'oracle' :
ensure => present,
uid => 500,
gid => 'dba',
groups => $groups,
shell => '/bin/bash',
password => '$1$DSJ51vh6$4XzzwyIOk6Bi/54kglGk3.',
home => "/export/home/oracle",
comment => "This user oracle was created by Puppet",
require => Group[$groups],
managehome => true,
}
$execPath = "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:"
exec { "projadd group.dba":
command => "projadd -U oracle -G dba -p 104 group.dba",
require => User["oracle"],
unless => "projects -l | grep -c group.dba",
path => $execPath,
}
exec { "usermod oracle":
command => "usermod -K project=group.dba oracle",
require => [User["oracle"],Exec["projadd group.dba"],],
path => $execPath,
}
exec { "projmod max-shm-memory":
command => "projmod -sK 'project.max-shm-memory=(privileged,4G,deny)' group.dba",
require => [User["oracle"],Exec["projadd group.dba"],],
path => $execPath,
}
exec { "projmod max-sem-ids":
command => "projmod -sK 'project.max-sem-ids=(privileged,100,deny)' group.dba",
require => Exec["projadd group.dba"],
path => $execPath,
}
exec { "projmod max-shm-ids":
command => "projmod -s -K 'project.max-shm-ids=(privileged,100,deny)' group.dba",
require => Exec["projadd group.dba"],
path => $execPath,
}
exec { "projmod max-sem-nsems":
command => "projmod -sK 'process.max-sem-nsems=(privileged,256,deny)' group.dba",
require => Exec["projadd group.dba"],
path => $execPath,
}
exec { "projmod max-file-descriptor":
command => "projmod -sK 'process.max-file-descriptor=(basic,65536,deny)' group.dba",
require => Exec["projadd group.dba"],
path => $execPath,
}
exec { "projmod max-stack-size":
command => "projmod -sK 'process.max-stack-size=(privileged,32MB,deny)' group.dba",
require => Exec["projadd group.dba"],
path => $execPath,
}
exec { "ipadm smallest_anon_port tcp":
command => "ipadm set-prop -p smallest_anon_port=9000 tcp",
path => $execPath,
}
exec { "ipadm smallest_anon_port udp":
command => "ipadm set-prop -p smallest_anon_port=9000 udp",
path => $execPath,
}
exec { "ipadm largest_anon_port tcp":
command => "ipadm set-prop -p largest_anon_port=65500 tcp",
path => $execPath,
}
exec { "ipadm largest_anon_port udp":
command => "ipadm set-prop -p largest_anon_port=65500 udp",
path => $execPath,
}
exec { "ulimit -S":
command => "ulimit -S -n 4096",
path => $execPath,
}
exec { "ulimit -H":
command => "ulimit -H -n 65536",
path => $execPath,
}
Version updates
3.0.19
- added support for 19.3 (19.0.0.0) grid, db & client
3.0.18
- added support for 18.3 (18.0.0.0) grid, db & client
- added emagent version 12.1.0.3
- opatch set user/group permissions with remote source
- opatchupgrade works now on grid 12.2 home
3.0.17
- same as 3.0.16 (which had missing templates)
- pdk build
3.0.16
- fix database.pp change parameter storage_type to optional, to use template file without parameter -datafileDestination (issue #197)
- Modifying database_pluggable so it supports ASM support
- Adding 32bit Client install
- Support goldengate 12.3.0
3.0.15
- fix autostart and removed the hard dbora reference
3.0.14
- database.pp & data_file_destination went wrong with dbt templates
- fix dbt templates for memory_total param
- Allow 'SE2', 'HP', 'XP', 'PE' as 12.2 database type
3.0.13
- opatchupgrade now also has remote_file parameter
- opatchupgrade fix error when supportid is supplied
- database.pp check if data_file_destination is provided with a template
3.0.12
- db_domain is optional again on database.pp
- opatchupgrade, fixed the version check for doing emocmrsp or not
3.0.11
- installdb new groups options like group_backup, group_dg ,group_km ,group_rac
- remove the container restriction on 12.2
- added LDAP to netca
- cleanup on installdb works now for only 1 install binary
- allow the creation of grid home & base on installasm
- fix installasm 12.2 issue with CRS_SWONLY
3.0.10
- fix opatch for normal patches
- fix opatch success check for grid
3.0.9
- fix database own dbttemplate issue with double -variablesFile error
- 12.2 db requires always container database = true
- chown fix on directories without -R
- opatch facts fix
- added extra stop & start in dbora_Linux startup script
3.0.8
- 12.2 db rsp template had a listener error
3.0.7
- database.pp now also use init_params for dbt templates
- database.pp set sid with db_name on dbt templates
- database.pp changed template_variables for dbt templates to a hash
3.0.6
- Support Enterpise manager 13.2.0.0
- Support EM agent 13.2.0.0
3.0.5
- opatch upgrade fix, emocmrsp is not necessary when version >= 12.2.0.1.5
- database parameter data_file_destination is required when version = 12.2 plus template and storage_type are defined
3.0.4
- 12.2.0.1 grid support
3.0.3
- added docs
- added goldengate 12.2.1 for Oracle Database
- 12.2.0.1 installdb + database + pluggable db support
- 12.2.0.1 client support
3.0.2
- migrated to puppet 4 functions
- Fix ASM disk does not exist error during database creation
3.0.1
- Epp template fixes for optional fields on grid, installdb & database.pp
3.0.0
- Puppet 4 new features, removed support for Puppet 3, please use latest version 2.X of oradb
2.0.9
- variables support for dbt templates with parameter template_variables
- bash_profile also loads bashrc when it exists
2.0.8
- Add opatch_patches structured fact but requires stdlib 4.11
- new function is_oracle_patch_installed
- RCU fixes for running as non-root user
- Resolve idempotence issue which happens when a patch from the same source needs to be applied multiple times
- dbactions.pp or db_control supports now also mount
2.0.7
- In case of a template, set character parameter for the default database build command. It is being set to AL32UTF8.
- installasm new 12.1.0.2 storage_option values 'LOCAL_ASM_STORAGE', 'FLEX_ASM_STORAGE', 'CLIENT_ASM_STORAGE', 'FILE_SYSTEM_STORAGE'
- installasm bash_profile parameter
- installasm remote_node parameter, ability to execute orainstRoot.sh and root.sh on remode node
- installdb new 12.1.0.2 database_type values 'EE','SE2'
- installdb, handling 2 installations of the same oracle database version on the same host
- installdb, remote_node parameter, ability to execute root.sh on remode node
- installem_agent option to not manage curl
- db_control startup in mount status for standby databases
- database.pp use cluster_nodes for -nodelist parameter
2.0.6
- Seeded database template support
- oracle_hostname parameter for emagent
- puppet 4 fixes
2.0.5
- EM agent, Move sysman parameter validation to agentpull block
- Fix rcu status check, rollback from version 2.0.1
- ASM service fix for RHEL7
2.0.4
- dbtemplate_12.1.dbt database template should also work for 12.1.0.2
- db_structure fixes, correct permissions and chown order
- support for Enterprise Manager 12.1.0.5
2.0.3
- some more strict file permissions
- rcu allows now more complex passwords
- allow to change the service name instead of dbora
- installdb is_rack_one_install option for 12.1.0.2
- db_control type & dbcontrol manifest supports now also Grid
- security/permissions fixes with files which can contain passwords
2.0.2
- support the new opatchauto utility instead of opatch auto by use_opatchauto_utility => true
- support 12.1 CDB with custom database template
- changed the default oraInventory location when it is not defined
2.0.1
- bash_profile option for database clients
- rcu 11g fix
- 12.1.0.2 oracle client template
- db_listener type refreshonly fix
2.0.0
- All parameters of classes or defines are now in snake case and not in camel case
1.0.35
- Add support for Grid 12.1.0.2 (installasm)
- Fix unsetted vars in dbora template
- Added ability to put listener entries in tnsnames.ora
1.0.34
- autostart fix so it also works for Oracle Linux 5
- rcu prefix compare check fix ( Uppercase )
- RCU fixes for OIM or OAM 11.1.1.2.3
- installem em_upload_port parameter type fix
1.0.33
- Small Suse fix for the autostart service
- new installdb attribute cleanup_installfile
- option to provide the sys username for RCU
1.0.32
- be able to provide a listener name for starting the oracle listener ( manifest and custom type)
1.0.31
- installasm, stand alone parameter in combination with $grid_type == 'CRS_SWONLY' used as standalone or in RAC
- installasm, .profile fix for ORACLE_SID in case grid_type = HA_CONFIG -> +ASM or in grid_type = CRS_CONFIG -> +ASM1
1.0.30
- Removed Oracle Home under base check for ASM installations, in CRS_CONFIG or CRS_SWONLY this is not right
1.0.29
- Custom type for oracle db/asm/client/em directory structure instead of using dirtree and some oradb manifests
1.0.28
- fixed database install rsp 12.1.0.2
- db_listener custom puppet type/provider, listener.pp calls this type
1.0.27
- solaris fix for database.pp and opatch auto
- puppet_download_mnt_point parameter for database.pp which can be used for own db template
1.0.26
- Removed create_user functionality in installdb & client, Puppet should do it instead of oradb module
- Support for 12.1 pluggable database
- init_params of database.pp now also support a hash besides a comma separated string
- Refactored dbstructure so it works with multiple oracle homes
- Goldengate 12.1.2 now uses dbstructure
1.0.25
- added extra parameter validation to installdb, installasm and installem_agent
- opatch fix for opatch bundle zip files which has subfolders in the zip
- owner of the grid home or oracle home folder fix
- renamed clusterware parameter of the opatch type to opatch_auto
- storage_type parameter is now also used in the dbca command when using a database template
- Added ASM 11.2 Database template
1.0.24
- Enterprise Manager agent install with AgentPull & AgentDeploy
- Cleanup install zip files and extracted installation folder in installdb, installasm, installem and client
1.0.23
- Enterprise Manager 12.1.0.4 server installation support
- Support for Solaris 11.2
- autostart service for Solaris
1.0.22
- db_control puppet resource type, start or stop an instance or subscribe to changes like init_param
- Tnsnames change so it supports a TNS balanced configuration
- changed oraInst.loc permissions to 0755
1.0.21
- fix for windows/unix linefeed when oradb is used in combination with vagrant on a windows host
- opatch check bug when run it twice
- Add a tnsnames entry support
1.0.20
- Create a Database instance based on a template
- Be able to change the default listener port 1521 in net.pp & database.pp
- Opatch fix to apply same the patch twice on different oracle homes
1.0.19
- OPatch support for clusterware (GRID)
- Opatchupgrade now works for grid & database on the same node
1.0.18
- Puppet Lint fixes
- Rubocop fixes
- 12.1 Template fix for Oracle RAC
1.0.17
- Fix for puppet 3.7 and more strict parsing
- OPatch also checks for OPatch succeeded
- RAC installation parameters for database, installasm, installdb
1.0.16
- cleanup readme
- asm/grid for 12.1.0.1 & installasm fix for Oracle Restart fix, 11.2.0.1 rsp template fix
1.0.15
- RCU fix for multiple FMW Repositories, installasm fix with zip_extract = false
1.0.14
- Rename some internal manifest to avoid a conflict with orawls
1.0.13
- Oracle Database & Client 12.1.0.2 Support
1.0.11
- database client fix with remote file, set db_snmp_password on a database
1.0.10
- oraInst.loc bug fix, option to skip installdb bash profile
1.0.9
- 11.2 EE install options
1.0.8
- RCU & Opatch fixes in combination with ruby 1.9.3
1.0.7
- Added unit tests and OPatch upgrade support without OCM registration
1.0.6
- Grid install and ASM support
1.0.5
- refactored installdb and support for oinstall groups
1.0.4
- db_rcu native type used in rcu.pp
1.0.2
- db_opatch native type used in opatch.pp
1.0.1
- autostart multiple databases, small fixes
1.0.0
- oracle module add##on for user,role and tablespace creation
0.9.9
- em_configuration parameter for Database creation
0.9.7
- Oracle database 11.2.0.1, 12.1.0.1 client support, refactored installdb,net,goldengate
Dependencies
- puppetlabs/concat (>= 2.1.0 < 5.0.0)
- puppetlabs/stdlib (>= 4.13.0 < 5.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.