Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Managed by Puppet. Do not edit!" line at the beginning of tnsnames.ora file. #299

Open
wants to merge 1 commit into
base: puppet4_3_data
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions manifests/tnsnames.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,20 @@
Enum['tnsnames','listener'] $entry_type = 'tnsnames',
)
{
if ! defined(Concat["${oracle_home}/network/admin/tnsnames.ora"]) {
concat { "${oracle_home}/network/admin/tnsnames.ora":
if ! defined(Concat['tnsnames.ora']) {
concat { 'tnsnames.ora':
ensure => present,
path => "${oracle_home}/network/admin/tnsnames.ora",
owner => $user,
group => $group,
mode => '0774',
ensure_newline => true,
}

# Include the "Managed by Puppet" fragment. This will be added only
# once due to the behavor of 'include' (below).
include oradb::tnsnames::header

}

case $entry_type {
Expand All @@ -67,7 +73,7 @@
}

concat::fragment { $title:
target => "${oracle_home}/network/admin/tnsnames.ora",
target => 'tnsnames.ora',
content => epp($template_path , { 'title' => $title,
'server' => $server,
'loadbalance' => $loadbalance,
Expand Down
8 changes: 8 additions & 0 deletions manifests/tnsnames/header.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class oradb::tnsnames::header()
{
concat::fragment { 'header':
target => 'tnsnames.ora',
content => '# This file is managed by Puppet. Do not Edit!',
order => '00',
}
}