Skip to content

Instantly share code, notes, and snippets.

@fatmcgav
Created February 5, 2013 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatmcgav/4713861 to your computer and use it in GitHub Desktop.
Save fatmcgav/4713861 to your computer and use it in GitHub Desktop.
Example defined types...
define act::env::oracle::instance::netapp {
...
->
oraenvs::add { "${oracle_sid}_showenvs":
content => template('act/linux/oracle/oraenvs-instance.erb')
}
->
tnsnames::add { "${oracle_sid}_tnsnames":
content => template('act/linux/oracle/tnsnames-instance.erb')
}
->
...
}
# Class: act::util::linux::oracle::oraenvs
#
# Utility class for Oracle DB Envs configuration.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
#
class act::util::linux::oracle::oraenvs {
# Create required directory structure.
file { ['/data/tier2/scripts', '/data/tier2/scripts/profiles']:
ensure => directory,
owner => 'oracle',
group => 'oinstall'
}
concat{'/data/tier2/scripts/profiles/bashrc_extension':
owner => 'oracle',
group => 'oinstall',
mode => 644,
require => File['/data/tier2/scripts/profiles']
}
concat::fragment{ 'oraenvs_header':
target => '/data/tier2/scripts/profiles/bashrc_extension',
source => 'puppet:///modules/act/linux/oracle/oraenvs-header',
order => 01,
}
concat::fragment{ 'oraenvs_footer':
target => '/data/tier2/scripts/profiles/bashrc_extension',
source => 'puppet:///modules/act/linux/oracle/oraenvs-footer',
order => 99,
}
}
# Define: oraenvs::add
#
# Utility define for adding to Oracle Envs configuration.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
#
define oraenvs::add(
$content="",
$order=10
) {
if $content == "" {
$body = $name
} else {
$body = $content
}
concat::fragment{"oraenvs_fragment_${name}":
target => '/data/tier2/scripts/profiles/bashrc_extension',
content => $body
}
}
# Class: act::util::linux::oracle::tnsnames
#
# Utility class for Oracle Tnsnames configuration.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
#
class act::util::linux::oracle::tnsnames {
concat{ '/software/oracle/11.2.0.3/network/admin/tnsnames.ora':
owner => 'oracle',
group => 'oinstall',
mode => 644
}
concat::fragment{ 'tnsnames_header':
target => '/software/oracle/11.2.0.3/network/admin/tnsnames.ora',
source => 'puppet:///modules/act/linux/oracle/tnsnames-header',
order => 01,
}
}
# Define: tnsnames::add
#
# Utility define for adding to Oracle Tnsnames configuration.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
#
define tnsnames::add(
$content = "",
$order = 10
) {
if $content == "" {
$body = $name
} else {
$body = $content
}
# Add config to tnsnames.ora
concat::fragment{ "tnsnames_fragment_${name}":
target => '/software/oracle/11.2.0.3/network/admin/tnsnames.ora',
content => $body,
order => 50
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment