Browse Source

Merged in FM-4693-first-version (pull request #1)

FM-4693 - First version
tags/0.1.1
Guillaume Donval 3 years ago
parent
commit
87b6bcff74
16 changed files with 830 additions and 1 deletions
  1. +8
    -0
      .gitignore
  2. +69
    -0
      .kitchen.yml
  3. +4
    -0
      Berksfile
  4. +1
    -0
      Jenkinsfile
  5. +7
    -0
      LICENSE
  6. +42
    -1
      README.md
  7. +106
    -0
      chefignore
  8. +14
    -0
      metadata.rb
  9. +18
    -0
      recipes/kitchen.rb
  10. +194
    -0
      resources/oracle_client_fx_linux.rb
  11. +7
    -0
      templates/default/etc/profile.d/oracle.sh.erb
  12. +54
    -0
      templates/default/oracle-home/11.2/install/oraparam.ini.erb
  13. +3
    -0
      templates/default/oracle-home/11.2/network/admin/sqlnet.ora.erb
  14. +217
    -0
      templates/default/oracle-home/11.2/response/client_install.rsp.erb
  15. +2
    -0
      templates/default/oracle-inventory/11.2/oraInst.loc.erb
  16. +84
    -0
      test/integration/linux/default.rb

+ 8
- 0
.gitignore View File

@@ -0,0 +1,8 @@
# test kitchen
.kitchen/
.kitchen.local.yml

# Chef
Berksfile.lock
.zero-knife.rb
Policyfile.lock.json

+ 69
- 0
.kitchen.yml View File

@@ -0,0 +1,69 @@
---
driver:
name: gce
project: dazzlingwrench
region: us-east1
preemptible: true
metadata:
ssh-keys: <%= 'kitchenuser:' + IO.binread("/tmp/id_rsa.pub").rstrip! %>
tags:
- fxinnovation

provisioner:
name: chef_zero

verifier:
name: inspec
sudo: true
format: junit
output: "%{platform}_%{suite}_inspec.xml"

transport:
username: kitchenuser
ssh_key: /tmp/id_rsa

platforms:
- name: centos6
driver:
image_project: centos-cloud
image_family: centos-6
- name: centos7
driver:
image_project: centos-cloud
image_family: centos-7
- name: redhat6
driver:
image_project: rhel-cloud
image_family: rhel-6
- name: redhat7
driver:
image_project: rhel-cloud
image_family: rhel-7

suites:
- name: oracle_client
run_list:
- recipe[oracle_client_fx::kitchen]
attributes:
oracle_client_fx:
kitchen:
java_version: '8'
version: '11.2'
source: 'http://35.186.216.115/repository/public/oracle/11.2/client/linux.x64_11gR2_client_patched.zip'
checksum: '88b4a4abb57f7e94941fe21fa99f8481868badf2e1e0749522bba53450f880c2'
sqlnet_options:
WALLET_LOCATION: '(SOURCE = (METHOD = FILE) (METHOD_DATA = (DIRECTORY = $ORACLE_HOME/ssl_wallet)))'
SSL_CLIENT_AUTHENTICATION: 'FALSE'
SSL_VERSION: '1.0'
SSL_CIPHER_SUITES': '(SSL_RSA_WITH_AES_256_CBC_SHA)'
SSL_SERVER_DN_MATCH': 'ON'
tls_certificate_url: 'https://s3.amazonaws.com/rds-downloads/rds-ca-2015-root.pem'
tnsnames_options: ''
verifier:
inspec_tests:
- path: test/integration/linux/default.rb
includes:
- centos6
- centos7
- redhat6
- redhat7

+ 4
- 0
Berksfile View File

@@ -0,0 +1,4 @@
# frozen_string_literal: true
source 'https://supermarket.chef.io'

metadata

+ 1
- 0
Jenkinsfile View File

@@ -0,0 +1 @@
fx_cookbook()

+ 7
- 0
LICENSE View File

@@ -0,0 +1,7 @@
Copyright 2018 FXinnovation Inc

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 42
- 1
README.md View File

@@ -1,2 +1,43 @@
# public-common-cookbook-oracle_client_fx
# oracle_client_fx

The oracle_client_fx cookbook provides a resource to install Oracle client.

### Supported oracle version
* 11.2.0.4 (careful, the public Oracle version 11.2.0.1 is not supported)

## Requirements

### Cookbooks
N/A

### Chef
* `>= 13.9`

### Platforms
* rhel6
* rhel7
* centos6
* centos7

## Resources
### oracle_client_fx

#### Properties

| Name | Type | Required | Default | Operating System | Description |
| --------------------- | ------------- | -------- | ------- | ---------------- | ----------- |
| `java_version` | `%w(8 10 11)` | `true` | 8 | `All` | Java version to install. |
| `user` | `String` | `true` | oracle | `All` | Oracle client username. |
| `group` | `String` | `true` | dba | `All` | Oracle client group. |
| `version` | `['11.2']` | `true` | 11.2 | `All` | Version to install. |
| `source` | `String` | `true` | - | `All` | Source URL of the oracle client zip file. |
| `checksum` | `String` | `false` | - | `All` | Checksum of the oracle client zip file to verify. |
| `sqlnet_options` | `Hash` | `false` | {} | `All` | sqlnet.ora file options. |
| `tnsnames_options` | `String` | `false` | '' | `All` | tnsnames.ora file content. |
| `tls_certificate_url` | `String` | `false` | '' | `All` | URL of the root certificate to add in the client wallet. |

## Versionning
This cookbook will follow semantic versionning 2.0.0 as described [here](https://semver.org/)

## Licence
MIT

+ 106
- 0
chefignore View File

@@ -0,0 +1,106 @@
# Put files/directories that should be ignored in this file when uploading
# to a chef-server or supermarket.
# Lines that start with '# ' are comments.

# OS generated files #
######################
.DS_Store
Icon?
nohup.out
ehthumbs.db
Thumbs.db

# SASS #
########
.sass-cache

# EDITORS #
###########
\#*
.#*
*~
*.sw[a-z]
*.bak
REVISION
TAGS*
tmtags
*_flymake.*
*_flymake
*.tmproj
.project
.settings
mkmf.log

## COMPILED ##
##############
a.out
*.o
*.pyc
*.so
*.com
*.class
*.dll
*.exe
*/rdoc/

# Testing #
###########
.watchr
.rspec
spec/*
spec/fixtures/*
features/*
examples/*
Guardfile
Procfile
.kitchen*
.rubocop.yml
spec/*
Rakefile
.travis.yml
.foodcritic
.codeclimate.yml

# SCM #
#######
.git
*/.git
.gitignore
.gitmodules
.gitconfig
.gitattributes
.svn
*/.bzr/*
*/.hg/*
*/.svn/*

# Berkshelf #
#############
Berksfile
Berksfile.lock
cookbooks/*
tmp

# Policyfile #
##############
Policyfile.rb
Policyfile.lock.json

# Cookbooks #
#############
CONTRIBUTING*
CHANGELOG*
TESTING*
MAINTAINERS.toml

# Strainer #
############
Colanderfile
Strainerfile
.colander
.strainer

# Vagrant #
###########
.vagrant
Vagrantfile

+ 14
- 0
metadata.rb View File

@@ -0,0 +1,14 @@
name 'oracle_client_fx'
maintainer 'FX Innovation'
maintainer_email 'cloudsquad@fxinnovation.com'
license 'MIT'
description 'Installs/Configures oracle client.'
long_description 'Installs/Configures oracle client.'
supports 'redhat', '>= 6.0'
supports 'centos', '>= 6.0'
version '0.1.0'
chef_version '>= 12.24' if respond_to?(:chef_version)
source_url 'https://bitbucket.org/fxadmin/public-common-cookbook-oracle_client_fx/'
issues_url 'https://bitbucket.org/fxadmin/public-common-cookbook-oracle_client_fx/issues/'
depends 'java', '~> 2.0.0'
depends 'unzip_fx'

+ 18
- 0
recipes/kitchen.rb View File

@@ -0,0 +1,18 @@
#
# cookbook::oracle_client_fx
# recipe::kitchen
#
# author::fxinnovation
# description::Test recipe used for kitchen tests
#

oracle_client_fx 'kitchen' do
java_version node['oracle_client_fx']['kitchen']['java_version']
version node['oracle_client_fx']['kitchen']['version']
source node['oracle_client_fx']['kitchen']['source']
checksum node['oracle_client_fx']['kitchen']['checksum']
sqlnet_options node['oracle_client_fx']['kitchen']['sqlnet_options']
tnsnames_options node['oracle_client_fx']['kitchen']['tnsnames_options']
tls_certificate_url node['oracle_client_fx']['kitchen']['tls_certificate_url']
action :build
end

+ 194
- 0
resources/oracle_client_fx_linux.rb View File

@@ -0,0 +1,194 @@
#
# cookbook::oracle_client_fx
# resource::oracle_client_fx
#
# author::fxinnovation
# description::Installs oracle client on linux
#
resource_name :oracle_client_fx

provides :oracle_client_fx, os: 'linux'

property :java_version, %w(8 10 11), default: '8'
property :user, String, default: 'oracle'
property :group, String, default: 'dba'
property :version, ['11.2'], default: '11.2'
property :source, String
property :checksum, String
property :sqlnet_options, Hash, default: {}
property :tnsnames_options, String, default: ''
property :tls_certificate_url, String, default: ''

action :build do
base_path = '/opt/oracle'
var_path = '/var/oracle'
home_path = "#{base_path}/product/#{new_resource.version}"
bin_path = "#{home_path}/bin"
lib_path = "#{home_path}/lib"
wallet_path = "#{home_path}/ssl_wallet"
dependencies = %w(compat-libstdc++-33.i686 glibc.i686 unixODBC.i686 gcc-c++ gcc compat-libstdc++-33 glibc unixODBC elfutils-libelf-devel libstdc++ libaio-devel unixODBC-devel sysstat)

node.default['java']['jdk_version'] = new_resource.java_version
include_recipe 'java::default'

declare_resource(:group, new_resource.group) do
append true
system true
end

declare_resource(:user, new_resource.user) do
comment 'Oracle user.'
gid new_resource.group
system true
manage_home false
end

dependencies.each do |oracle_dependency|
package oracle_dependency
end

template '/etc/profile.d/oracle.sh' do
source 'etc/profile.d/oracle.sh.erb'
owner 'root'
group 'root'
mode '0755'
variables(
home_path: home_path,
bin_path: bin_path,
lib_path: lib_path,
var_path: var_path
)
verify 'bash -n %{path}'
end

file '/etc/ld.so.conf.d/oracle.conf' do
content lib_path
owner 'root'
group 'root'
mode '0644'
end

directory base_path do
owner new_resource.user
group new_resource.group
mode '2755'
action :create
end

directory var_path do
owner new_resource.user
group new_resource.group
mode '2775'
action :create
end

template "#{var_path}/oraInst.loc" do
source "oracle-inventory/#{new_resource.version}/oraInst.loc.erb"
owner new_resource.user
group new_resource.group
mode '0664'
variables(
var_path: var_path,
group: new_resource.group
)
end

unzip_fx "linux-oracle_client-#{new_resource.version}" do
source new_resource.source
checksum new_resource.checksum if new_resource.property_is_set?('checksum')
mode '0755'
recursive true
creates 'client'
target_dir "/linux-oracle_client-#{new_resource.version}"
action :extract
end

template "linux-oracle_client-#{new_resource.version}/client/install/oraparam.ini" do
source "oracle-home/#{new_resource.version}/install/oraparam.ini.erb"
owner new_resource.user
group new_resource.group
mode '0644'
end

template "linux-oracle_client-#{new_resource.version}/client/response/client_install.rsp" do
source "oracle-home/#{new_resource.version}/response/client_install.rsp.erb"
owner new_resource.user
group new_resource.group
mode '0644'
variables(
base_path: base_path,
group: new_resource.group,
home_path: home_path,
bin_path: bin_path,
lib_path: lib_path,
var_path: var_path
)
end

execute 'run oracle installer' do
not_if { ::File.exist?("#{home_path}/root.sh") }
command "source /etc/profile && ./runInstaller -noconfig -silent -waitforcompletion -ignoreprereq -ignoreSysprereqs -responseFile /linux-oracle_client-#{new_resource.version}/client/response/client_install.rsp -invPtrLoc #{var_path}/oraInst.loc"
cwd "linux-oracle_client-#{new_resource.version}/client/"
user new_resource.user
group new_resource.group
environment('USER' => new_resource.user)
live_stream true
end

execute 'run oracle configuration tool' do
command "source /etc/profile && #{home_path}/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/linux-oracle_client-#{new_resource.version}/client/response/client_install.rsp"
user new_resource.user
group new_resource.group
environment('USER' => new_resource.user)
live_stream true
end

execute 'run oracle client end of installation' do
command "#{home_path}/root.sh"
end

file "#{home_path}/network/admin/tnsnames.ora" do
content new_resource.tnsnames_options
mode '0660'
owner new_resource.user
group new_resource.group
end

template "#{home_path}/network/admin/sqlnet.ora" do
source "oracle-home/#{new_resource.version}/network/admin/sqlnet.ora.erb"
owner new_resource.user
group new_resource.group
mode '0660'
variables(
sqlnet_options: new_resource.sqlnet_options
)
end

directory wallet_path do
not_if { new_resource.tls_certificate_url == '' }
owner new_resource.user
group new_resource.group
mode '0750'
action :create
end

remote_file "#{wallet_path}/root-cert.pem" do
not_if { new_resource.tls_certificate_url == '' }
source new_resource.tls_certificate_url
mode '0640'
owner new_resource.user
group new_resource.group
end

execute 'create wallet' do
not_if { new_resource.tls_certificate_url == '' }
command "source /etc/profile && orapki wallet create -wallet #{wallet_path} -auto_login_only"
user new_resource.user
end

execute 'add wallet' do
not_if { new_resource.tls_certificate_url == '' }
command "source /etc/profile && orapki wallet add -wallet #{wallet_path} -trusted_cert -cert #{wallet_path}/root-cert.pem -auto_login_only "
user new_resource.user
end
end

+ 7
- 0
templates/default/etc/profile.d/oracle.sh.erb View File

@@ -0,0 +1,7 @@
export ORACLE_HOME=<%= @home_path %>
export ORACLE_CLIENT_BIN_PATH=<%= @bin_path %>
export ORACLE_CLIENT_LIB_PATH=<%= @lib_path %>
export INVENTORY_LOCATION=<%= @var_path %>

export PATH=$PATH:$ORACLE_CLIENT_BIN_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_CLIENT_LIB_PATH

+ 54
- 0
templates/default/oracle-home/11.2/install/oraparam.ini.erb View File

@@ -0,0 +1,54 @@
[Oracle]
DISTRIBUTION=TRUE
SOURCE=../stage/products.xml
LICENSE_LOCATION=
BOOTSTRAP_COMPS="oracle.swd.oui:11.2.0.4.0,oracle.swd.oui.core:11.2.0.4.0,oracle.jdk:1.5.0.51.10"
JRE_SCRATCH_LOC=jdk/jre
JRE_MEMORY_OPTIONS=" -mx150m"
DEFAULT_HOME_LOCATION=product/11.2.0/client
DEFAULT_HOME_NAME=OraClient11g_home
NO_BROWSE=/net
NLS_ENABLED=TRUE
BOOTSTRAP=TRUE
#PREREQ_CONFIG_LOCATION=../stage/prereq
OUI_VERSION=11.2.0.4.0
#SHOW_HOSTNAME=ALWAYS_SHOW shows the hostname panel always
#SHOW_HOSTNAME=NEVER_SHOW does not the hostname panel
#SHOW_HOSTNAME=CONDITION_SHOW shows the hostname panel on condition
SHOW_HOSTNAME=NEVER_SHOW
#THIN_JDBC_FILENAME is optional and defaults to classes12.jar
#The value specified for this should be packaged with OUI, and should
#be relative to <OUI expanded stagedir>/jlib/
THIN_JDBC_FILENAME=classes12.jar
#JRE_OSDPARAM is to set OS dependent param for JRE ( mainly for native VM in 1.3.1)
#JRE_OSDPARAM is optional and should be set to -native for the JRE's
#that support native VM ( mainly for Unix platforms ), in JRE 1.3.1
#For JRE 1.4.1 this should be set to empty or the type of VM that is
#supported client/server. The default value is -native in UNIX platforms
#that supports native VM
#Unix supporting native - JRE_OSDPARAM="-native"
#Unix NOT supporting native and 1.4.1 - JRE_OSDPARAM=""
JRE_OSDPARAM=""
CLUSTERWARE={"oracle.crs","10.1.0.2.0"}
#RUN_OUICA specifies the batch script name that needs to be run
#The script is ouica.bat for win32, and ouica.sh for solaris.
#If the value is not specified, then the OUICA script is not run
RUN_OUICA=ouica.sh
SILENT_VARIABLE_VALIDATION=TRUE
UMASK=022
INSTALL_CLASS=oracle.install.ivw.client.driver.ClientInstaller
EXT_JLIB=../stage/ext/jlib
EXT_LIB=../stage/ext/lib
EXT_BIN=../stage/ext/bin

[Updates]
UPDATE_BUGID=16592430
UPDATE_VERSION=11.2.0.4.0

[Generic Prereqs]
TEMP_SPACE=120

[IMAGES]
FILE1=images/billboards.gif

LICENSE_LOCATION=license.txt

+ 3
- 0
templates/default/oracle-home/11.2/network/admin/sqlnet.ora.erb View File

@@ -0,0 +1,3 @@
<% @sqlnet_options.each_pair do |sqlnet_option_key, sqlnet_option_value| %>
<%= "#{sqlnet_option_key}=#{sqlnet_option_value}" %>
<% end %>

+ 217
- 0
templates/default/oracle-home/11.2/response/client_install.rsp.erb View File

@@ -0,0 +1,217 @@
###############################################################################
## Copyright(c) Oracle Corporation 1998,2013. All rights reserved. ##
## ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## ##
## Each variable is associated with a comment. The comment ##
## can help to populate the variables with the appropriate ##
## values. ##
## ##
###############################################################################

#-------------------------------------------------------------------------------
# Do not change the following system generated value.
#-------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v11_2_0

#-------------------------------------------------------------------------------
# This variable holds the hostname of the system as set by the user.
# It can be used to force the installation to use an alternative
# hostname rather than using the first hostname found on the system
# (e.g., for systems with multiple hostnames and network interfaces).
ORACLE_HOSTNAME=
#-------------------------------------------------------------------------------
# Unix group to be set for the inventory directory.
UNIX_GROUP_NAME=<%= @group %>
#-------------------------------------------------------------------------------
# Inventory location.
INVENTORY_LOCATION=<%= @var_path %>
#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.
#
# en : English ja : Japanese
# fr : French ko : Korean
# ar : Arabic es : Latin American Spanish
# bn : Bengali lv : Latvian
# pt_BR: Brazilian Portuguese lt : Lithuanian
# bg : Bulgarian ms : Malay
# fr_CA: Canadian French es_MX: Mexican Spanish
# ca : Catalan no : Norwegian
# hr : Croatian pl : Polish
# cs : Czech pt : Portuguese
# da : Danish ro : Romanian
# nl : Dutch ru : Russian
# ar_EG: Egyptian zh_CN: Simplified Chinese
# en_GB: English (Great Britain) sk : Slovak
# et : Estonian sl : Slovenian
# fi : Finnish es_ES: Spanish
# de : German sv : Swedish
# el : Greek th : Thai
# iw : Hebrew zh_TW: Traditional Chinese
# hu : Hungarian tr : Turkish
# is : Icelandic uk : Ukrainian
# in : Indonesian vi : Vietnamese
# it : Italian
#
# all_langs : All languages
#
# Specify value as the following to select any of the languages.
# Example : SELECTED_LANGUAGES=en,fr,ja
#
# Specify value as the following to select all the languages.
# Example : SELECTED_LANGUAGES=all_langs
#-------------------------------------------------------------------------------
SELECTED_LANGUAGES=en
#-------------------------------------------------------------------------------
# Complete path of the Oracle Home
ORACLE_HOME=<%= @home_path %>
#-------------------------------------------------------------------------------
# Complete path of the Oracle Base.
ORACLE_BASE=<%= @base_path %>
#-------------------------------------------------------------------------------
#Name : INSTALL_TYPE
#Datatype : String
#Description: Installation type of the component.
#
# The following choices are available. The value should contain
# only one of these choices.
# - InstantClient
# - Administrator
# - Runtime
# - Custom
#
#Example : INSTALL_TYPE = "Administrator"
#------------------------------------------------------------------------------
oracle.install.client.installType=Administrator
#-------------------------------------------------------------------------------
#Name : oracle.install.client.upgrading
#Datatype : boolean
#Description: whether or not this is an upgrade installation
#
# The following choices are available. The value should contain
# only one of these choices.
# - true
# - false
#
#Example : oracle.install.client.upgrading=true
#------------------------------------------------------------------------------
oracle.install.client.upgrading=false
#------------------------------------------------------------------------------
# Name : oracle.install.client.customComponents
# Datatype : StringList
#
# This property is considered only if INSTALL_TYPE is set to "Custom"
#
# Description: List of Client Components you would like to install
#
# The following choices are available. You may specify any
# combination of these choices. The components you choose should
# be specified in the form "internal-component-name:version"
# Below is a list of components you may specify to install.
#
# oracle.sqlj:11.2.0.4.0 -- "Oracle SQLJ"
# oracle.rdbms.util:11.2.0.4.0 -- "Oracle Database Utilities"
# oracle.javavm.client:11.2.0.4.0 -- "Oracle Java Client"
# oracle.sqlplus:11.2.0.4.0 -- "SQL*Plus"
# oracle.dbjava.jdbc:11.2.0.4.0 -- "Oracle JDBC/THIN Interfaces"
# oracle.ldap.client:11.2.0.4.0 -- "Oracle Internet Directory Client"
# oracle.rdbms.oci:11.2.0.4.0 -- "Oracle Call Interface (OCI)"
# oracle.precomp:11.2.0.4.0 -- "Oracle Programmer"
# oracle.xdk:11.2.0.4.0 -- "Oracle XML Development Kit"
# oracle.network.aso:11.2.0.4.0 -- "Oracle Advanced Security"
# oracle.assistants.oemlt:11.2.0.4.0 -- "Enterprise Manager Minimal Integration"
# oracle.oraolap.mgmt:11.2.0.4.0 -- "OLAP Analytic Workspace Manager and Worksheet"
# oracle.network.client:11.2.0.4.0 -- "Oracle Net"
# oracle.network.cman:11.2.0.4.0 -- "Oracle Connection Manager"
# oracle.network.listener:11.2.0.4.0 -- "Oracle Net Listener"
# oracle.ordim.client:11.2.0.4.0 -- "Oracle Multimedia Client Option"
# oracle.odbc:11.2.0.4.0 -- "Oracle ODBC Driver"
# oracle.has.client:11.2.0.4.0 -- "Oracle Clusterware High Availability API"
# oracle.dbdev:11.2.0.4.0 -- "Oracle SQL Developer"
# oracle.rdbms.scheduler:11.2.0.4.0 -- "Oracle Scheduler Agent"
#
#-------------------------------------------------------------------------------
oracle.install.client.customComponents="oracle.sqlj:11.2.0.4.0","oracle.rdbms.util:11.2.0.4.0","oracle.javavm.client:11.2.0.4.0","oracle.sqlplus:11.2.0.4.0","oracle.dbjava.jdbc:11.2.0.4.0","oracle.ldap.client:11.2.0.4.0","oracle.rdbms.oci:11.2.0.4.0","oracle.precomp:11.2.0.4.0","oracle.xdk:11.2.0.4.0","oracle.network.aso:11.2.0.4.0","oracle.assistants.oemlt:11.2.0.4.0","oracle.oraolap.mgmt:11.2.0.4.0","oracle.network.client:11.2.0.4.0","oracle.network.cman:11.2.0.4.0","oracle.network.listener:11.2.0.4.0","oracle.ordim.client:11.2.0.4.0","oracle.odbc:11.2.0.4.0","oracle.has.client:11.2.0.4.0","oracle.dbdev:11.2.0.4.0","oracle.rdbms.scheduler:11.2.0.4.0"
#-------------------------------------------------------------------------------
# Host name to be used for by the Oracle Scheduler Agent.
# This needs to be entered in case oracle.rdbms.scheduler is selected in the
# list of custom components during custom install
#
# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com
#------------------------------------------------------------------------------
oracle.install.client.schedulerAgentHostName=

#------------------------------------------------------------------------------
# Port number to be used for by the Oracle Scheduler Agent.
# This needs to be entered in case oracle.rdbms.scheduler is selected in the
# list of custom components during custom install
#
# Example: oracle.install.client.schedulerAgentPortNumber = 1500
#------------------------------------------------------------------------------
oracle.install.client.schedulerAgentPortNumber=
#------------------------------------------------------------------------------
# Specify the auto-updates option. It can be one of the following:
# - MYORACLESUPPORT_DOWNLOAD
# - OFFLINE_UPDATES
# - SKIP_UPDATES
#------------------------------------------------------------------------------
oracle.installer.autoupdates.option=

#------------------------------------------------------------------------------
# In case MYORACLESUPPORT_DOWNLOAD option is chosen, specify the location where
# the updates are to be downloaded.
# In case OFFLINE_UPDATES option is chosen, specify the location where the updates
# are present.
#------------------------------------------------------------------------------
oracle.installer.autoupdates.downloadUpdatesLoc=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username which has the patches download privileges
# to be used for software updates.
#
# Example : AUTOUPDATES_MYORACLESUPPORT_USERNAME=abc@oracle.com
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password which has the patches download privileges
# to be used for software updates.
#
# Example : AUTOUPDATES_MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

#------------------------------------------------------------------------------
# Specify the Proxy server name. Length should be greater than zero.
#
# Example : PROXY_HOST=proxy.domain.com
#------------------------------------------------------------------------------
PROXY_HOST=

#------------------------------------------------------------------------------
# Specify the proxy port number. Should be Numeric and at least 2 chars.
#
# Example : PROXY_PORT=25
#------------------------------------------------------------------------------
PROXY_PORT=
#------------------------------------------------------------------------------
# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example : PROXY_USER=username
#------------------------------------------------------------------------------
PROXY_USER=
#------------------------------------------------------------------------------
# Specify the proxy password. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example : PROXY_PWD=password
#------------------------------------------------------------------------------
PROXY_PWD=

#------------------------------------------------------------------------------
# Specify the proxy realm.
#
# Example : PROXY_REALM=metalink
#------------------------------------------------------------------------------
PROXY_REALM=

+ 2
- 0
templates/default/oracle-inventory/11.2/oraInst.loc.erb View File

@@ -0,0 +1,2 @@
inventory_loc=<%= @var_path %>
inst_group=<%= @group %>

+ 84
- 0
test/integration/linux/default.rb View File

@@ -0,0 +1,84 @@
title 'Oracle client installation'

control 'oracle_client_fx_linux' do
impact 1
title 'Oracle client on linux.'
desc 'Ensure oracle client is installed correctly.'

base_path = '/opt/oracle'
var_path = '/var/oracle'
home_path = "#{base_path}/product/11.2"
bin_path = "#{home_path}/bin"
wallet_path = "#{home_path}/ssl_wallet"
admin_path = "#{home_path}/network/admin"
dependencies = %w(gcc-c++ gcc compat-libstdc++-33 glibc unixODBC elfutils-libelf-devel libstdc++ libaio-devel unixODBC-devel sysstat)
user = 'oracle'
group = 'dba'

describe bash('java -version') do
its('exit_status') { should eq 0 }
its('stderr') { should match ".*1.8.*\n" }
end

describe group('dba') do
it { should exist }
end

describe user('oracle') do
it { should exist }
its('groups') { should include('dba') }
end

dependencies.each do |dependency|
describe package(dependency) do
it { should be_installed }
end
end

describe directory(home_path) do
its('mode') { should cmp '02755' }
its('owner') { should eq user }
its('group') { should eq group }
end

describe directory(var_path) do
its('mode') { should cmp '02770' }
its('owner') { should eq user }
its('group') { should eq group }
end

describe file("#{wallet_path}/cwallet.sso") do
its('mode') { should cmp '0600' }
its('owner') { should eq user }
its('group') { should eq 'root' }
end

describe file("#{admin_path}/tnsnames.ora") do
its('mode') { should cmp '0660' }
its('owner') { should eq user }
its('group') { should eq group }
end

describe file("#{admin_path}/sqlnet.ora") do
its('mode') { should cmp '0660' }
its('owner') { should eq user }
its('group') { should eq group }
end

describe os_env('ORACLE_HOME') do
its('split') { should include(home_path) }
end

describe command("#{bin_path}/sqlplus") do
it { should exist }
end

describe command("#{bin_path}/tnsping") do
it { should exist }
end

describe bash('su --login -c "tnsping" oracle') do
its('exit_status') { should eq 1 }
its('stdout') { should match '.*11.2.0.4.*' }
end
end

Loading…
Cancel
Save