├── .coveralls.yml ├── .fixtures.yml ├── .gitattributes ├── .gitignore ├── .gitlab-ci.yml ├── .pdkignore ├── .puppet-lint.rc ├── .rspec ├── .rubocop.yml ├── .travis.yml ├── .vscode └── extensions.json ├── .yardopts ├── CHANGELOG.md ├── Gemfile ├── License ├── README.md ├── Rakefile ├── appveyor.yml ├── biemond-oradb_schema.yaml ├── data ├── common.yaml └── kernel │ ├── Linux.yaml │ └── SunOS.yaml ├── doc ├── _index.html ├── css │ ├── common.css │ ├── full_list.css │ └── style.css ├── file.README.html ├── frames.html ├── index.html ├── js │ ├── app.js │ ├── full_list.js │ └── jquery.js ├── puppet_class_list.html ├── puppet_classes │ ├── oradb.html │ └── oradb_3A_3Aprepareautostart.html ├── puppet_defined_type_list.html ├── puppet_defined_types │ ├── oradb_3A_3Aautostartdatabase.html │ ├── oradb_3A_3Aclient.html │ ├── oradb_3A_3Adatabase.html │ ├── oradb_3A_3Adatabase_pluggable.html │ ├── oradb_3A_3Adbactions.html │ ├── oradb_3A_3Agoldengate.html │ ├── oradb_3A_3Ainstallasm.html │ ├── oradb_3A_3Ainstalldb.html │ ├── oradb_3A_3Ainstallem.html │ ├── oradb_3A_3Ainstallem_agent.html │ ├── oradb_3A_3Alistener.html │ ├── oradb_3A_3Anet.html │ ├── oradb_3A_3Aopatch.html │ ├── oradb_3A_3Aopatchupgrade.html │ ├── oradb_3A_3Arcu.html │ ├── oradb_3A_3Atnsnames.html │ └── oradb_3A_3Autils_3A_3Adborainst.html ├── puppet_function_list.html ├── puppet_functions_ruby4x │ ├── oradb_3A_3Acleanpath.html │ ├── oradb_3A_3Ais_oracle_patch_installed.html │ ├── oradb_3A_3Aopatch_version.html │ └── oradb_3A_3Aoracle_exists.html └── top-level-namespace.html ├── hiera.yaml ├── lib ├── facter │ └── oracle_database_homes.rb └── puppet │ ├── functions │ └── oradb │ │ ├── cleanpath.rb │ │ ├── is_oracle_patch_installed.rb │ │ ├── opatch_version.rb │ │ └── oracle_exists.rb │ ├── provider │ ├── db_control │ │ ├── base.rb │ │ ├── sqlplus.rb │ │ └── srvctl.rb │ ├── db_directory_structure │ │ └── db_directory_structure.rb │ ├── db_listener │ │ └── db_listener.rb │ ├── db_opatch │ │ └── db_opatch.rb │ └── db_rcu │ │ └── db_rcu.rb │ └── type │ ├── db_control.rb │ ├── db_directory_structure.rb │ ├── db_listener.rb │ ├── db_opatch.rb │ └── db_rcu.rb ├── manifests ├── autostartdatabase.pp ├── client.pp ├── database.pp ├── database_pluggable.pp ├── dbactions.pp ├── goldengate.pp ├── init.pp ├── installasm.pp ├── installdb.pp ├── installem.pp ├── installem_agent.pp ├── listener.pp ├── net.pp ├── opatch.pp ├── opatchupgrade.pp ├── prepareautostart.pp ├── rcu.pp ├── tnsnames.pp └── utils │ └── dborainst.pp ├── metadata.json ├── spec ├── classes │ └── prepareautostart_spec.rb ├── default_facts.yml ├── defines │ ├── database_params_spec.rb │ ├── database_pluggable_spec.rb │ ├── installasm_params_spec.rb │ ├── installdb_params_spec.rb │ └── installdb_remote_spec.rb ├── functions │ ├── is_oracle_patch_installed_spec.rb │ └── oradb_cleanpath_spec.rb ├── shared_contexts.rb ├── spec.opts.old └── spec_helper.rb ├── templates ├── bash_profile.epp ├── db_client_11.2.0.1.rsp.epp ├── db_client_11.2.0.4.rsp.epp ├── db_client_12.1.0.1.rsp.epp ├── db_client_12.1.0.2.rsp.epp ├── db_client_12.2.0.1.rsp.epp ├── db_client_18.0.0.0.rsp.epp ├── db_client_19.0.0.0.rsp.epp ├── db_install_11.2.0.1.rsp.epp ├── db_install_11.2.0.3.rsp.epp ├── db_install_11.2.0.4.rsp.epp ├── db_install_12.1.0.1.rsp.epp ├── db_install_12.1.0.2.rsp.epp ├── db_install_12.2.0.1.rsp.epp ├── db_install_18.0.0.0.rsp.epp ├── db_install_19.0.0.0.rsp.epp ├── dbca_11.2.rsp.epp ├── dbca_12.1.rsp.epp ├── dbca_12.2.rsp.epp ├── dbca_18.3.rsp.epp ├── dbca_19.3.rsp.epp ├── dbca_vars.epp ├── dbora_Linux.epp ├── dbora_SunOS.epp ├── dbtemplate_11gR2_asm.dbt.erb ├── dbtemplate_12.1.dbt.erb ├── dbtemplate_12.1_asm.dbt.erb ├── dbtemplate_12.1_vars.dbt.erb ├── dbtemplate_12.2.dbt.erb ├── dbtemplate_12.2_vars.dbt.erb ├── dbtemplate_18.3_vars.dbt.erb ├── dbtemplate_19.3_vars.dbt.erb ├── em_agent_pull.properties.epp ├── em_install_12.1.0.4.rsp.epp ├── em_install_12.1.0.5.rsp.epp ├── em_install_13.2.0.0.rsp.epp ├── em_install_static_12.1.0.4.ini.epp ├── em_install_static_12.1.0.5.ini.epp ├── em_install_static_13.2.0.0.ini.epp ├── grid_bash_profile.epp ├── grid_install_11.2.0.4.rsp.epp ├── grid_install_12.1.0.1.rsp.epp ├── grid_install_12.1.0.2.rsp.epp ├── grid_install_12.2.0.1.rsp.epp ├── grid_install_18.0.0.0.rsp.epp ├── grid_install_19.0.0.0.rsp.epp ├── grid_password.properties.epp ├── listener.epp ├── netca_11.2.rsp.epp ├── netca_12.1.rsp.epp ├── netca_12.2.rsp.epp ├── netca_18.3.rsp.epp ├── netca_19.3.rsp.epp ├── netca_client_11.2.0.1.rsp.epp ├── netca_client_11.2.0.4.rsp.epp ├── netca_client_12.1.0.1.rsp.epp ├── netca_client_12.1.0.2.rsp.epp ├── netca_client_12.2.0.1.rsp.epp ├── netca_client_18.0.0.0.rsp.epp ├── netca_client_19.0.0.0.rsp.epp ├── ocm.rsp.epp ├── oggcore_12.1.2.rsp.epp ├── oggcore_12.2.1.rsp.epp ├── oggcore_12.3.0.rsp.epp ├── oggcore_18.1.rsp.epp ├── oggcore_19.1.rsp.epp ├── ohas.service.epp ├── oraInst.loc.epp ├── oradb_smf.xml.epp ├── rcu_passwords.txt.epp └── tnsnames.epp └── test.sh /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | repo_token: Sm0eJMTTAUAYUQQ90Zelp7Rj73c442MCN -------------------------------------------------------------------------------- /.fixtures.yml: -------------------------------------------------------------------------------- 1 | fixtures: 2 | repositories: 3 | 'stdlib': 4 | repo: 'https://github.com/puppetlabs/puppetlabs-stdlib' 5 | symlinks: 6 | 'oradb': '#{source_dir}' 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.rb eol=lf 2 | *.erb eol=lf 3 | *.pp eol=lf 4 | *.sh eol=lf 5 | *.epp eol=lf 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .git/ 2 | .*.sw[op] 3 | .metadata 4 | .yardoc 5 | .yardwarns 6 | *.iml 7 | /.bundle/ 8 | /.idea/ 9 | /.vagrant/ 10 | /coverage/ 11 | /bin/ 12 | /Gemfile.local 13 | /Gemfile.lock 14 | /junit/ 15 | /log/ 16 | /pkg/ 17 | /spec/fixtures/manifests/ 18 | /spec/fixtures/modules/ 19 | /tmp/ 20 | /vendor/ 21 | /convert_report.txt 22 | /update_report.txt 23 | .DS_Store 24 | .project 25 | .envrc 26 | /inventory.yaml 27 | /coverage 28 | /spec/reports -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | stages: 3 | - syntax 4 | - unit 5 | 6 | cache: 7 | paths: 8 | - vendor/bundle 9 | 10 | before_script: 11 | - bundle -v 12 | - rm Gemfile.lock || true 13 | - gem update --system $RUBYGEMS_VERSION 14 | - gem --version 15 | - bundle -v 16 | - bundle install --without system_tests --path vendor/bundle --jobs $(nproc) 17 | 18 | syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.3-Puppet ~> 6: 19 | stage: syntax 20 | image: ruby:2.5.3 21 | script: 22 | - bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop 23 | variables: 24 | PUPPET_GEM_VERSION: '~> 6' 25 | 26 | parallel_spec-Ruby 2.5.3-Puppet ~> 6: 27 | stage: unit 28 | image: ruby:2.5.3 29 | script: 30 | - bundle exec rake parallel_spec 31 | variables: 32 | PUPPET_GEM_VERSION: '~> 6' 33 | 34 | parallel_spec-Ruby 2.4.5-Puppet ~> 5: 35 | stage: unit 36 | image: ruby:2.4.5 37 | script: 38 | - bundle exec rake parallel_spec 39 | variables: 40 | PUPPET_GEM_VERSION: '~> 5' 41 | 42 | -------------------------------------------------------------------------------- /.pdkignore: -------------------------------------------------------------------------------- 1 | .git/ 2 | .*.sw[op] 3 | .metadata 4 | .yardoc 5 | .yardwarns 6 | *.iml 7 | /.bundle/ 8 | /.idea/ 9 | /.vagrant/ 10 | /coverage/ 11 | /bin/ 12 | /doc/ 13 | /Gemfile.local 14 | /Gemfile.lock 15 | /junit/ 16 | /log/ 17 | /pkg/ 18 | /spec/fixtures/manifests/ 19 | /spec/fixtures/modules/ 20 | /tmp/ 21 | /vendor/ 22 | /convert_report.txt 23 | /update_report.txt 24 | .DS_Store 25 | .project 26 | .envrc 27 | /inventory.yaml 28 | /appveyor.yml 29 | /.fixtures.yml 30 | /Gemfile 31 | /.gitattributes 32 | /.gitignore 33 | /.gitlab-ci.yml 34 | /.pdkignore 35 | /Rakefile 36 | /rakelib/ 37 | /.rspec 38 | /.rubocop.yml 39 | /.travis.yml 40 | /.yardopts 41 | /spec/ 42 | /.vscode/ 43 | -------------------------------------------------------------------------------- /.puppet-lint.rc: -------------------------------------------------------------------------------- 1 | # PuppetLint.configuration.send('disable_relative') 2 | # PuppetLint.configuration.send("disable_80chars") 3 | # PuppetLint.configuration.send("disable_140chars") 4 | --no-140chars-check 5 | --no-80chars-check -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --format documentation 3 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | require: 3 | - rubocop-rspec 4 | - rubocop-i18n 5 | AllCops: 6 | DisplayCopNames: true 7 | TargetRubyVersion: '2.1' 8 | Include: 9 | - "./**/*.rb" 10 | Exclude: 11 | - bin/* 12 | - ".vendor/**/*" 13 | - "**/Gemfile" 14 | - "**/Rakefile" 15 | - pkg/**/* 16 | - spec/fixtures/**/* 17 | - vendor/**/* 18 | - "**/Puppetfile" 19 | - "**/Vagrantfile" 20 | - "**/Guardfile" 21 | Metrics/LineLength: 22 | Description: People have wide screens, use them. 23 | Max: 200 24 | GetText: 25 | Enabled: false 26 | GetText/DecorateString: 27 | Description: We don't want to decorate test output. 28 | Exclude: 29 | - spec/**/* 30 | RSpec/BeforeAfterAll: 31 | Description: Beware of using after(:all) as it may cause state to leak between tests. 32 | A necessary evil in acceptance testing. 33 | Exclude: 34 | - spec/acceptance/**/*.rb 35 | RSpec/HookArgument: 36 | Description: Prefer explicit :each argument, matching existing module's style 37 | EnforcedStyle: each 38 | Style/BlockDelimiters: 39 | Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to 40 | be consistent then. 41 | EnforcedStyle: braces_for_chaining 42 | Style/ClassAndModuleChildren: 43 | Description: Compact style reduces the required amount of indentation. 44 | EnforcedStyle: compact 45 | Style/EmptyElse: 46 | Description: Enforce against empty else clauses, but allow `nil` for clarity. 47 | EnforcedStyle: empty 48 | Style/FormatString: 49 | Description: Following the main puppet project's style, prefer the % format format. 50 | EnforcedStyle: percent 51 | Style/FormatStringToken: 52 | Description: Following the main puppet project's style, prefer the simpler template 53 | tokens over annotated ones. 54 | EnforcedStyle: template 55 | Style/Lambda: 56 | Description: Prefer the keyword for easier discoverability. 57 | EnforcedStyle: literal 58 | Style/RegexpLiteral: 59 | Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 60 | EnforcedStyle: percent_r 61 | Style/TernaryParentheses: 62 | Description: Checks for use of parentheses around ternary conditions. Enforce parentheses 63 | on complex expressions for better readability, but seriously consider breaking 64 | it up. 65 | EnforcedStyle: require_parentheses_when_complex 66 | Style/TrailingCommaInArguments: 67 | Description: Prefer always trailing comma on multiline argument lists. This makes 68 | diffs, and re-ordering nicer. 69 | EnforcedStyleForMultiline: comma 70 | Style/TrailingCommaInLiteral: 71 | Description: Prefer always trailing comma on multiline literals. This makes diffs, 72 | and re-ordering nicer. 73 | EnforcedStyleForMultiline: comma 74 | Style/SymbolArray: 75 | Description: Using percent style obscures symbolic intent of array's contents. 76 | EnforcedStyle: brackets 77 | RSpec/MessageSpies: 78 | EnforcedStyle: receive 79 | Style/Documentation: 80 | Exclude: 81 | - lib/puppet/parser/functions/**/* 82 | - spec/**/* 83 | Style/WordArray: 84 | EnforcedStyle: brackets 85 | Style/CollectionMethods: 86 | Enabled: true 87 | Style/MethodCalledOnDoEndBlock: 88 | Enabled: true 89 | Style/StringMethods: 90 | Enabled: true 91 | Layout/EndOfLine: 92 | Enabled: false 93 | Layout/IndentHeredoc: 94 | Enabled: false 95 | Metrics/AbcSize: 96 | Enabled: false 97 | Metrics/BlockLength: 98 | Enabled: false 99 | Metrics/ClassLength: 100 | Enabled: false 101 | Metrics/CyclomaticComplexity: 102 | Enabled: false 103 | Metrics/MethodLength: 104 | Enabled: false 105 | Metrics/ModuleLength: 106 | Enabled: false 107 | Metrics/ParameterLists: 108 | Enabled: false 109 | Metrics/PerceivedComplexity: 110 | Enabled: false 111 | RSpec/DescribeClass: 112 | Enabled: false 113 | RSpec/ExampleLength: 114 | Enabled: false 115 | RSpec/MessageExpectation: 116 | Enabled: false 117 | RSpec/MultipleExpectations: 118 | Enabled: false 119 | RSpec/NestedGroups: 120 | Enabled: false 121 | Style/AsciiComments: 122 | Enabled: false 123 | Style/IfUnlessModifier: 124 | Enabled: false 125 | Style/SymbolProc: 126 | Enabled: false 127 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sudo: false 3 | dist: trusty 4 | language: ruby 5 | cache: bundler 6 | before_install: 7 | - bundle -v 8 | - rm -f Gemfile.lock 9 | - gem update --system 10 | - gem --version 11 | - bundle -v 12 | script: 13 | - 'bundle exec rake $CHECK' 14 | bundler_args: --without system_tests 15 | rvm: 16 | - 2.5.0 17 | env: 18 | global: 19 | - BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0" 20 | matrix: 21 | fast_finish: true 22 | include: 23 | - 24 | env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file" 25 | - 26 | env: CHECK=parallel_spec 27 | - 28 | env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec 29 | rvm: 2.4.4 30 | - 31 | env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec 32 | rvm: 2.3.3 33 | 34 | notifications: 35 | email: true 36 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "jpogran.puppet-vscode", 4 | "rebornix.Ruby" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | --markup markdown 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source ENV['GEM_SOURCE'] || 'https://rubygems.org' 2 | 3 | def location_for(place_or_version, fake_version = nil) 4 | git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} 5 | file_url_regex = %r{\Afile:\/\/(?.*)} 6 | 7 | if place_or_version && (git_url = place_or_version.match(git_url_regex)) 8 | [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact 9 | elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) 10 | ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] 11 | else 12 | [place_or_version, { require: false }] 13 | end 14 | end 15 | 16 | ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments 17 | minor_version = ruby_version_segments[0..1].join('.') 18 | 19 | group :development do 20 | gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') 21 | gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') 22 | gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') 23 | gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') 24 | gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) 25 | gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) 26 | gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] 27 | gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] 28 | gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] 29 | gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] 30 | end 31 | 32 | puppet_version = ENV['PUPPET_GEM_VERSION'] 33 | facter_version = ENV['FACTER_GEM_VERSION'] 34 | hiera_version = ENV['HIERA_GEM_VERSION'] 35 | 36 | gems = {} 37 | 38 | gems['puppet'] = location_for(puppet_version) 39 | 40 | # If facter or hiera versions have been specified via the environment 41 | # variables 42 | 43 | gems['facter'] = location_for(facter_version) if facter_version 44 | gems['hiera'] = location_for(hiera_version) if hiera_version 45 | 46 | if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)} 47 | # If we're using a Puppet gem on Windows which handles its own win32-xxx gem 48 | # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445). 49 | gems['win32-dir'] = ['<= 0.4.9', require: false] 50 | gems['win32-eventlog'] = ['<= 0.6.5', require: false] 51 | gems['win32-process'] = ['<= 0.7.5', require: false] 52 | gems['win32-security'] = ['<= 0.2.5', require: false] 53 | gems['win32-service'] = ['0.8.8', require: false] 54 | end 55 | 56 | gems.each do |gem_name, gem_params| 57 | gem gem_name, *gem_params 58 | end 59 | 60 | # Evaluate Gemfile.local and ~/.gemfile if they exist 61 | extra_gemfiles = [ 62 | "#{__FILE__}.local", 63 | File.join(Dir.home, '.gemfile'), 64 | ] 65 | 66 | extra_gemfiles.each do |gemfile| 67 | if File.file?(gemfile) && File.readable?(gemfile) 68 | eval(File.read(gemfile), binding) 69 | end 70 | end 71 | # vim: syntax=ruby 72 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? 2 | require 'puppetlabs_spec_helper/rake_tasks' 3 | require 'puppet-syntax/tasks/puppet-syntax' 4 | require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? 5 | require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? 6 | require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? 7 | 8 | def changelog_user 9 | return unless Rake.application.top_level_tasks.include? "changelog" 10 | returnVal = nil || JSON.load(File.read('metadata.json'))['author'] 11 | raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? 12 | puts "GitHubChangelogGenerator user:#{returnVal}" 13 | returnVal 14 | end 15 | 16 | def changelog_project 17 | return unless Rake.application.top_level_tasks.include? "changelog" 18 | returnVal = nil || JSON.load(File.read('metadata.json'))['source'].match(%r{.*/([^/]*)})[1] 19 | raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil? 20 | puts "GitHubChangelogGenerator project:#{returnVal}" 21 | returnVal 22 | end 23 | 24 | def changelog_future_release 25 | return unless Rake.application.top_level_tasks.include? "changelog" 26 | returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version'] 27 | raise "unable to find the future_release (version) in metadata.json" if returnVal.nil? 28 | puts "GitHubChangelogGenerator future_release:#{returnVal}" 29 | returnVal 30 | end 31 | 32 | PuppetLint.configuration.send('disable_relative') 33 | 34 | if Bundler.rubygems.find_name('github_changelog_generator').any? 35 | GitHubChangelogGenerator::RakeTask.new :changelog do |config| 36 | raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? 37 | config.user = "#{changelog_user}" 38 | config.project = "#{changelog_project}" 39 | config.future_release = "#{changelog_future_release}" 40 | config.exclude_labels = ['maintenance'] 41 | config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)." 42 | config.add_pr_wo_labels = true 43 | config.issues = false 44 | config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM" 45 | config.configure_sections = { 46 | "Changed" => { 47 | "prefix" => "### Changed", 48 | "labels" => ["backwards-incompatible"], 49 | }, 50 | "Added" => { 51 | "prefix" => "### Added", 52 | "labels" => ["feature", "enhancement"], 53 | }, 54 | "Fixed" => { 55 | "prefix" => "### Fixed", 56 | "labels" => ["bugfix"], 57 | }, 58 | } 59 | end 60 | else 61 | desc 'Generate a Changelog from GitHub' 62 | task :changelog do 63 | raise <= Gem::Version.new('2.2.2')" 74 | EOM 75 | end 76 | end 77 | 78 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1.x.{build} 3 | branches: 4 | only: 5 | - master 6 | - release 7 | skip_commits: 8 | message: /^\(?doc\)?.*/ 9 | clone_depth: 10 10 | init: 11 | - SET 12 | - 'mkdir C:\ProgramData\PuppetLabs\code && exit 0' 13 | - 'mkdir C:\ProgramData\PuppetLabs\facter && exit 0' 14 | - 'mkdir C:\ProgramData\PuppetLabs\hiera && exit 0' 15 | - 'mkdir C:\ProgramData\PuppetLabs\puppet\var && exit 0' 16 | environment: 17 | matrix: 18 | - 19 | RUBY_VERSION: 24-x64 20 | CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop 21 | - 22 | PUPPET_GEM_VERSION: ~> 5.0 23 | RUBY_VERSION: 24 24 | CHECK: parallel_spec 25 | - 26 | PUPPET_GEM_VERSION: ~> 5.0 27 | RUBY_VERSION: 24-x64 28 | CHECK: parallel_spec 29 | - 30 | PUPPET_GEM_VERSION: ~> 6.0 31 | RUBY_VERSION: 25 32 | CHECK: parallel_spec 33 | - 34 | PUPPET_GEM_VERSION: ~> 6.0 35 | RUBY_VERSION: 25-x64 36 | CHECK: parallel_spec 37 | matrix: 38 | fast_finish: true 39 | install: 40 | - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% 41 | - bundle install --jobs 4 --retry 2 --without system_tests 42 | - type Gemfile.lock 43 | build: off 44 | test_script: 45 | - bundle exec puppet -V 46 | - ruby -v 47 | - gem -v 48 | - bundle -v 49 | - bundle exec rake %CHECK% 50 | notifications: 51 | - provider: Email 52 | to: 53 | - nobody@nowhere.com 54 | on_build_success: false 55 | on_build_failure: false 56 | on_build_status_changed: false 57 | -------------------------------------------------------------------------------- /data/common.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | oradb::database::action: create 3 | oradb::database::asm_diskgroup: DATA 4 | oradb::database::character_set: AL32UTF8 5 | oradb::database::database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP 6 | oradb::database::em_configuration: NONE # CENTRAL|LOCAL|ALL|NONE 7 | oradb::database::memory_percentage: 40 8 | oradb::database::memory_total: 800 9 | oradb::database::nationalcharacter_set: UTF8 10 | oradb::database::sample_schema: 'TRUE' 11 | oradb::database::storage_type: FS #FS|CFS|ASM 12 | 13 | oradb::database_name: orcl 14 | oradb::database_pluggable_versions: 15 | - '12.1' 16 | - '12.2' 17 | - '18.3' 18 | - '19.3' 19 | 20 | # oracle database type options 21 | oradb::database_types: 22 | - EE 23 | - SE 24 | - SEONE 25 | - SE2 26 | - HP 27 | - XP 28 | - PE 29 | oradb::database_versions: 30 | - '11.2' 31 | - '12.1' 32 | - '12.2' 33 | - '18.3' 34 | - '19.3' 35 | oradb::default::password: Welcome01 36 | oradb::download_dir: "/var/tmp/install" 37 | oradb::em_versions_three_files: 38 | - 12.1.0.4 39 | - 12.1.0.5 40 | oradb::enterprise_manager_agent_install_types: 41 | - agentPull 42 | - agentDeploy 43 | 44 | # check on all supported enterprise agent versions 45 | oradb::enterprise_manager_agent_versions: 46 | - 12.1.0.4 47 | - 12.1.0.5 48 | oradb::exec_path: "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin" 49 | oradb::grid::default::password: Welcome01 50 | oradb::grid::group: asmdba 51 | oradb::grid::group_asm: asmadmin 52 | oradb::grid::group_install: oinstall 53 | oradb::grid::group_oper: asmoper 54 | oradb::grid::user: grid 55 | oradb::grid_storage_option: 56 | - ASM_STORAGE 57 | - FILE_SYSTEM_STORAGE 58 | oradb::grid_type: 59 | - CRS_CONFIG 60 | - HA_CONFIG 61 | - UPGRADE 62 | - CRS_SWONLY 63 | 64 | # check on all supported grid versions 65 | oradb::grid_versions: 66 | - 11.2.0.4 67 | - 12.1.0.1 68 | - 12.1.0.2 69 | - 12.2.0.1 70 | - 18.0.0.0 71 | - 19.0.0.0 72 | oradb::grid_versions_one_file: 73 | - 11.2.0.4 74 | oradb::grid_versions_two_files: 75 | - 12.1.0.1 76 | - 12.1.0.2 77 | oradb::group: dba 78 | oradb::group_install: oinstall 79 | oradb::group_oper: oper 80 | oradb::host::service_name: dbora 81 | 82 | oradb::installdb::database_type: SE 83 | 84 | oradb::instance_em_configuration: 85 | - NONE 86 | - CENTRAL 87 | - LOCAL 88 | - ALL 89 | oradb::instance_storage_type: 90 | - FS 91 | - CFS 92 | - ASM 93 | oradb::instance_types: 94 | - MULTIPURPOSE 95 | - DATA_WAREHOUSING 96 | - OLTP 97 | 98 | # check on supported kernels 99 | oradb::kernels: 100 | - Linux 101 | - SunOS 102 | oradb::listener_port: 1521 103 | oradb::module_mountpoint: oradb/ 104 | oradb::net_versions: 105 | - '11.2' 106 | - '12.1' 107 | - '12.2' 108 | - '18.3' 109 | - '19.3' 110 | oradb::tmp_dir: "/tmp" 111 | oradb::user: oracle 112 | oradb::version: '12.1' 113 | 114 | # check on all supported database versions 115 | oradb::versions: 116 | - 11.2.0.1 117 | - 11.2.0.3 118 | - 11.2.0.4 119 | - 12.1.0.1 120 | - 12.1.0.2 121 | - 12.2.0.1 122 | - 18.0.0.0 123 | - 19.0.0.0 124 | 125 | # full versions which can be downloaded at OTN 126 | oradb::versions_full: 127 | - 11.2.0.1 128 | - 12.1.0.1 129 | - 12.1.0.2 130 | 131 | # full patch versions can be downloaded at edelivery 132 | oradb::versions_patch: 133 | - 11.2.0.3 134 | - 11.2.0.4 135 | -------------------------------------------------------------------------------- /data/kernel/Linux.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | oradb::dbora_dir: "/etc/init.d" 3 | oradb::orainst_dir: "/etc" 4 | oradb::oratab: "/etc/oratab" 5 | oradb::ps_arg: "-ef" 6 | oradb::ps_bin: "/bin/ps" 7 | oradb::user_base_dir: "/home" 8 | -------------------------------------------------------------------------------- /data/kernel/SunOS.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | oradb::dbora_dir: "/etc" 3 | oradb::orainst_dir: "/var/opt/oracle" 4 | oradb::oratab: "/var/opt/oracle/oratab" 5 | oradb::ps_arg: awwx 6 | oradb::ps_bin: "/usr/ucb/ps" 7 | oradb::ps_bin_5_11: "/bin/ps" 8 | oradb::user_base_dir: "/export/home" 9 | -------------------------------------------------------------------------------- /doc/css/common.css: -------------------------------------------------------------------------------- 1 | /* Ensure the search bar doesn't overlap with links */ 2 | .fixed_header { 3 | padding-bottom: 25px; 4 | } 5 | 6 | #full_list { 7 | padding-top: 15px; 8 | } 9 | -------------------------------------------------------------------------------- /doc/css/full_list.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; 4 | font-size: 13px; 5 | height: 101%; 6 | overflow-x: hidden; 7 | background: #fafafa; 8 | } 9 | 10 | h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } 11 | .clear { clear: both; } 12 | .fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } 13 | #search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } 14 | #content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } 15 | #full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } 16 | #full_list ul { padding: 0; } 17 | #full_list li { padding: 0; margin: 0; list-style: none; } 18 | #full_list li .item { padding: 5px 5px 5px 12px; } 19 | #noresults { padding: 7px 12px; background: #fff; } 20 | #content.insearch #noresults { margin-left: 7px; } 21 | li.collapsed ul { display: none; } 22 | li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } 23 | li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } 24 | li { color: #888; cursor: pointer; } 25 | li.deprecated { text-decoration: line-through; font-style: italic; } 26 | li.odd { background: #f0f0f0; } 27 | li.even { background: #fafafa; } 28 | .item:hover { background: #ddd; } 29 | li small:before { content: "("; } 30 | li small:after { content: ")"; } 31 | li small.search_info { display: none; } 32 | a, a:visited { text-decoration: none; color: #05a; } 33 | li.clicked > .item { background: #05a; color: #ccc; } 34 | li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } 35 | li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } 36 | li.collapsed.clicked a.toggle { background-position: top right; } 37 | #search input { border: 1px solid #bbb; border-radius: 3px; } 38 | #full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } 39 | #full_list_nav a, #nav a:visited { color: #358; } 40 | #full_list_nav a:hover { background: transparent; color: #5af; } 41 | #full_list_nav span:after { content: ' | '; } 42 | #full_list_nav span:last-child:after { content: ''; } 43 | 44 | #content h1 { margin-top: 0; } 45 | li { white-space: nowrap; cursor: normal; } 46 | li small { display: block; font-size: 0.8em; } 47 | li small:before { content: ""; } 48 | li small:after { content: ""; } 49 | li small.search_info { display: none; } 50 | #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } 51 | #content.insearch #search { background-position: center right; } 52 | #search input { width: 110px; } 53 | 54 | #full_list.insearch ul { display: block; } 55 | #full_list.insearch .item { display: none; } 56 | #full_list.insearch .found { display: block; padding-left: 11px !important; } 57 | #full_list.insearch li a.toggle { display: none; } 58 | #full_list.insearch li small.search_info { display: block; } 59 | -------------------------------------------------------------------------------- /doc/frames.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Documentation by YARD 0.9.16 6 | 7 | 13 | 17 | 18 | -------------------------------------------------------------------------------- /doc/puppet_class_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Puppet Class List 19 | 20 | 21 | 22 |
23 |
24 |

Puppet Class List

25 | 40 | 41 | 42 |
43 | 44 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/puppet_classes/oradb.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Puppet Class: oradb 8 | 9 | — Documentation by YARD 0.9.16 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Puppet Class: oradb

63 |
64 | 65 | 66 |
67 |
Defined in:
68 |
69 | manifests/init.pp 70 |
71 |
72 |
73 | 74 |

Overview

75 |
76 |
77 | 78 |

oradb

79 | 80 |

oradb init class

81 | 82 |
83 |
84 | 85 | 86 |
87 | 88 | 89 |
90 | 91 | 92 | 99 | 105 | 106 |
93 |
 94 | 
 95 | 
 96 | 6
 97 | 7
98 |
100 |
# File 'manifests/init.pp', line 6
101 | 
102 | class oradb() {
103 | }
104 |
107 |
108 |
109 | 110 | 113 | 114 |
115 | 116 | -------------------------------------------------------------------------------- /doc/puppet_defined_types/oradb_3A_3Autils_3A_3Adborainst.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Defined Type: oradb::utils::dborainst 8 | 9 | — Documentation by YARD 0.9.16 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Defined Type: oradb::utils::dborainst

63 |
64 |
65 |
Defined in:
66 |
67 | manifests/utils/dborainst.pp 68 |
69 |
70 |
71 | 72 |

Overview

73 |
74 |
75 | 76 |

utils::dborainst

77 | 78 |

creates oraInst.loc for oracle products

79 | 80 |
81 |
82 | 83 | 84 |
85 | 86 |
87 |

Examples:

88 | 89 | 90 |

91 |

dborainst call

92 |

93 | 94 |
oradb::utils::dborainst{'myOraInst':
 95 |   ora_inventory_dir => '/opt/oracle',
 96 |   os_group          => 'oinstall',
 97 | }
98 | 99 |
100 |

Parameters:

101 |
    102 | 103 |
  • 104 | 105 | ora_inventory_dir 106 | 107 | 108 | (String) 109 | 110 | 111 | (defaults to: undef) 112 | 113 | 114 | — 115 |
    116 |

    full path to the ora inventory directory

    117 |
    118 | 119 |
  • 120 | 121 |
  • 122 | 123 | os_group 124 | 125 | 126 | (String) 127 | 128 | 129 | (defaults to: lookup('oradb::group')) 130 | 131 | 132 | — 133 |
    134 |

    groupb

    135 |
    136 | 137 |
  • 138 | 139 |
140 | 141 | 142 |
143 | 144 | 145 | 176 | 206 | 207 |
146 |
147 | 
148 | 
149 | 15
150 | 16
151 | 17
152 | 18
153 | 19
154 | 20
155 | 21
156 | 22
157 | 23
158 | 24
159 | 25
160 | 26
161 | 27
162 | 28
163 | 29
164 | 30
165 | 31
166 | 32
167 | 33
168 | 34
169 | 35
170 | 36
171 | 37
172 | 38
173 | 39
174 | 40
175 |
177 |
# File 'manifests/utils/dborainst.pp', line 15
178 | 
179 | define oradb::utils::dborainst
180 | (
181 |   String $ora_inventory_dir = undef,
182 |   String $os_group          = lookup('oradb::group'),
183 | ){
184 |   $ora_inst_path = lookup('oradb::orainst_dir')
185 |   if ( $facts['kernel'] == 'SunOS'){
186 |     if !defined(File[$ora_inst_path]) {
187 |       file { $ora_inst_path:
188 |         ensure => directory,
189 |         before => File["${ora_inst_path}/oraInst.loc"],
190 |         mode   => '0644',
191 |       }
192 |     }
193 |   }
194 | 
195 |   if !defined(File["${ora_inst_path}/oraInst.loc"]) {
196 |     file { "${ora_inst_path}/oraInst.loc":
197 |       ensure  => present,
198 |       content => epp('oradb/oraInst.loc.epp', {
199 |                       'ora_inventory_dir' => $ora_inventory_dir,
200 |                       'os_group'          => $os_group }),
201 |       mode    => '0644',
202 |     }
203 |   }
204 | }
205 |
208 |
209 |
210 | 211 | 214 | 215 |
216 | 217 | -------------------------------------------------------------------------------- /doc/puppet_function_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Puppet Function List 19 | 20 | 21 | 22 |
23 |
24 |

Puppet Function List

25 | 40 | 41 | 42 |
43 | 44 | 81 |
82 | 83 | 84 | -------------------------------------------------------------------------------- /doc/puppet_functions_ruby4x/oradb_3A_3Acleanpath.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Puppet Function: oradb::cleanpath (Ruby 4.x API) 8 | 9 | — Documentation by YARD 0.9.16 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Puppet Function: oradb::cleanpath

63 |
64 |
65 |
Defined in:
66 |
67 | lib/puppet/functions/oradb/cleanpath.rb 68 |
69 |
70 |
71 |
Function type:
72 |
Ruby 4.x API
73 |
74 |
75 | 76 |

Overview

77 |
78 | 79 |
80 | 81 | 82 | oradb::cleanpath(String $path)String 83 | 84 | 85 |
86 | 87 |
88 |
89 | 90 |

clean and return the path

91 | 92 |
93 |
94 | 95 |
96 | 97 | 98 |
99 | 100 | 103 | 104 |
105 | 106 | -------------------------------------------------------------------------------- /doc/puppet_functions_ruby4x/oradb_3A_3Ais_oracle_patch_installed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Puppet Function: oradb::is_oracle_patch_installed (Ruby 4.x API) 8 | 9 | — Documentation by YARD 0.9.16 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Puppet Function: oradb::is_oracle_patch_installed

63 |
64 |
65 |
Defined in:
66 |
67 | lib/puppet/functions/oradb/is_oracle_patch_installed.rb 68 |
69 |
70 |
71 |
Function type:
72 |
Ruby 4.x API
73 |
74 |
75 | 76 |

Overview

77 |
78 | 79 |
80 | 81 | 82 | oradb::is_oracle_patch_installed(String $oracle_home_path, String $patch_id)Boolean 83 | 84 | 85 |
86 | 87 |
88 |
89 | 90 |

check is Oracle patch is already installed

91 | 92 |
93 |
94 | 95 |
96 | 97 | 98 |
99 | 100 | 103 | 104 |
105 | 106 | -------------------------------------------------------------------------------- /doc/puppet_functions_ruby4x/oradb_3A_3Aopatch_version.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Puppet Function: oradb::opatch_version (Ruby 4.x API) 8 | 9 | — Documentation by YARD 0.9.16 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Puppet Function: oradb::opatch_version

63 |
64 |
65 |
Defined in:
66 |
67 | lib/puppet/functions/oradb/opatch_version.rb 68 |
69 |
70 |
71 |
Function type:
72 |
Ruby 4.x API
73 |
74 |
75 | 76 |

Overview

77 |
78 | 79 |
80 | 81 | 82 | oradb::opatch_version(String $oracle_home_path)String 83 | 84 | 85 |
86 | 87 |
88 |
89 | 90 |

determine the opatch version of an oracle home

91 | 92 |
93 |
94 | 95 |
96 | 97 | 98 |
99 | 100 | 103 | 104 |
105 | 106 | -------------------------------------------------------------------------------- /doc/puppet_functions_ruby4x/oradb_3A_3Aoracle_exists.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Puppet Function: oradb::oracle_exists (Ruby 4.x API) 8 | 9 | — Documentation by YARD 0.9.16 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Puppet Function: oradb::oracle_exists

63 |
64 |
65 |
Defined in:
66 |
67 | lib/puppet/functions/oradb/oracle_exists.rb 68 |
69 |
70 |
71 |
Function type:
72 |
Ruby 4.x API
73 |
74 |
75 | 76 |

Overview

77 |
78 | 79 |
80 | 81 | 82 | oradb::oracle_exists(String $oracle_home_path)Boolean 83 | 84 | 85 |
86 | 87 |
88 |
89 | 90 |

Check if the oracle software already exists on the vm

91 | 92 |
93 |
94 | 95 |
96 | 97 | 98 |
99 | 100 | 103 | 104 |
105 | 106 | -------------------------------------------------------------------------------- /doc/top-level-namespace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Top Level Namespace 8 | 9 | — Documentation by YARD 0.9.16 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Top Level Namespace 63 | 64 | 65 | 66 |

67 |
68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
91 | 92 | 95 | 96 |
97 | 98 | -------------------------------------------------------------------------------- /hiera.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 5 3 | hierarchy: 4 | - name: kernel 5 | path: kernel/%{facts.kernel}.yaml 6 | - name: common 7 | path: common.yaml 8 | -------------------------------------------------------------------------------- /lib/facter/oracle_database_homes.rb: -------------------------------------------------------------------------------- 1 | # oracle_database_homes.rb 2 | require 'rexml/document' 3 | require 'facter' 4 | 5 | def get_database_user 6 | databaseUser = Facter.value('override_database_user') 7 | if databaseUser.nil? 8 | # puts "database user is oracle" 9 | else 10 | # puts "database user is " + databaseUser 11 | return databaseUser 12 | end 13 | 'oracle' 14 | end 15 | 16 | def get_su_command 17 | os = Facter.value(:kernel) 18 | if 'Linux' == os 19 | return 'su -l ' 20 | elsif 'SunOS' == os 21 | return 'su - ' 22 | end 23 | 'su -l ' 24 | end 25 | 26 | def get_ora_inv_path 27 | os = Facter.value(:kernel) 28 | if 'Linux' == os 29 | return '/etc' 30 | elsif 'SunOS' == os 31 | return '/var/opt/oracle' 32 | end 33 | '/etc' 34 | end 35 | 36 | def get_opatch_version(name) 37 | opatchOut = Facter::Util::Resolution.exec(name + '/OPatch/opatch version') 38 | 39 | if opatchOut.nil? 40 | opatchver = 'Error;' 41 | else 42 | opatchver = opatchOut.split(' ')[2] 43 | end 44 | Puppet.debug "oradb opatch #{opatchver}" 45 | opatchver 46 | end 47 | 48 | def get_opatch_patches(name) 49 | opatch_out = Facter::Util::Resolution.exec(get_su_command + get_database_user + ' -c "' + name + '/OPatch/opatch lspatches"') 50 | return nil if opatch_out.nil? 51 | 52 | opatch_out.each_line.collect do |line| 53 | next unless line =~ /^\d+;/ 54 | # Puppet.info "-patches- #{line}" 55 | split_line = line.split(';') 56 | { 'patch_id' => split_line[0], 'patch_desc' => (split_line[1] && split_line[1].chomp) } 57 | end.compact 58 | end 59 | 60 | def get_orainst_loc 61 | if FileTest.exist?(get_ora_inv_path + '/oraInst.loc') 62 | str = '' 63 | output = File.read(get_ora_inv_path + '/oraInst.loc') 64 | output.split(/\r?\n/).each do |item| 65 | if item.match(/^inventory_loc/) 66 | str = item[14, 50] 67 | end 68 | end 69 | return str 70 | else 71 | return nil 72 | end 73 | end 74 | 75 | def get_orainst_products(path) 76 | unless path.nil? 77 | if FileTest.exist?(path + '/ContentsXML/inventory.xml') 78 | file = File.read(path + '/ContentsXML/inventory.xml') 79 | doc = REXML::Document.new file 80 | software = '' 81 | patches_fact = {} 82 | doc.elements.each('/INVENTORY/HOME_LIST/HOME') do |element| 83 | if element.attributes['REMOVED'] != 'T' 84 | str = element.attributes['LOC'] 85 | unless str.nil? 86 | software += str + ';' 87 | if str.include? 'plugins' 88 | # skip EM agent 89 | elsif str.include? 'agent' 90 | # skip EM agent 91 | elsif str.include? 'OraPlaceHolderDummyHome' 92 | # skip EM agent 93 | else 94 | home = str.gsub('/', '_').gsub("\\", '_').gsub('c:', '_c').gsub('d:', '_d').gsub('e:', '_e') 95 | opatchver = get_opatch_version(str) 96 | Facter.add("oradb_inst_opatch#{home}") do 97 | setcode do 98 | opatchver 99 | end 100 | end 101 | 102 | patches = get_opatch_patches(str) 103 | # Puppet.info "-patches hash- #{patches}" 104 | patches_fact[str] = patches unless patches.nil? 105 | end 106 | end 107 | end 108 | end 109 | Facter.add('opatch_patches') do 110 | # Puppet.info "-all patches hash- #{patches_fact}" 111 | setcode { patches_fact } 112 | end 113 | return software 114 | else 115 | return 'NotFound' 116 | end 117 | else 118 | return 'NotFound' 119 | end 120 | end 121 | 122 | # get orainst loc data 123 | inventory = get_orainst_loc 124 | Facter.add('oradb_inst_loc_data') do 125 | setcode do 126 | inventory 127 | end 128 | end 129 | 130 | # get orainst products 131 | inventory2 = get_orainst_products(inventory) 132 | Facter.add('oradb_inst_products') do 133 | setcode do 134 | inventory2 135 | end 136 | end 137 | -------------------------------------------------------------------------------- /lib/puppet/functions/oradb/cleanpath.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | # clean and return the path 3 | Puppet::Functions.create_function(:'oradb::cleanpath') do 4 | 5 | # clean and return the path 6 | # @param path some directory 7 | # @return [String] Return the directory 8 | # @example clean directory 9 | # oradb::cleanpath('/opt/oracle/db/11g/../') => '/opt/oracle/db' 10 | dispatch :cleanpath do 11 | param 'String', :path 12 | # return_type 'String' 13 | end 14 | 15 | def cleanpath(path) 16 | path2 = Pathname.new(path) 17 | path2.cleanpath.to_s 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/puppet/functions/oradb/is_oracle_patch_installed.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/log' 2 | # check is Oracle patch is already installed 3 | Puppet::Functions.create_function(:'oradb::is_oracle_patch_installed') do 4 | 5 | # check is Oracle patch is already installed 6 | # @param oracle_home_path full path to the oracle home directory 7 | # @param patch_id the patch id number 8 | # @return [Boolean] Return if it is found or not 9 | # @example is_oracle_patch_installed 10 | # oradb::is_oracle_patch_installed('/opt/oracle/db/','1111') => true 11 | dispatch :is_oracle_patch_installed do 12 | param 'String', :oracle_home_path 13 | param 'String', :patch_id 14 | # return_type 'Boolean' 15 | end 16 | 17 | def is_oracle_patch_installed(oracle_home_path, patch_id) 18 | log 'start of function' 19 | scope = closure_scope 20 | patches = scope['facts']['opatch_patches'] 21 | if patches == 'NotFound' or patches.nil? 22 | log 'return false opatch_patches is empty' 23 | return false 24 | end 25 | if patches.key?(oracle_home_path) 26 | found = patches[oracle_home_path].find { |h| h['patch_id'] == patch_id } 27 | log("#{oracle_home_path} check for #{patch_id} found #{found}") 28 | return true if found 29 | return false 30 | else 31 | log("#{oracle_home_path} not found in patches facts, return false") 32 | return false 33 | end 34 | log 'end of function return false' 35 | return false 36 | end 37 | 38 | def log(msg) 39 | Puppet::Util::Log.create( 40 | :level => :info, 41 | :message => msg, 42 | :source => 'oradb::is_oracle_patch_installed' 43 | ) 44 | end 45 | 46 | end 47 | -------------------------------------------------------------------------------- /lib/puppet/functions/oradb/opatch_version.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/log' 2 | # determine the opatch version of an oracle home 3 | Puppet::Functions.create_function(:'oradb::opatch_version') do 4 | 5 | # determine the opatch version of an oracle home 6 | # @param oracle_home_path the full path to the oracle home directory 7 | # @return [String] Return opatch version 8 | # @example Finding an Oracle product 9 | # oradb::opatch_version('/opt/oracle/db') => '11.1' 10 | dispatch :opatch_version do 11 | param 'String', :oracle_home_path 12 | # return_type 'String' 13 | end 14 | 15 | def opatch_version(oracle_home_path) 16 | 17 | oracle_home_path = oracle_home_path.strip.downcase 18 | oracle_home_path = oracle_home_path.gsub('/', '_').gsub('\\', '_').gsub('c:', '_c').gsub('d:', '_d').gsub('e:', '_e') 19 | log "stripped oracle home path #{oracle_home_path}" 20 | 21 | # check the opatch fact 22 | log "lookup fact oradb_inst_opatch#{oracle_home_path}" 23 | scope = closure_scope 24 | opatch = scope['facts']["oradb_inst_opatch#{oracle_home_path}"] 25 | if opatch == 'NotFound' or opatch.nil? 26 | log "fact not found return NotFound" 27 | return 'NotFound' 28 | else 29 | log "found value #{opatch}" 30 | return opatch 31 | end 32 | log 'end of function return NotFound' 33 | return 'NotFound' 34 | 35 | end 36 | 37 | def log(msg) 38 | Puppet::Util::Log.create( 39 | :level => :info, 40 | :message => msg, 41 | :source => 'oradb::opatch_version' 42 | ) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /lib/puppet/functions/oradb/oracle_exists.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/log' 2 | # Check if the oracle software already exists on the vm 3 | Puppet::Functions.create_function(:'oradb::oracle_exists') do 4 | 5 | # Check if the oracle software already exists on the vm 6 | # @param oracle_home_path the full path to the oracle home directory 7 | # @return [Boolean] Return if it is found or not 8 | # @example Finding an Oracle product 9 | # oradb::oracle_exists('/opt/oracle/db') => true 10 | dispatch :exists do 11 | param 'String', :oracle_home_path 12 | # return_type 'Boolean' 13 | end 14 | 15 | def exists(oracle_home_path) 16 | art_exists = false 17 | oracle_home_path = oracle_home_path.strip 18 | log "full oracle home path #{oracle_home_path}" 19 | 20 | # check the oracle products 21 | scope = closure_scope 22 | products = scope['facts']['oradb_inst_products'] 23 | log "total oracle products #{products}" 24 | if products == 'NotFound' or products.nil? 25 | return art_exists 26 | else 27 | log "find #{oracle_home_path} inside #{products}" 28 | if products.include? oracle_home_path 29 | log 'found return true' 30 | return true 31 | end 32 | end 33 | log 'end of function return false' 34 | return art_exists 35 | 36 | end 37 | 38 | def log(msg) 39 | Puppet::Util::Log.create( 40 | :level => :info, 41 | :message => msg, 42 | :source => 'oradb::oracle_exists' 43 | ) 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /lib/puppet/provider/db_control/base.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:db_control).provide(:base) do 2 | 3 | confine :true => false # This is NEVER a valid provider. It is just used as a base class 4 | 5 | def self.instances 6 | fail 'resource list not supported for db_control type' 7 | end 8 | 9 | def start 10 | instance_control :start 11 | end 12 | 13 | def stop 14 | instance_control :stop 15 | end 16 | 17 | def mount 18 | instance_control :mount 19 | end 20 | 21 | def restart 22 | instance_control :stop 23 | instance_control :start 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lib/puppet/provider/db_control/sqlplus.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:db_control).provide(:sqlplus, :parent => :base) do 2 | 3 | # 4 | # This is bit of a hack. id is always root, but we need to declare a default provider 5 | # 6 | defaultfor :id => 'root' 7 | 8 | 9 | def instance_control(action) 10 | Puppet.debug "instance action: #{action}" 11 | 12 | command, @succes_output = case action 13 | when :start 14 | ['startup', /Database opened/] 15 | when :mount 16 | ['startup mount', /Database mounted/] 17 | when :stop 18 | ['shutdown immediate', /ORACLE instance shut down/] 19 | else 20 | fail "internal error unknown action #{action}" 21 | end 22 | 23 | Puppet.info "instance action: #{action} with command #{command}" 24 | @output = sql command 25 | if unsuccessful? 26 | fail(@output) if unsuccessful? 27 | else 28 | Puppet.info "instance result: #{@output}" 29 | end 30 | end 31 | 32 | def status 33 | name = resource[:instance_name] 34 | 35 | kernel = Facter.value(:kernel) 36 | 37 | ps_bin = (kernel != 'SunOS' || (kernel == 'SunOS' && Facter.value(:kernelrelease) == '5.11')) ? '/bin/ps' : '/usr/ucb/ps' 38 | ps_arg = kernel == 'SunOS' ? 'awwx' : '-ef' 39 | 40 | command = "#{ps_bin} #{ps_arg} | /bin/grep -v grep | /bin/grep 'ora_smon_#{name}'" 41 | 42 | Puppet.debug "instance_status #{command}" 43 | output = `#{command}` 44 | output.scan(/ora_smon_#{name}/).empty? ? :stop : :start 45 | end 46 | 47 | 48 | private 49 | 50 | def unsuccessful? 51 | @output.scan(@succes_output).empty? 52 | end 53 | 54 | def sql(command) 55 | name = resource[:instance_name] 56 | oracle_home = resource[:oracle_product_home_dir] 57 | user = resource[:os_user] 58 | command = "sqlplus /nolog <<-EOF 59 | connect / as sysdba 60 | #{command} 61 | EOF" 62 | `su - #{user} -c 'export ORACLE_HOME="#{oracle_home}";export PATH="#{oracle_home}/bin:$PATH";export ORACLE_SID="#{name}";export LD_LIBRARY_PATH="#{oracle_home}/lib";#{command}'` 63 | end 64 | 65 | end 66 | -------------------------------------------------------------------------------- /lib/puppet/provider/db_control/srvctl.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:db_control).provide(:srvctl, :parent => :base) do 2 | 3 | 4 | def instance_control(action) 5 | name = resource[:instance_name] 6 | Puppet.debug "instance action: #{action} on instance type #{resource[:db_type]}" 7 | force = (action == :stop) ? '-f' : '' 8 | @output = case resource[:db_type] 9 | when :database 10 | srvctl "#{action} database -db #{name}" 11 | when :asm 12 | srvctl "#{action} asm #{force}" 13 | else 14 | fail "internal error unknown action #{action}" 15 | end 16 | if unsuccessful? 17 | fail @output 18 | else 19 | Puppet.debug @output if @output 20 | end 21 | end 22 | 23 | def status 24 | name = resource[:instance_name] 25 | @output = case resource[:db_type] 26 | when :database 27 | srvctl "status database -db #{name}" 28 | when :asm 29 | srvctl "status asm" 30 | else 31 | fail "internal error unknown action #{action}" 32 | end 33 | if unsuccessful? 34 | fail @output 35 | end 36 | Puppet.debug @output 37 | @output.scan(/is running/).empty? ? :stop : :start 38 | end 39 | 40 | private 41 | 42 | def unsuccessful? 43 | !@output.scan(/failed/).empty? 44 | end 45 | 46 | def srvctl(command) 47 | oracle_home = resource[:oracle_product_home_dir] 48 | command =[ 49 | "export ORACLE_HOME=#{oracle_home}", 50 | "export PATH=#{oracle_home}/bin:$PATH", 51 | "export LD_LIBRARY_PATH=#{oracle_home}/lib", 52 | "$ORACLE_HOME/bin/srvctl #{command}" 53 | ].join(';') 54 | Puppet.debug "instance_status #{command}" 55 | `#{command}` 56 | end 57 | 58 | end 59 | -------------------------------------------------------------------------------- /lib/puppet/provider/db_directory_structure/db_directory_structure.rb: -------------------------------------------------------------------------------- 1 | require 'fileutils' 2 | 3 | Puppet::Type.type(:db_directory_structure).provide(:db_directory_structure) do 4 | def configure 5 | name = resource[:name] 6 | oracle_base = resource[:oracle_base_dir] 7 | oracle_home = resource[:oracle_home_dir] 8 | ora_inventory = resource[:ora_inventory_dir] 9 | download_folder = resource[:download_dir] 10 | user = resource[:os_user] 11 | group = resource[:os_group] 12 | Puppet.info "configure oracle folders for #{name}" 13 | 14 | Puppet.info "create the following directories: #{oracle_base}, #{ora_inventory}, #{download_folder}" 15 | make_directory oracle_base 16 | make_directory download_folder 17 | make_directory ora_inventory 18 | 19 | owned_by_oracle oracle_base, user, group 20 | allow_everybody download_folder, user, group 21 | owned_by_oracle ora_inventory, user, group 22 | 23 | unless oracle_home.nil? 24 | make_directory oracle_home 25 | owned_by_oracle oracle_home, user, group 26 | end 27 | end 28 | 29 | def make_directory(path) 30 | Puppet.info "creating directory #{path}" 31 | FileUtils.mkdir_p path 32 | end 33 | 34 | def owned_by_oracle(path, user, group) 35 | Puppet.info "Setting oracle ownership for #{path} with 0775" 36 | FileUtils.chmod 0775, path 37 | FileUtils.chown user, group, path 38 | end 39 | 40 | def allow_everybody(path, user, group) 41 | Puppet.info "Setting public permissions 0777 for #{path}" 42 | FileUtils.chmod 0777, path 43 | FileUtils.chown user, group, path 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /lib/puppet/provider/db_listener/db_listener.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:db_listener).provide(:db_listener) do 2 | def self.instances 3 | [] 4 | end 5 | 6 | def listener_control(action) 7 | oracle_home = resource[:oracle_home_dir] 8 | oracle_base = resource[:oracle_base_dir] 9 | user = resource[:os_user] 10 | listenername = resource[:listener_name] 11 | 12 | Puppet.debug "listener action: #{action} #{listenername}" 13 | 14 | if action == :start 15 | listener_action = "start #{listenername}" 16 | else 17 | listener_action = "stop #{listenername}" 18 | end 19 | 20 | command = "#{oracle_home}/bin/lsnrctl #{listener_action}" 21 | 22 | Puppet.info "listener action: #{action} with command #{command}" 23 | 24 | output = `su - #{user} -c 'export ORACLE_HOME="#{oracle_home}";export ORACLE_BASE="#{oracle_base}";export LD_LIBRARY_PATH="#{oracle_home}/lib";cd #{oracle_home};#{command}'` 25 | Puppet.info "listener result: #{output}" 26 | end 27 | 28 | def listener_status 29 | oracle_home = resource[:oracle_home_dir] 30 | listenername = resource[:listener_name] 31 | 32 | kernel = Facter.value(:kernel) 33 | 34 | ps_bin = (kernel != 'SunOS' || (kernel == 'SunOS' && Facter.value(:kernelrelease) == '5.11')) ? '/bin/ps' : '/usr/ucb/ps' 35 | ps_arg = kernel == 'SunOS' ? 'awwx' : '-ef' 36 | 37 | # command = "#{ps_bin} #{ps_arg} | /bin/grep -v grep | /bin/grep '#{oracle_home}/bin/tnslsnr #{listenername}'" 38 | command = "#{ps_bin} #{ps_arg} | /bin/grep -v grep | /bin/grep -w -i '#{listenername}'" 39 | 40 | Puppet.debug "listener_status #{command}" 41 | output = `#{command}` 42 | 43 | output.each_line do |li| 44 | unless li.nil? 45 | Puppet.debug "line #{li}" 46 | if li.include? "#{oracle_home}/bin/tnslsnr" 47 | Puppet.debug 'found listener' 48 | return 'Found' 49 | end 50 | end 51 | end 52 | 'NotFound' 53 | end 54 | 55 | def start 56 | listener_control :start 57 | end 58 | 59 | def stop 60 | listener_control :stop 61 | end 62 | 63 | def restart 64 | listener_control :stop 65 | listener_control :start 66 | end 67 | 68 | def status 69 | output = listener_status 70 | Puppet.debug "listener_status output #{output}" 71 | if output == 'Found' 72 | return :start 73 | else 74 | return :stop 75 | end 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /lib/puppet/provider/db_opatch/db_opatch.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:db_opatch).provide(:db_opatch) do 2 | def self.instances 3 | [] 4 | end 5 | 6 | def opatch(action) 7 | user = resource[:os_user] 8 | patchName = resource[:patch_id] 9 | oracle_product_home_dir = resource[:oracle_product_home_dir] 10 | extracted_patch_dir = resource[:extracted_patch_dir] 11 | ocmrf_file = resource[:ocmrf_file] 12 | opatch_auto = resource[:opatch_auto] 13 | use_opatchauto_utility = resource[:use_opatchauto_utility] 14 | 15 | Puppet.debug "opatch auto result: #{opatch_auto}" 16 | 17 | unless ocmrf_file.nil? 18 | ocmrf = ' -ocmrf ' + ocmrf_file 19 | else 20 | ocmrf = '' 21 | end 22 | 23 | if opatch_auto == false 24 | if action == :present 25 | command = "#{oracle_product_home_dir}/OPatch/opatch apply -silent #{ocmrf} -oh #{oracle_product_home_dir} #{extracted_patch_dir}" 26 | else 27 | command = "#{oracle_product_home_dir}/OPatch/opatch rollback -id #{patchName} -silent -oh #{oracle_product_home_dir}" 28 | end 29 | else 30 | if use_opatchauto_utility == false 31 | if action == :present 32 | command = "#{oracle_product_home_dir}/OPatch/opatch auto #{extracted_patch_dir} #{ocmrf} -oh #{oracle_product_home_dir}" 33 | else 34 | command = "#{oracle_product_home_dir}/OPatch/opatch auto -rollback #{extracted_patch_dir} #{ocmrf} -oh #{oracle_product_home_dir}" 35 | end 36 | else 37 | if action == :present 38 | command = "#{oracle_product_home_dir}/OPatch/opatchauto apply #{extracted_patch_dir} #{ocmrf} -oh #{oracle_product_home_dir}" 39 | else 40 | command = "#{oracle_product_home_dir}/OPatch/opatchauto rollback #{extracted_patch_dir} #{ocmrf} -oh #{oracle_product_home_dir}" 41 | end 42 | end 43 | end 44 | 45 | Puppet.info "opatch action: #{action} with command #{command}" 46 | if opatch_auto == true 47 | output = `export ORACLE_HOME=#{oracle_product_home_dir}; chmod -R +r #{extracted_patch_dir}; cd #{oracle_product_home_dir}; #{command}` 48 | else 49 | output2 = `chmod -R +r #{extracted_patch_dir}` 50 | output = `su - #{user} -c 'export ORACLE_HOME=#{oracle_product_home_dir}; cd #{oracle_product_home_dir}; #{command}'` 51 | end 52 | Puppet.info "opatch result: #{output}" 53 | 54 | result = false 55 | output.each_line do |li| 56 | unless li.nil? 57 | if li.include? 'OPatch completed' or li.include? 'OPatch succeeded' or li.include? 'opatch auto succeeded' or li.include? 'opatchauto succeeded' or li.include? 'OPatchAuto successful' or li.include? 'Patching is completed successfully' 58 | result = true 59 | end 60 | end 61 | end 62 | fail(output) if result == false 63 | end 64 | 65 | def opatch_status 66 | user = resource[:os_user] 67 | patchName = resource[:patch_id] 68 | oracle_product_home_dir = resource[:oracle_product_home_dir] 69 | orainst_dir = resource[:orainst_dir] 70 | bundle_sub_patch_id = resource[:bundle_sub_patch_id] 71 | # opatch_auto = resource[:opatch_auto] 72 | 73 | unless bundle_sub_patch_id.nil? 74 | patchId = bundle_sub_patch_id 75 | else 76 | patchId = patchName 77 | end 78 | 79 | Puppet.info "search for patchid #{patchId}" 80 | 81 | command = oracle_product_home_dir + '/OPatch/opatch lsinventory -patch_id -oh ' + oracle_product_home_dir + ' -invPtrLoc ' + orainst_dir + '/oraInst.loc' 82 | Puppet.info "opatch_status for patch #{patchName} command: #{command}" 83 | 84 | output = `su - #{user} -c '#{command}'` 85 | Puppet.debug "#{output}" 86 | # output = execute command, :failonfail => true ,:uid => user 87 | output.each_line do |li| 88 | opatch = li[5, li.index(':') - 5].strip + ';' if (li['Patch'] and li[': applied on']) 89 | unless opatch.nil? 90 | Puppet.debug "line #{opatch}" 91 | if opatch.include? patchId 92 | Puppet.debug 'found patch' 93 | return patchId 94 | end 95 | end 96 | end 97 | 'NotFound' 98 | end 99 | 100 | def present 101 | opatch :present 102 | end 103 | 104 | def absent 105 | opatch :absent 106 | end 107 | 108 | def status 109 | output = opatch_status 110 | 111 | patchName = resource[:patch_id] 112 | bundle_sub_patch_id = resource[:bundle_sub_patch_id] 113 | # opatch_auto = resource[:opatch_auto] 114 | 115 | unless bundle_sub_patch_id.nil? 116 | patchId = bundle_sub_patch_id 117 | else 118 | patchId = patchName 119 | end 120 | 121 | Puppet.info "opatch_status output #{output} for patchId #{patchId}" 122 | if output == patchId 123 | return :present 124 | else 125 | return :absent 126 | end 127 | end 128 | end 129 | -------------------------------------------------------------------------------- /lib/puppet/provider/db_rcu/db_rcu.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:db_rcu).provide(:db_rcu) do 2 | def self.instances 3 | [] 4 | end 5 | 6 | def rcu(action) 7 | Puppet.info "RCU #{action}" 8 | user = resource[:os_user] 9 | statement = resource[:statement] 10 | # oracle_home = resource[:oracle_home] 11 | 12 | # environment = "SQLPLUS_HOME=#{oracle_home}" 13 | Puppet.debug "rcu statement: #{statement}" 14 | 15 | # stdin from password file is lost if running as oracle but try to su 16 | if Puppet.features.root? 17 | output = `su - #{user} -c '#{statement}'` 18 | else 19 | output = `#{statement}` 20 | end 21 | 22 | # output = execute statement, :failonfail => true ,:uid => user, :custom_environment => environment 23 | Puppet.info "RCU result: #{output}" 24 | result = false 25 | output.each_line do |li| 26 | unless li.nil? 27 | if li.include? 'Operation Completed' 28 | result = true 29 | end 30 | end 31 | end 32 | fail(output) if result == false 33 | end 34 | 35 | def rcu_status 36 | Puppet.debug 'rcu_status' 37 | 38 | oracle_home = resource[:oracle_home] 39 | sys_user = resource[:sys_user] 40 | sys_password = resource[:sys_password] 41 | user = resource[:os_user] 42 | prefix = resource[:name] 43 | db_service = resource[:db_service] 44 | db_server = resource[:db_server] 45 | 46 | sql = <<-EOS 47 | set term off echo off pages 0 colsep '|' trimspool on 48 | spool /tmp/check_rcu_#{prefix}2.txt 49 | select distinct 'found' from system.schema_version_registry where upper(mrc_name) = upper('#{prefix}'); 50 | grant execute on sys.dbms_job to PUBLIC; 51 | grant execute on sys.dbms_reputil to PUBLIC; 52 | spool off 53 | exit 54 | EOS 55 | 56 | tmpFile = Tempfile.new(['rcuCheck', '.sql']) 57 | tmpFile.write(sql) 58 | tmpFile.close 59 | FileUtils.chmod(0555, tmpFile.path) 60 | 61 | Puppet.debug "rcu for prefix #{prefix} execute SQL" 62 | output = `su - #{user} -c 'export ORACLE_HOME=#{oracle_home};LD_LIBRARY_PATH=#{oracle_home}/lib #{oracle_home}/bin/sqlplus \"#{sys_user}/#{sys_password}@//#{db_server}/#{db_service} as sysdba\" @#{tmpFile.path}'` 63 | 64 | # output = system('su', '-', user, '-c', 'export', 'ORACLE_HOME=#{oracle_home};LD_LIBRARY_PATH=#{oracle_home}/lib', 65 | # "#{oracle_home}/bin/sqlplus", " \"#{sys_user}/'#{sys_password}'@//#{db_server}/#{db_service} as sysdba\"", "@#{tmpFile.path}") 66 | raise ArgumentError, "Error executing puppet code, #{output}" if $? != 0 67 | 68 | if FileTest.exist?("/tmp/check_rcu_#{prefix}2.txt") 69 | File.open("/tmp/check_rcu_#{prefix}2.txt") do |outputfile| 70 | outputfile.each_line do |li| 71 | unless li.nil? 72 | Puppet.debug "line #{li}" 73 | if (li.include? 'found') and !(li.include? 'select') 74 | Puppet.debug "found RCU #{prefix}" 75 | return prefix 76 | end 77 | end 78 | end 79 | end 80 | else 81 | return 'NoOutput' 82 | end 83 | 'NotFound' 84 | end 85 | 86 | def present 87 | rcu :present 88 | end 89 | 90 | def absent 91 | rcu :absent 92 | end 93 | 94 | def status 95 | Puppet.debug 'status' 96 | 97 | if resource[:oracle_home].nil? 98 | if resource[:ensure] == :present 99 | return :absent 100 | else 101 | return :present 102 | end 103 | end 104 | 105 | output = rcu_status 106 | prefix = resource[:name] 107 | Puppet.info "rcu_status output #{output} for prefix #{prefix}" 108 | if output == prefix 109 | return :present 110 | else 111 | return :absent 112 | end 113 | end 114 | 115 | end 116 | -------------------------------------------------------------------------------- /lib/puppet/type/db_control.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Type::newtype(:db_control) do 3 | desc 'control the database instance state like running,stop,restart' 4 | 5 | newproperty(:ensure) do 6 | desc 'Whether to do something.' 7 | 8 | newvalue(:start, :event => :instance_running) do 9 | unless resource[:refreshonly] == :true 10 | provider.start 11 | end 12 | end 13 | 14 | newvalue(:stop, :event => :instance_stop) do 15 | unless resource[:refreshonly] == :true 16 | provider.stop 17 | end 18 | end 19 | 20 | newvalue(:mount, :event => :instance_running) do 21 | unless resource[:refreshonly] == :true 22 | provider.mount 23 | end 24 | end 25 | 26 | aliasvalue(:running, :start) 27 | aliasvalue(:abort, :stop) 28 | aliasvalue(:stopped, :stop) 29 | 30 | def retrieve 31 | provider.status 32 | end 33 | 34 | def sync 35 | event = super() 36 | 37 | if property = @resource.property(:enable) 38 | val = property.retrieve 39 | property.sync unless property.safe_insync?(val) 40 | end 41 | 42 | event 43 | end 44 | end 45 | 46 | newparam(:name) do 47 | desc <<-EOT 48 | The title. 49 | EOT 50 | isnamevar 51 | end 52 | 53 | newparam(:instance_name) do 54 | desc <<-EOT 55 | The database instance name. 56 | EOT 57 | end 58 | 59 | newparam(:db_type) do 60 | desc <<-EOT 61 | The type of instance. 62 | EOT 63 | 64 | defaultto(:database) 65 | newvalues(:database, :asm) 66 | aliasvalue(:grid, :asm) 67 | end 68 | 69 | newparam(:oracle_product_home_dir) do 70 | desc <<-EOT 71 | The oracle product home folder. 72 | EOT 73 | end 74 | 75 | newparam(:os_user) do 76 | desc <<-EOT 77 | The weblogic operating system user. 78 | EOT 79 | end 80 | 81 | newparam(:refreshonly) do 82 | desc <<-EOT 83 | The command should only be run as a 84 | refresh mechanism for when a dependent object is changed. 85 | EOT 86 | 87 | newvalues(:true, :false) 88 | 89 | defaultto :false 90 | end 91 | 92 | def refresh 93 | Puppet.info 'db_control refresh' 94 | provider.restart 95 | end 96 | 97 | end 98 | end 99 | -------------------------------------------------------------------------------- /lib/puppet/type/db_directory_structure.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Type::newtype(:db_directory_structure) do 3 | desc 'add all the directories needed by the oracle db or asm installation' 4 | 5 | newparam(:name) do 6 | desc <<-EOT 7 | The title. 8 | EOT 9 | isnamevar 10 | end 11 | 12 | newproperty(:ensure) do 13 | desc 'Whether to do something.' 14 | 15 | newvalue(:present) do 16 | provider.configure 17 | end 18 | 19 | def retrieve 20 | oracle_base = resource[:oracle_base_dir] 21 | ora_inventory = resource[:ora_inventory_dir] 22 | download_folder = resource[:download_dir] 23 | 24 | if File.exist?(oracle_base) && File.exist?(ora_inventory) && File.exist?(download_folder) 25 | :present 26 | else 27 | :absent 28 | end 29 | end 30 | end 31 | 32 | newparam(:oracle_base_dir) do 33 | desc <<-EOT 34 | The oracle base folder. 35 | EOT 36 | validate do |value| 37 | if value.nil? 38 | fail ArgumentError, 'oracle_base_dir cannot be empty' 39 | end 40 | end 41 | end 42 | 43 | newparam(:oracle_home_dir) do 44 | desc <<-EOT 45 | The oracle home folder. 46 | EOT 47 | end 48 | 49 | newparam(:ora_inventory_dir) do 50 | desc <<-EOT 51 | The oracle inventory folder. 52 | EOT 53 | validate do |value| 54 | if value.nil? 55 | fail ArgumentError, 'ora_inventory_dir cannot be empty' 56 | end 57 | end 58 | end 59 | 60 | newparam(:download_dir) do 61 | desc <<-EOT 62 | The download folder. 63 | EOT 64 | validate do |value| 65 | if value.nil? 66 | fail ArgumentError, 'download_dir cannot be empty' 67 | end 68 | end 69 | end 70 | 71 | newparam(:os_user) do 72 | desc <<-EOT 73 | The weblogic operating system user. 74 | EOT 75 | 76 | defaultto 'oracle' 77 | end 78 | 79 | newparam(:os_group) do 80 | desc <<-EOT 81 | The weblogic operating system group. 82 | EOT 83 | 84 | defaultto 'oinstall' 85 | end 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /lib/puppet/type/db_listener.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Type::newtype(:db_listener) do 3 | desc 'control the oracle db listener state like running,stop,restart' 4 | 5 | newproperty(:ensure) do 6 | desc 'Whether to do something.' 7 | 8 | newvalue(:start, :event => :listener_running) do 9 | unless resource[:refreshonly] == :true 10 | provider.start 11 | end 12 | end 13 | 14 | newvalue(:stop, :event => :listener_stop) do 15 | unless resource[:refreshonly] == :true 16 | provider.stop 17 | end 18 | end 19 | 20 | aliasvalue(:running, :start) 21 | aliasvalue(:abort, :stop) 22 | 23 | def retrieve 24 | provider.status 25 | end 26 | 27 | def insync?(to) 28 | if resource[:refreshonly] == :true 29 | true 30 | else 31 | to == should 32 | end 33 | end 34 | 35 | def sync 36 | event = super() 37 | if property = @resource.property(:enable) 38 | val = property.retrieve 39 | property.sync unless property.safe_insync?(val) 40 | end 41 | event 42 | end 43 | end 44 | 45 | newparam(:name) do 46 | desc <<-EOT 47 | The title. 48 | EOT 49 | isnamevar 50 | end 51 | 52 | newparam(:oracle_base_dir) do 53 | desc <<-EOT 54 | The oracle base folder. 55 | EOT 56 | end 57 | 58 | newparam(:oracle_home_dir) do 59 | desc <<-EOT 60 | The oracle home folder. 61 | EOT 62 | end 63 | 64 | newparam(:os_user) do 65 | desc <<-EOT 66 | The weblogic operating system user. 67 | EOT 68 | 69 | defaultto 'oracle' 70 | end 71 | 72 | newparam(:listener_name) do 73 | desc <<-EOT 74 | Listener name. 75 | EOT 76 | 77 | defaultto 'listener' 78 | end 79 | 80 | newparam(:refreshonly) do 81 | desc <<-EOT 82 | The command should only be run as a 83 | refresh mechanism for when a dependent object is changed. 84 | EOT 85 | 86 | newvalues(true, false) 87 | 88 | defaultto false 89 | end 90 | 91 | def refresh 92 | Puppet.info 'db_listener refresh' 93 | provider.restart 94 | end 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /lib/puppet/type/db_opatch.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Type::newtype(:db_opatch) do 3 | desc 'This is the Oracle Patch process called OPatch' 4 | 5 | newproperty(:ensure) do 6 | desc 'Whether a patch should be applied.' 7 | 8 | newvalue(:present, :event => :opatch_installed) do 9 | provider.present 10 | end 11 | 12 | newvalue(:absent, :event => :opatch_absent) do 13 | provider.absent 14 | end 15 | 16 | aliasvalue(:installed, :present) 17 | aliasvalue(:purged, :absent) 18 | 19 | def retrieve 20 | provider.status 21 | end 22 | 23 | def sync 24 | event = super() 25 | 26 | if property = @resource.property(:enable) 27 | val = property.retrieve 28 | property.sync unless property.safe_insync?(val) 29 | end 30 | 31 | event 32 | end 33 | end 34 | 35 | newparam(:name) do 36 | desc <<-EOT 37 | The name of the OPatch. 38 | EOT 39 | isnamevar 40 | end 41 | 42 | newparam(:patch_id) do 43 | desc <<-EOT 44 | The patchId of the OPatch. 45 | EOT 46 | end 47 | 48 | newparam(:os_user) do 49 | desc <<-EOT 50 | The weblogic operating system user. 51 | EOT 52 | end 53 | 54 | newparam(:oracle_product_home_dir) do 55 | desc <<-EOT 56 | The oracle product home folder. 57 | EOT 58 | end 59 | 60 | newparam(:orainst_dir) do 61 | desc <<-EOT 62 | The orainst folder. 63 | EOT 64 | end 65 | 66 | newparam(:extracted_patch_dir) do 67 | desc <<-EOT 68 | The extracted patch folder. 69 | EOT 70 | end 71 | 72 | newparam(:ocmrf_file) do 73 | desc <<-EOT 74 | The ocmrf file. 75 | EOT 76 | end 77 | 78 | newparam(:opatch_auto) do 79 | desc <<-EOT 80 | opatch auto bundle patch 81 | EOT 82 | end 83 | 84 | newparam(:use_opatchauto_utility) do 85 | desc <<-EOT 86 | use the opatchauto_utility instead of opatch auto 87 | EOT 88 | end 89 | 90 | newparam(:bundle_sub_patch_id) do 91 | desc <<-EOT 92 | One of the Sub patch number of the bundle patch 93 | EOT 94 | end 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /lib/puppet/type/db_rcu.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Type::newtype(:db_rcu) do 3 | desc 'This is the Oracle RCU ( Repository creation utility) installer type' 4 | 5 | newproperty(:ensure) do 6 | desc 'Whether a Repository should be created.' 7 | 8 | newvalue(:present, :event => :rcu_installed) do 9 | provider.present 10 | end 11 | 12 | newvalue(:absent, :event => :rcu_absent) do 13 | provider.absent 14 | end 15 | 16 | aliasvalue(:create, :present) 17 | aliasvalue(:delete, :absent) 18 | 19 | def retrieve 20 | provider.status 21 | end 22 | 23 | def sync 24 | event = super() 25 | 26 | if property = @resource.property(:enable) 27 | val = property.retrieve 28 | property.sync unless property.safe_insync?(val) 29 | end 30 | 31 | event 32 | end 33 | end 34 | 35 | newparam(:name) do 36 | desc <<-EOT 37 | The prefix of the RCU. 38 | EOT 39 | isnamevar 40 | end 41 | 42 | newparam(:os_user) do 43 | desc <<-EOT 44 | The weblogic operating system user. 45 | EOT 46 | end 47 | 48 | newparam(:oracle_home) do 49 | desc <<-EOT 50 | The oracle database home folder. 51 | EOT 52 | end 53 | 54 | newparam(:sys_user) do 55 | desc <<-EOT 56 | The sys username for the RCU check/install. 57 | EOT 58 | end 59 | 60 | newparam(:sys_password) do 61 | desc <<-EOT 62 | The sys password for the RCU check/install. 63 | EOT 64 | end 65 | 66 | newparam(:db_server) do 67 | desc <<-EOT 68 | The database server for the RCU check/install. 69 | EOT 70 | end 71 | 72 | newparam(:db_service) do 73 | desc <<-EOT 74 | The database service for the RCU check/install. 75 | EOT 76 | end 77 | 78 | newparam(:statement) do 79 | desc <<-EOT 80 | The RCU statement. 81 | EOT 82 | end 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /manifests/autostartdatabase.pp: -------------------------------------------------------------------------------- 1 | # 2 | # autostartdatabase 3 | # 4 | # autostart of the nodemanager for linux & Solaris 5 | # 6 | # @example configuration 7 | # 8 | # oradb::autostartdatabase{'dbora': 9 | # oracle_home => '/opt/oracle/product/11g', 10 | # db_name => 'ORCL', 11 | # user => 'oracle', 12 | # service_name => 'dbora' 13 | # } 14 | # 15 | # @param oracle_home 16 | # @param db_name 17 | # @param user 18 | # @param service_name 19 | # 20 | define oradb::autostartdatabase( 21 | String $oracle_home = undef, 22 | String $db_name = lookup('oradb::database_name'), 23 | String $user = lookup('oradb::user'), 24 | String $service_name = lookup('oradb::host::service_name') 25 | ){ 26 | 27 | class { 'oradb::prepareautostart': 28 | oracle_home => $oracle_home, 29 | user => $user, 30 | service_name => $service_name, 31 | } 32 | 33 | $exec_path = lookup('oradb::exec_path') 34 | $oratab = lookup('oradb::oratab') 35 | $dbora_location = lookup('oradb::dbora_dir') 36 | 37 | case $facts['kernel'] { 38 | 'Linux': { 39 | $sed_command = "sed -i -e's/:N/:Y/g' ${oratab}" 40 | } 41 | 'SunOS': { 42 | $sed_command = "sed -e's/:N/:Y/g' ${oratab} > /tmp/oratab.tmp && mv /tmp/oratab.tmp ${oratab}" 43 | } 44 | default: { 45 | fail('Unrecognized operating system, please use it on a Linux or SunOS host') 46 | } 47 | } 48 | 49 | exec { "set ${service_name} ${db_name}:${oracle_home}": 50 | command => $sed_command, 51 | unless => "/bin/grep '^${db_name}:${oracle_home}:Y' ${oratab}", 52 | require => File["${dbora_location}/${service_name}"], 53 | path => $exec_path, 54 | logoutput => true, 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /manifests/database_pluggable.pp: -------------------------------------------------------------------------------- 1 | # 2 | # database_pluggable 3 | # 4 | # add or delete a pluggable database to a container database 5 | # 6 | # @example pluggable database 7 | # 8 | # oradb::database_pluggable{'pdb1': 9 | # ensure => 'present', 10 | # version => '12.1', 11 | # oracle_home_dir => '/oracle/product/12.1/db', 12 | # user => 'oracle', 13 | # group => 'dba', 14 | # source_db => 'orcl', 15 | # pdb_name => 'pdb1', 16 | # pdb_admin_username => 'pdb_adm', 17 | # pdb_admin_password => 'Welcome01', 18 | # pdb_datafile_destination => "/oracle/oradata/orcl/pdb1", 19 | # create_user_tablespace => true, 20 | # log_output => true, 21 | # } 22 | # 23 | # @param version Oracle installation version 24 | # @param oracle_home_dir full path to the Oracle Home directory inside Oracle Base 25 | # @param user operating system user 26 | # @param group the operating group name for using the oracle software 27 | # @param log_output log all output 28 | # @param ensure add or delete the pluggable container 29 | # @param source_db the source container database 30 | # @param pdb_name the pluggable DB name 31 | # @param pdb_datafile_destination the pluggable DB datafile location 32 | # @param pdb_admin_username the pluggable DB admin username 33 | # @param pdb_admin_password the pluggable DB admin password 34 | # @param create_user_tablespace create user tablespace for the pluggable DB 35 | # 36 | define oradb::database_pluggable( 37 | Enum['present', 'absent'] $ensure = 'present', 38 | Enum['12.1', '12.2', '18.3', '19.3'] $version = lookup('oradb::version'), 39 | String $oracle_base = undef, 40 | String $oracle_home_dir = undef, 41 | String $user = lookup('oradb::user'), 42 | String $group = lookup('oradb::group'), 43 | String $source_db = undef, 44 | String $pdb_name = undef, 45 | String $pdb_datafile_destination = undef, 46 | String $pdb_admin_username = 'pdb_adm', 47 | String $pdb_admin_password = undef, 48 | Boolean $create_user_tablespace = true, 49 | Boolean $log_output = false, 50 | ){ 51 | $exec_path = lookup('oradb::exec_path') 52 | 53 | if ( $ensure == 'present') { 54 | $command = "${oracle_home_dir}/bin/dbca -silent -createPluggableDatabase -sourceDB ${source_db} -pdbName ${pdb_name} -createPDBFrom DEFAULT -pdbAdminUserName ${pdb_admin_username} -pdbAdminPassword ${pdb_admin_password} -pdbDatafileDestination ${pdb_datafile_destination} -createUserTableSpace ${create_user_tablespace}" 55 | 56 | exec { "dbca pdb execute ${title}": 57 | command => $command, 58 | timeout => 0, 59 | path => $exec_path, 60 | cwd => $oracle_home_dir, 61 | user => $user, 62 | group => $group, 63 | creates => "${oracle_base}/cfgtoollogs/dbca/${source_db}/${pdb_name}/postPDBCreation.log", 64 | logoutput => $log_output, 65 | returns => [6,0], 66 | } 67 | } else { 68 | $command = "${oracle_home_dir}/bin/dbca -silent -deletePluggableDatabase -sourceDB ${source_db} -pdbName ${pdb_name}" 69 | 70 | exec { "dbca pdb execute ${title}": 71 | command => $command, 72 | timeout => 0, 73 | path => $exec_path, 74 | cwd => $oracle_home_dir, 75 | user => $user, 76 | group => $group, 77 | onlyif => "test ! -f ${oracle_base}/cfgtoollogs/dbca/${source_db}/${pdb_name}/deletePDB.log", 78 | logoutput => $log_output, 79 | } 80 | 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /manifests/dbactions.pp: -------------------------------------------------------------------------------- 1 | # 2 | # dbactions 3 | # 4 | # Oracle database control like stop, start & mount 5 | # 6 | # @example dbactions 7 | # 8 | # oradb::dbactions{ 'start testDb': 9 | # oracle_home => '/oracle/product/11.2/db', 10 | # user => 'oracle', 11 | # group => 'dba', 12 | # action => 'start', 13 | # db_name => 'test', 14 | # } 15 | # 16 | # @param user operating system user 17 | # @param group the operating group name for using the oracle software 18 | # @param db_type 19 | # @param oracle_home full path to the Oracle Home directory inside Oracle Base 20 | # @param action start, mount or stop the database 21 | # @param db_name 22 | # @param provider 23 | # 24 | define oradb::dbactions( 25 | Enum['database', 'grid', 'asm'] $db_type = 'database', 26 | Optional[String] $oracle_home = undef, 27 | String $user = lookup('oradb::user'), 28 | String $group = lookup('oradb::group'), 29 | Enum['start', 'stop', 'running', 'abort','mount'] $action = 'start', 30 | String $db_name = lookup('oradb::database_name'), 31 | Enum['srvctl','sqlplus'] $provider = 'sqlplus', 32 | ){ 33 | if ( $db_type in ['grid','asm'] and $provider != 'srvctl') { 34 | fail('Provider must be srvctl if db_type is grid or asm') 35 | } 36 | if ( $db_type in ['grid','asm'] and !($action in ['running','start','abort','stop'])) { 37 | fail('Unrecognized action for db_type grid and asm, use running, start, abort or stop') 38 | } 39 | if ( $db_type == 'database' and !($action in ['running','start','abort','stop','mount'])) { 40 | fail('Unrecognized action for db_type grid and asm, use running, start, abort, stop or mount') 41 | } 42 | 43 | db_control{"instance control ${title}": 44 | ensure => $action, 45 | provider => $provider, 46 | instance_name => $db_name, 47 | oracle_product_home_dir => $oracle_home, 48 | os_user => $user, 49 | db_type => $db_type, 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /manifests/init.pp: -------------------------------------------------------------------------------- 1 | # 2 | # oradb 3 | # 4 | # oradb init class 5 | # 6 | class oradb() { 7 | } 8 | -------------------------------------------------------------------------------- /manifests/listener.pp: -------------------------------------------------------------------------------- 1 | # 2 | # listener 3 | # 4 | # Oracle listener control 5 | # 6 | # @example listener configuration 7 | # 8 | # oradb::listener{'start listener': 9 | # action => 'start', 10 | # oracle_base => '/oracle', 11 | # oracle_home => '/oracle/product/11.2/db', 12 | # user => 'oracle', 13 | # group => 'dba', 14 | # listener_name => 'listener', 15 | # } 16 | # 17 | # @param oracle_base full path to the Oracle Base directory 18 | # @param oracle_home full path to the Oracle Home directory inside Oracle Base 19 | # @param user operating system user 20 | # @param group the operating group name for using the oracle software 21 | # @param action listener control action 22 | # @param listener_name the name of the listener 23 | # 24 | define oradb::listener( String $oracle_base = undef, 25 | String $oracle_home = undef, 26 | String $user = lookup('oradb::user'), 27 | String $group = lookup('oradb::group'), 28 | Enum['running', 'start', 'abort', 'stop'] $action = 'start', 29 | String $listener_name = 'listener', 30 | ) 31 | { 32 | 33 | db_listener{ $title: 34 | ensure => $action, 35 | oracle_base_dir => $oracle_base, 36 | oracle_home_dir => $oracle_home, 37 | os_user => $user, 38 | listener_name => $listener_name, 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /manifests/net.pp: -------------------------------------------------------------------------------- 1 | # 2 | # net 3 | # 4 | # Configure Oracle Net 5 | # 6 | # @example net configuration 7 | # 8 | # oradb::net{ 'config net8': 9 | # oracle_home => '/oracle/product/11.2/db', 10 | # version => '12.1, 11 | # user => 'oracle', 12 | # group => 'dba', 13 | # download_dir => '/var/tmp/install', 14 | # db_port => '1521', 15 | # } 16 | # 17 | # @param version Oracle installation version 18 | # @param oracle_home full path to the Oracle Home directory inside Oracle Base 19 | # @param user operating system user 20 | # @param group the operating group name for using the oracle software 21 | # @param download_dir location for installation files used by this module 22 | # @param db_port the listener port 23 | # 24 | define oradb::net( 25 | String $oracle_home = undef, 26 | Enum['11.2', '12.1', '12.2', '18.3', '19.3'] $version = lookup('oradb::version'), 27 | String $user = lookup('oradb::user'), 28 | String $group = lookup('oradb::group'), 29 | String $download_dir = lookup('oradb::download_dir'), 30 | Integer $db_port = lookup('oradb::listener_port'), 31 | ){ 32 | $exec_path = lookup('oradb::exec_path') 33 | 34 | file { "${download_dir}/netca_${version}.rsp": 35 | ensure => present, 36 | content => epp("oradb/netca_${version}.rsp.epp", { 'db_port' => $db_port }), 37 | mode => '0775', 38 | owner => $user, 39 | group => $group, 40 | } 41 | 42 | exec { "install oracle net ${title}": 43 | command => "${oracle_home}/bin/netca /silent /responsefile ${download_dir}/netca_${version}.rsp", 44 | require => File["${download_dir}/netca_${version}.rsp"], 45 | creates => "${oracle_home}/network/admin/listener.ora", 46 | path => $exec_path, 47 | user => $user, 48 | group => $group, 49 | environment => ["USER=${user}",], 50 | logoutput => true, 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /manifests/opatch.pp: -------------------------------------------------------------------------------- 1 | # 2 | # opatch 3 | # 4 | # installs oracle patches for Oracle products 5 | # 6 | # @example opatch 7 | # 8 | # oradb::opatch{'19121551_db_patch': 9 | # ensure => 'present', 10 | # oracle_product_home => /app/oracle/product/11.2/db', 11 | # patch_id => '19121551', 12 | # patch_file => 'p19121551_112040_Linux-x86-64.zip', 13 | # user => 'oracle', 14 | # group => 'oinstall', 15 | # download_dir => '/var/tmp/install', 16 | # ocmrf => true, 17 | # puppet_download_mnt_point => '/software', 18 | # } 19 | # 20 | # @param oracle_product_home full path to the Oracle Home directory 21 | # @param user operating system user 22 | # @param group the operating group name for using the oracle software 23 | # @param download_dir location for installation files used by this module 24 | # @param puppet_download_mnt_point the location where the installation software is available 25 | # @param remote_file the installation is remote accessiable or not 26 | # @param ensure patch should be applied or removed 27 | # @param patch_id the opatch id 28 | # @param patch_file the opatch patch file 29 | # @param clusterware use opatch auto 30 | # @param use_opatchauto_utility 31 | # @param bundle_sub_patch_id sub opatch id in case of a bundle patch to check if the bundle patch is already applied 32 | # @param bundle_sub_folder just apply a patch from a bundle 33 | # @param ocmrf 34 | # 35 | define oradb::opatch( 36 | Enum['present', 'absent'] $ensure = 'present', 37 | String $oracle_product_home = undef, 38 | String $patch_id = undef, 39 | String $patch_file = undef, 40 | Boolean $clusterware = false, # opatch auto or opatch apply 41 | Boolean $use_opatchauto_utility = false, 42 | Optional[String] $bundle_sub_patch_id = undef, 43 | Optional[String] $bundle_sub_folder = undef, 44 | String $user = lookup('oradb::user'), 45 | String $group = lookup('oradb::group'), 46 | String $download_dir = lookup('oradb::download_dir'), 47 | Boolean $ocmrf = false, 48 | String $puppet_download_mnt_point = lookup('oradb::module_mountpoint'), 49 | Boolean $remote_file = true, 50 | String $ora_inst_path = lookup('oradb::orainst_dir'), 51 | ) 52 | { 53 | $exec_path = lookup('oradb::exec_path') 54 | 55 | if ! defined(File["${oracle_product_home}/bin/fuser"]) { 56 | file { "${oracle_product_home}/bin/fuser": 57 | ensure => present, 58 | mode => '0755' 59 | } 60 | } 61 | 62 | if $ensure == 'present' { 63 | if $remote_file == true { 64 | # the patch used by the opatch 65 | if ! defined(File["${download_dir}/${patch_file}"]) { 66 | file { "${download_dir}/${patch_file}": 67 | ensure => present, 68 | source => "${puppet_download_mnt_point}/${patch_file}", 69 | mode => '0775' 70 | } 71 | } 72 | } 73 | } 74 | 75 | case $facts['kernel'] { 76 | 'Linux', 'SunOS': { 77 | if $ensure == 'present' { 78 | if $remote_file == true { 79 | exec { "extract opatch ${patch_file} ${title}": 80 | command => "unzip -n ${download_dir}/${patch_file} -d ${download_dir}", 81 | require => File["${download_dir}/${patch_file}"], 82 | creates => "${download_dir}/${patch_id}", 83 | path => $exec_path, 84 | user => $user, 85 | group => $group, 86 | logoutput => false, 87 | before => Db_opatch["${patch_id} ${title}"], 88 | } 89 | } else { 90 | exec { "extract opatch ${patch_file} ${title}": 91 | command => "unzip -n ${puppet_download_mnt_point}/${patch_file} -d ${download_dir}", 92 | creates => "${download_dir}/${patch_id}", 93 | path => $exec_path, 94 | user => $user, 95 | group => $group, 96 | logoutput => false, 97 | before => Db_opatch["${patch_id} ${title}"], 98 | } 99 | } 100 | } 101 | 102 | # sometimes the bundle patch inside an other folder 103 | if ( $bundle_sub_folder ) { 104 | $extracted_patch_dir = "${download_dir}/${patch_id}/${bundle_sub_folder}" 105 | } else { 106 | $extracted_patch_dir = "${download_dir}/${patch_id}" 107 | } 108 | 109 | if $ocmrf == true { 110 | 111 | db_opatch{ "${patch_id} ${title}": 112 | ensure => $ensure, 113 | patch_id => $patch_id, 114 | os_user => $user, 115 | oracle_product_home_dir => $oracle_product_home, 116 | orainst_dir => $ora_inst_path, 117 | extracted_patch_dir => $extracted_patch_dir, 118 | ocmrf_file => "${oracle_product_home}/OPatch/ocm.rsp", 119 | bundle_sub_patch_id => $bundle_sub_patch_id, 120 | opatch_auto => $clusterware, 121 | use_opatchauto_utility => $use_opatchauto_utility, 122 | } 123 | 124 | } else { 125 | 126 | db_opatch{ "${patch_id} ${title}": 127 | ensure => $ensure, 128 | patch_id => $patch_id, 129 | os_user => $user, 130 | oracle_product_home_dir => $oracle_product_home, 131 | orainst_dir => $ora_inst_path, 132 | extracted_patch_dir => $extracted_patch_dir, 133 | bundle_sub_patch_id => $bundle_sub_patch_id, 134 | opatch_auto => $clusterware, 135 | use_opatchauto_utility => $use_opatchauto_utility, 136 | } 137 | 138 | } 139 | } 140 | default: { 141 | fail('Unrecognized operating system') 142 | } 143 | } 144 | } -------------------------------------------------------------------------------- /manifests/opatchupgrade.pp: -------------------------------------------------------------------------------- 1 | # 2 | # opatchupgrade 3 | # 4 | # upgrades oracle opatch of an Oracle Home 5 | # 6 | # @example opatch upgrade 7 | # 8 | # oradb::opatchupgrade{'112000_opatch_upgrade': 9 | # oracle_home => '/oracle/product/11.2/db', 10 | # patch_file => 'p6880880_112000_Linux-x86-64.zip', 11 | # csi_number => undef, 12 | # support_id => undef, 13 | # opversion => '11.2.0.3.6', 14 | # user => 'oracle', 15 | # group => 'dba', 16 | # download_dir => '/install', 17 | # puppet_download_mnt_point => $puppet_download_mnt_point, 18 | # } 19 | # 20 | # @param oracle_home full path to the Oracle Home directory 21 | # @param user operating system user 22 | # @param group the operating group name for using the oracle software 23 | # @param download_dir location for installation files used by this module 24 | # @param puppet_download_mnt_point the location where the installation software is available 25 | # @param patch_file the opatch upgrade patch file 26 | # @param csi_number oracle support csi number 27 | # @param support_id oracle support id 28 | # @param opversion opatch version of current patch 29 | # 30 | define oradb::opatchupgrade( 31 | String $oracle_home = undef, 32 | String $patch_file = undef, 33 | Optional[Integer] $csi_number = undef, 34 | Optional[String] $support_id = undef, 35 | String $opversion = undef, 36 | String $user = lookup('oradb::user'), 37 | String $group = lookup('oradb::group'), 38 | String $download_dir = lookup('oradb::download_dir'), 39 | String $puppet_download_mnt_point = lookup('oradb::module_mountpoint'), 40 | Boolean $remote_file = true, 41 | ){ 42 | $exec_path = lookup('oradb::exec_path') 43 | $patch_dir = "${oracle_home}/OPatch" 44 | 45 | $supported_db_kernels = join( lookup('oradb::kernels'), '|') 46 | if ( $facts['kernel'] in $supported_db_kernels == false){ 47 | fail("Unrecognized operating system, please use it on a ${supported_db_kernels} host") 48 | } 49 | 50 | # check the opatch version 51 | $installed_version = oradb::opatch_version($oracle_home) 52 | 53 | if $installed_version == $opversion { 54 | $continue = false 55 | } else { 56 | notify {"oradb::opatchupgrade ${title} ${installed_version} installed - performing upgrade":} 57 | $continue = true 58 | } 59 | 60 | if ( $continue ) { 61 | if $remote_file == true { 62 | if ! defined(File["${download_dir}/${patch_file}"]) { 63 | file {"${download_dir}/${patch_file}": 64 | ensure => present, 65 | path => "${download_dir}/${patch_file}", 66 | source => "${puppet_download_mnt_point}/${patch_file}", 67 | mode => '0775', 68 | owner => $user, 69 | group => $group, 70 | } 71 | } 72 | } 73 | 74 | case $facts['kernel'] { 75 | 'Linux', 'SunOS': { 76 | file { $patch_dir: 77 | ensure => absent, 78 | recurse => true, 79 | force => true, 80 | } 81 | 82 | if $remote_file == true { 83 | exec { "extract opatch ${title} ${patch_file}": 84 | command => "unzip -o ${download_dir}/${patch_file} -d ${oracle_home}", 85 | path => $exec_path, 86 | user => $user, 87 | group => $group, 88 | logoutput => false, 89 | require => [File["${download_dir}/${patch_file}"],File[$patch_dir]], 90 | } 91 | } else { 92 | exec { "extract opatch ${title} ${patch_file}": 93 | command => "unzip -o ${puppet_download_mnt_point}/${patch_file} -d ${oracle_home}", 94 | path => $exec_path, 95 | user => $user, 96 | group => $group, 97 | logoutput => false, 98 | require => File[$patch_dir], 99 | } 100 | } 101 | 102 | # version lower than, do emocmrsp 103 | if ( versioncmp($opversion, '12.2.0.1.5') == -1 ) { 104 | if ( $csi_number != undef and support_id != undef ) { 105 | exec { "exec emocmrsp ${title} ${opversion}": 106 | cwd => $patch_dir, 107 | command => "${patch_dir}/ocm/bin/emocmrsp -repeater NONE ${csi_number} ${support_id}", 108 | path => $exec_path, 109 | user => $user, 110 | group => $group, 111 | logoutput => true, 112 | require => Exec["extract opatch ${title} ${patch_file}"], 113 | } 114 | } else { 115 | 116 | if ! defined(Package['expect']) { 117 | package { 'expect': 118 | ensure => present, 119 | } 120 | } 121 | 122 | file { "${download_dir}/opatch_upgrade_${title}_${opversion}.ksh": 123 | ensure => present, 124 | content => epp('oradb/ocm.rsp.epp', { 'patchDir' => $patch_dir }), 125 | mode => '0775', 126 | owner => $user, 127 | group => $group, 128 | } 129 | 130 | exec { "ksh ${download_dir}/opatch_upgrade_${title}_${opversion}.ksh": 131 | cwd => $patch_dir, 132 | path => $exec_path, 133 | user => $user, 134 | group => $group, 135 | logoutput => true, 136 | require => [File["${download_dir}/opatch_upgrade_${title}_${opversion}.ksh"], 137 | Exec["extract opatch ${title} ${patch_file}"], 138 | Package['expect'],], 139 | } 140 | } 141 | } 142 | } 143 | default: { 144 | fail('Unrecognized operating system') 145 | } 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /manifests/prepareautostart.pp: -------------------------------------------------------------------------------- 1 | # 2 | # prepareautostart 3 | # 4 | # prepare autostart of the nodemanager for linux or solaris 5 | # 6 | # @example configuration 7 | # class{'oradb::prepareautostart': 8 | # oracle_home => '/opt/oracle/product/11g', 9 | # user => 'oracle', 10 | # service_name => 'dbora' 11 | # } 12 | # 13 | # @param oracle_home 14 | # @param user 15 | # @param service_name 16 | # 17 | class oradb::prepareautostart( 18 | String $oracle_home = undef, 19 | String $user = lookup('oradb::user'), 20 | String $service_name = lookup('oradb::host::service_name'), 21 | ){ 22 | $exec_path = lookup('oradb::exec_path') 23 | $dbora_location = lookup('oradb::dbora_dir') 24 | 25 | file { "${dbora_location}/${service_name}" : 26 | ensure => present, 27 | mode => '0755', 28 | owner => 'root', 29 | content => regsubst(epp("oradb/dbora_${facts['kernel']}.epp", 30 | { 'oracle_home' => $oracle_home, 31 | 'user' => $user, 32 | 'service_name' => $service_name} ), 33 | '\r\n', "\n", 'EMG'), 34 | } 35 | 36 | case $facts['operatingsystem'] { 37 | 'CentOS', 'RedHat', 'OracleLinux', 'SLES': { 38 | exec { "enable service ${service_name}": 39 | command => "chkconfig --add ${service_name}", 40 | require => File["/etc/init.d/${service_name}"], 41 | user => 'root', 42 | unless => "chkconfig --list | /bin/grep \'${service_name}\'", 43 | path => $exec_path, 44 | logoutput => true, 45 | } 46 | } 47 | 'Ubuntu', 'Debian':{ 48 | exec { "enable service ${service_name}": 49 | command => "update-rc.d ${service_name} defaults", 50 | require => File["/etc/init.d/${service_name}"], 51 | user => 'root', 52 | unless => "ls /etc/rc3.d/*${service_name} | /bin/grep \'${service_name}\'", 53 | path => $exec_path, 54 | logoutput => true, 55 | } 56 | } 57 | 'Solaris': { 58 | file { '/tmp/oradb_smf.xml' : 59 | ensure => present, 60 | mode => '0755', 61 | owner => 'root', 62 | content => epp('oradb/oradb_smf.xml.epp', { 63 | 'dboraLocation' => $dbora_location, 64 | 'service_name' => $service_name } ), 65 | } 66 | exec { "enable service ${service_name}": 67 | command => 'svccfg -v import /tmp/oradb_smf.xml', 68 | require => File['/tmp/oradb_smf.xml',"${dbora_location}/${service_name}"], 69 | user => 'root', 70 | unless => 'svccfg list | grep oracledatabase', 71 | path => $exec_path, 72 | logoutput => true, 73 | } 74 | } 75 | default: { 76 | fail('Unrecognized operating system, please use it on a Linux or SunOS host') 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /manifests/tnsnames.pp: -------------------------------------------------------------------------------- 1 | # 2 | # tnsnames 3 | # 4 | # Configure tnsnames entries 5 | # 6 | # @example tnsnames 7 | # 8 | # oradb::tnsnames{'orcl': 9 | # oracle_home => '/oracle/product/11.2/db', 10 | # user => 'oracle', 11 | # group => 'dba', 12 | # server => { myserver => { host => soadb.example.nl, port => '1521', protocol => 'TCP' }}, 13 | # connect_service_name => 'soarepos.example.nl', 14 | # } 15 | # 16 | # oradb::tnsnames{'test': 17 | # oracle_home => '/oracle/product/11.2/db', 18 | # user => 'oracle', 19 | # group => 'dba', 20 | # server => { myserver => { host => soadb.example.nl, port => '1525', protocol => 'TCP' }, myserver2 => { host => soadb2.example.nl, port => '1526', protocol => 'TCP' }}, 21 | # connect_service_name => 'soarepos.example.nl', 22 | # connect_server => 'DEDICATED', 23 | # } 24 | # 25 | # @param oracle_home full path to the Oracle Home directory 26 | # @param user operating system user 27 | # @param group the operating group name for using the oracle software 28 | # @param server the tnsnames connection details 29 | # @param loadbalance configure loadbalance on the tnsnames entries 30 | # @param failover configure failover on the tnsnames entries 31 | # @param connect_service_name the service name of the database 32 | # @param connect_server service connection type 33 | # @param connect_timeout the timeout duration in seconds for a client to establish an Oracle Net connection to an Oracle database 34 | # @param transport_connect_timeout the transportation timeout duration in seconds for a client to establish an Oracle Net connection to an Oracle Database 35 | # @param retry_count The number of times an ADDRESS list is traversed before the connection attempt is terminated. The default value is 0. 36 | # @param entry_type type of configuration 37 | # 38 | define oradb::tnsnames( 39 | String $oracle_home = undef, 40 | String $user = lookup('oradb::user'), 41 | String $group = lookup('oradb::group'), 42 | Hash $server = { myserver => { host => undef, port => '1521', protocol => 'TCP' }}, 43 | String $loadbalance = 'ON', 44 | String $failover = 'ON', 45 | Optional[String] $connect_service_name = undef, 46 | String $connect_server = 'DEDICATED', 47 | Optional[Integer] $connect_timeout = undef, 48 | Optional[Integer] $transport_connect_timeout = undef, 49 | Optional[Integer] $retry_count = undef, 50 | Enum['tnsnames','listener'] $entry_type = 'tnsnames', 51 | ) 52 | { 53 | if ! defined(Concat["${oracle_home}/network/admin/tnsnames.ora"]) { 54 | concat { "${oracle_home}/network/admin/tnsnames.ora": 55 | ensure => present, 56 | owner => $user, 57 | group => $group, 58 | mode => '0774', 59 | ensure_newline => true, 60 | } 61 | } 62 | 63 | case $entry_type { 64 | 'tnsnames' : { $template_path = 'oradb/tnsnames.epp' } 65 | 'listener' : { $template_path = 'oradb/listener.epp' } 66 | default : { fail("${entry_type} is not a supported entry_type") } 67 | } 68 | 69 | concat::fragment { $title: 70 | target => "${oracle_home}/network/admin/tnsnames.ora", 71 | content => epp($template_path , { 'title' => $title, 72 | 'server' => $server, 73 | 'loadbalance' => $loadbalance, 74 | 'failover' => $failover, 75 | 'connect_server' => $connect_server, 76 | 'connect_service_name' => $connect_service_name, 77 | 'connect_timeout' => $connect_timeout, 78 | 'transport_connect_timeout' => $transport_connect_timeout, 79 | 'retry_count' => $retry_count, 80 | }), 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /manifests/utils/dborainst.pp: -------------------------------------------------------------------------------- 1 | # 2 | # utils::dborainst 3 | # 4 | # creates oraInst.loc for oracle products 5 | # 6 | # @example dborainst call 7 | # oradb::utils::dborainst{'myOraInst': 8 | # ora_inventory_dir => '/opt/oracle', 9 | # os_group => 'oinstall', 10 | # } 11 | # 12 | # @param ora_inventory_dir full path to the ora inventory directory 13 | # @param os_group groupb 14 | # 15 | define oradb::utils::dborainst 16 | ( 17 | String $ora_inventory_dir = undef, 18 | String $os_group = lookup('oradb::group'), 19 | ){ 20 | $ora_inst_path = lookup('oradb::orainst_dir') 21 | if ( $facts['kernel'] == 'SunOS'){ 22 | if !defined(File[$ora_inst_path]) { 23 | file { $ora_inst_path: 24 | ensure => directory, 25 | before => File["${ora_inst_path}/oraInst.loc"], 26 | mode => '0644', 27 | } 28 | } 29 | } 30 | 31 | if !defined(File["${ora_inst_path}/oraInst.loc"]) { 32 | file { "${ora_inst_path}/oraInst.loc": 33 | ensure => present, 34 | content => epp('oradb/oraInst.loc.epp', { 35 | 'ora_inventory_dir' => $ora_inventory_dir, 36 | 'os_group' => $os_group }), 37 | mode => '0644', 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "biemond-oradb", 3 | "version": "3.0.19", 4 | "author": "Edwin Biemond", 5 | "summary": "Oracle Database 11.2, 12.1, 12.2 & 18 for Linux & Solaris plus ASM, Client, Enterprise Manager & GoldenGate", 6 | "license": "Apache-2.0", 7 | "source": "https://github.com/biemond/biemond-oradb", 8 | "project_page": "https://github.com/biemond/biemond-oradb", 9 | "issues_url": "https://github.com/biemond/biemond-oradb/issues", 10 | "dependencies": [ 11 | { 12 | "name": "puppetlabs/concat", 13 | "version_requirement": ">= 2.1.0 < 7.0.0" 14 | }, 15 | { 16 | "name": "puppetlabs/stdlib", 17 | "version_requirement": ">= 4.13.0 < 7.0.0" 18 | } 19 | ], 20 | "operatingsystem_support": [ 21 | { 22 | "operatingsystem": "RedHat", 23 | "operatingsystemrelease": [ 24 | "4", 25 | "5", 26 | "6", 27 | "7" 28 | ] 29 | }, 30 | { 31 | "operatingsystem": "CentOS", 32 | "operatingsystemrelease": [ 33 | "4", 34 | "5", 35 | "6", 36 | "7" 37 | ] 38 | }, 39 | { 40 | "operatingsystem": "OracleLinux", 41 | "operatingsystemrelease": [ 42 | "4", 43 | "5", 44 | "6", 45 | "7" 46 | ] 47 | }, 48 | { 49 | "operatingsystem": "Scientific", 50 | "operatingsystemrelease": [ 51 | "4", 52 | "5", 53 | "6" 54 | ] 55 | }, 56 | { 57 | "operatingsystem": "SLES", 58 | "operatingsystemrelease": [ 59 | "11 SP1" 60 | ] 61 | }, 62 | { 63 | "operatingsystem": "Debian", 64 | "operatingsystemrelease": [ 65 | "6", 66 | "7" 67 | ] 68 | }, 69 | { 70 | "operatingsystem": "Ubuntu", 71 | "operatingsystemrelease": [ 72 | "10.04", 73 | "12.04" 74 | ] 75 | }, 76 | { 77 | "operatingsystem": "Solaris", 78 | "operatingsystemrelease": [ 79 | "10", 80 | "11" 81 | ] 82 | } 83 | ], 84 | "requirements": [ 85 | { 86 | "name": "puppet", 87 | "version_requirement": ">=4.3.0" 88 | } 89 | ], 90 | "tags": [ 91 | "database", 92 | "asm", 93 | "grid", 94 | "12c", 95 | "12.1", 96 | "12.2", 97 | "18.0", 98 | "18.3", 99 | "oracle", 100 | "11g", 101 | "11gR2", 102 | "11.2", 103 | "client", 104 | "goldengate", 105 | "rcu", 106 | "enterprise manager" 107 | ], 108 | "pdk-version": "1.11.1", 109 | "template-url": "pdk-default#1.11.1", 110 | "template-ref": "1.11.1-0-g2ff8c24" 111 | } 112 | -------------------------------------------------------------------------------- /spec/classes/prepareautostart_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'shared_contexts' 3 | 4 | describe 'oradb::prepareautostart', :type => :class do 5 | # by default the hiera integration uses hiera data from the shared_contexts.rb file 6 | # but basically to mock hiera you first need to add a key/value pair 7 | # to the specific context in the spec/shared_contexts.rb file 8 | # Note: you can only use a single hiera context per describe/context block 9 | # rspec-puppet does not allow you to swap out hiera data on a per test block 10 | #include_context :hiera 11 | 12 | 13 | # below is the facts hash that gives you the ability to mock 14 | # facts on a per describe/context block. If you use a fact in your 15 | # manifest you should mock the facts below. 16 | let(:facts) do 17 | {} 18 | end 19 | # below is a list of the resource parameters that you can override. 20 | # By default all non-required parameters are commented out, 21 | # while all required parameters will require you to add a value 22 | let(:params) {{ 23 | :oracle_home => '/opt/oracle', 24 | :user => "oracle", 25 | :service_name => "oracle" 26 | }} 27 | 28 | 29 | # add these two lines in a single test block to enable puppet and hiera debug mode 30 | # Puppet::Util::Log.level = :debug 31 | # Puppet::Util::Log.newdestination(:console) 32 | describe 'Solaris' do 33 | let(:facts) {{ 34 | :kernel => 'SunOS', 35 | :operatingsystem => 'Solaris' 36 | }} 37 | 38 | it do 39 | is_expected.to contain_file('/etc/oracle') 40 | .with( 41 | 'ensure' => 'present', 42 | 'mode' => '0755', 43 | 'owner' => 'root' 44 | ) 45 | end 46 | it do 47 | is_expected.to contain_file('/tmp/oradb_smf.xml') 48 | .with( 49 | 'ensure' => 'present', 50 | 'mode' => '0755', 51 | 'owner' => 'root', 52 | 'content' => /\/etc\/oracle/ 53 | ) 54 | end 55 | 56 | it do 57 | is_expected.to contain_exec('enable service oracle') 58 | .with( 59 | 'command' => 'svccfg -v import /tmp/oradb_smf.xml', 60 | 'user' => 'root', 61 | 'logoutput' => true, 62 | 'path' => '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin', 63 | 'unless' => 'svccfg list | grep oracledatabase', 64 | 'require' => ['File[/tmp/oradb_smf.xml]','File[/etc/oracle]'], 65 | ) 66 | end 67 | end 68 | 69 | describe 'Linux' do 70 | let(:facts) do 71 | {:kernel => 'Linux', :operatingsystem => 'RedHat'} 72 | end 73 | 74 | it do 75 | is_expected.to contain_file('/etc/init.d/oracle') 76 | .with( 77 | 'content' => /LOCK_FILE=\/var\/lock\/subsys\/oracle/, 78 | 'ensure' => 'present', 79 | 'mode' => '0755', 80 | 'owner' => 'root' 81 | ) 82 | end 83 | rhel_based = ['CentOS', 'RedHat', 'OracleLinux', 'SLES'] 84 | deb_based = ['Ubuntu', 'Debian'] 85 | rhel_based.each do |os| 86 | describe os do 87 | let(:facts) do 88 | { 89 | 90 | :kernel => 'Linux', 91 | :operatingsystem => os 92 | } 93 | 94 | end 95 | 96 | it do 97 | is_expected.to contain_exec('enable service oracle') 98 | .with( 99 | 'command' => "chkconfig --add oracle", 100 | 'require' => 'File[/etc/init.d/oracle]', 101 | 'user' => 'root', 102 | 'unless' => "chkconfig --list | /bin/grep \'oracle\'", 103 | 'path' => '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin', 104 | 'logoutput' => true, 105 | ) 106 | end 107 | end 108 | end 109 | deb_based.each do |os| 110 | describe os do 111 | let(:facts) do 112 | { 113 | :kernel => 'Linux', 114 | :operatingsystem => os 115 | } 116 | 117 | end 118 | 119 | it do 120 | is_expected.to contain_exec('enable service oracle') 121 | .with( 122 | 'command' => "update-rc.d oracle defaults", 123 | 'require' => 'File[/etc/init.d/oracle]', 124 | 'user' => 'root', 125 | 'unless' => "ls /etc/rc3.d/*oracle | /bin/grep \'oracle\'", 126 | 'path' => '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin', 127 | 'logoutput' => true, 128 | ) 129 | end 130 | end 131 | end 132 | end 133 | end 134 | -------------------------------------------------------------------------------- /spec/default_facts.yml: -------------------------------------------------------------------------------- 1 | # Use default_module_facts.yml for module specific facts. 2 | # 3 | # Facts specified here will override the values provided by rspec-puppet-facts. 4 | --- 5 | ipaddress: "172.16.254.254" 6 | is_pe: false 7 | macaddress: "AA:AA:AA:AA:AA:AA" 8 | -------------------------------------------------------------------------------- /spec/defines/installasm_params_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'oradb::installasm', :type => :define do 4 | 5 | # describe "wrong grid version" do 6 | # let(:params){{ 7 | # :version => '11.2.0.1', 8 | # :file => 'p13390677_112040_Linux-x86-64_3of7.zip', 9 | # :grid_type => 'HA_CONFIG', 10 | # :grid_base => '/app/grid', 11 | # :grid_home => '/app/grid/product/11.2/grid', 12 | # :remote_file => false, 13 | # :download_dir => '/install', 14 | # :puppet_download_mnt_point => '/software', 15 | # :user_base_dir => '/home', 16 | # :user => 'grid', 17 | # :group => 'asmdba', 18 | # :group_install => 'oinstall', 19 | # :group_oper => 'asmoper', 20 | # :group_asm => 'asmadmin', 21 | # :sys_asm_password => 'Welcome01', 22 | # :asm_monitor_password => 'Welcome01', 23 | # }} 24 | # let(:title) {'11.2.0.1_Linux-x86-64'} 25 | # let(:facts) {{ :operatingsystem => 'CentOS' , 26 | # :kernel => 'Linux', 27 | # :osfamily => 'RedHat' }} 28 | 29 | # it do 30 | # expect { should contain_notify("oradb::installasm /app/grid/product/11.2/grid does not exists") 31 | # }.to raise_error(Puppet::Error, /Unrecognized database grid install version, use 11.2.0.4, 12.1.0.1 or 12.1.0.2/) 32 | # end 33 | 34 | # end 35 | 36 | 37 | describe "wrong grid type" do 38 | let(:params){{ 39 | :version => '11.2.0.4', 40 | :file => 'p13390677_112040_Linux-x86-64_3of7.zip', 41 | :grid_type => 'XXXX', 42 | :grid_base => '/app/grid', 43 | :grid_home => '/app/grid/product/11.2/grid', 44 | :remote_file => false, 45 | :download_dir => '/install', 46 | :puppet_download_mnt_point => '/software', 47 | :user_base_dir => '/home', 48 | :user => 'grid', 49 | :group => 'asmdba', 50 | :group_install => 'oinstall', 51 | :group_oper => 'asmoper', 52 | :group_asm => 'asmadmin', 53 | :sys_asm_password => 'Welcome01', 54 | :asm_monitor_password => 'Welcome01', 55 | }} 56 | let(:title) {'11.2.0.4_Linux-x86-64'} 57 | let(:facts) {{ :operatingsystem => 'CentOS' , 58 | :kernel => 'Linux', 59 | :osfamily => 'RedHat' }} 60 | 61 | it do 62 | expect { should contain_notify("oradb::installasm /app/grid/product/11.2/grid does not exists") 63 | }.to raise_error(Puppet::Error, /Unrecognized database grid type, please use CRS_CONFIG|HA_CONFIG|UPGRADE/) 64 | end 65 | end 66 | 67 | describe "wrong disk_au_size" do 68 | let(:params){{ 69 | :version => '11.2.0.4', 70 | :file => 'p13390677_112040_Linux-x86-64_3of7.zip', 71 | :grid_type => 'HA_CONFIG', 72 | :grid_base => '/app/grid', 73 | :grid_home => '/app/grid/product/11.2/grid', 74 | :remote_file => false, 75 | :download_dir => '/install', 76 | :puppet_download_mnt_point => '/software', 77 | :user_base_dir => '/home', 78 | :user => 'grid', 79 | :group => 'asmdba', 80 | :group_install => 'oinstall', 81 | :group_oper => 'asmoper', 82 | :group_asm => 'asmadmin', 83 | :sys_asm_password => 'Welcome01', 84 | :asm_monitor_password => 'Welcome01', 85 | :disk_au_size => 200, 86 | }} 87 | let(:title) {'11.2.0.4_Linux-x86-64'} 88 | let(:facts) {{ :operatingsystem => 'CentOS' , 89 | :kernel => 'Linux', 90 | :osfamily => 'RedHat' }} 91 | 92 | it do 93 | expect { should contain_notify("oradb::installasm /app/grid/product/11.2/grid does not exists") 94 | }.to raise_error(Puppet::Error, /invalid disk_au_size/) 95 | end 96 | 97 | end 98 | 99 | end 100 | -------------------------------------------------------------------------------- /spec/functions/is_oracle_patch_installed_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'puppetlabs_spec_helper/puppetlabs_spec/puppet_internals' 3 | 4 | 5 | 6 | describe 'oradb::is_oracle_patch_installed', :type => :puppet_function do 7 | 8 | 9 | 10 | context 'when opatch_patches fact available' do 11 | 12 | let(:facts) do 13 | { 14 | :opatch_patches => { 15 | '/u01/app/oracle/product/12.1.0/dbhome_1' => [ 16 | { 17 | 'patch_id' => '21485069', 18 | 'patch_desc' => '' 19 | }, 20 | { 21 | 'patch_id' => '21948354', 22 | 'patch_desc' => 'Database Patch Set Update : 12.1.0.2.160119 (21948354)' 23 | } 24 | ] 25 | } 26 | } 27 | end 28 | 29 | # context 'when patch is installed in oracle_home' do 30 | # it { is_expected.to run.with_params('/u01/app/oracle/product/12.1.0/dbhome_1', '21948354').and_return(true) } 31 | # end 32 | context 'when oracle_home is not in opatch_patches fact' do 33 | it { is_expected.to run.with_params('/u01/app/oracle/product/12.1.0/no_such_home', '21948354').and_return(false) } 34 | end 35 | context 'when patch is not installed in oracle_home' do 36 | it { is_expected.to run.with_params('/u01/app/oracle/product/12.1.0/dbhome_1', '666666').and_return(false) } 37 | end 38 | end 39 | context 'when no opatch_patches fact' do 40 | it { is_expected.to run.with_params('/u01/app/oracle/product/12.1.0/dbhome_1', '21948354').and_return(false) } 41 | end 42 | 43 | context 'with invalid parameters' do 44 | describe 'with wrong number of parameters' do 45 | it do 46 | is_expected.to run.with_params 47 | .and_raise_error(ArgumentError, /expects 2 arguments/) 48 | end 49 | it do 50 | is_expected.to run.with_params('/u01/app/oracle/product/12.1.0/dbhome_1') 51 | .and_raise_error(ArgumentError, /expects 2 arguments/) 52 | end 53 | end 54 | 55 | # describe 'with invalid oracle_home' do 56 | # it do 57 | # is_expected.to run.with_params('not_an_absolute_path', '666666') 58 | # .and_raise_error(Puppet::ParseError, /oracle_home must be absolute path/) 59 | # end 60 | # end 61 | 62 | describe 'with invalid patch_id' do 63 | it do 64 | is_expected.to run.with_params('/u01/app/oracle/product/12.1.0/dbhome_1', 6666) 65 | .and_raise_error(ArgumentError, /expects a String value/) 66 | end 67 | # it do 68 | # is_expected.to run.with_params('/u01/app/oracle/product/12.1.0/dbhome_1', 'invalid_string') 69 | # .and_raise_error(Puppet::ArgumentError, /^patch_id must be a string of digits$/) 70 | # end 71 | end 72 | end 73 | end -------------------------------------------------------------------------------- /spec/functions/oradb_cleanpath_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'puppetlabs_spec_helper/puppetlabs_spec/puppet_internals' 3 | 4 | describe 'oradb::cleanpath', :type => :puppet_function do 5 | 6 | context 'with valid parameters' do 7 | it { is_expected.to run.with_params('/u01/app/oracle/../oraInventory').and_return('/u01/app/oraInventory') } 8 | end 9 | 10 | context 'With invalid parameters' do 11 | describe 'with wrong number of parameters' do 12 | it { is_expected.to run.with_params().and_raise_error(ArgumentError, /expects 1 argument/ ) } 13 | it { is_expected.to run.with_params('a','b').and_raise_error(ArgumentError, /expects 1 argument/ ) } 14 | end 15 | describe 'with non string parameter' do 16 | it { is_expected.to run.with_params(['a']).and_raise_error(ArgumentError, /expects a String value/ ) } 17 | it { is_expected.to run.with_params(false).and_raise_error(ArgumentError, /expects a String value/ ) } 18 | it { is_expected.to run.with_params(42).and_raise_error(ArgumentError, /expects a String value/ ) } 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/shared_contexts.rb: -------------------------------------------------------------------------------- 1 | # optional, this should be the path to where the hiera data config file is in this repo 2 | # You must update this if your actual hiera data lives inside your module. 3 | # I only assume you have a separate repository for hieradata and its include in your .fixtures 4 | # hiera_config_file = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures','modules','hieradata', 'hiera.yaml')) 5 | 6 | # hiera_config and hiera_data are mutually exclusive contexts. 7 | 8 | shared_context :global_hiera_data do 9 | let(:hiera_data) do 10 | { 11 | #"oradb::prepareautostart::oracle_home" => '', 12 | #"oradb::prepareautostart::user" => '', 13 | #"oradb::shout" => '', 14 | 15 | } 16 | end 17 | end 18 | 19 | shared_context :hiera do 20 | # example only, 21 | let(:hiera_data) do 22 | {:some_key => "some_value" } 23 | end 24 | end 25 | 26 | shared_context :linux_hiera do 27 | # example only, 28 | let(:hiera_data) do 29 | {:some_key => "some_value" } 30 | end 31 | end 32 | 33 | # In case you want a more specific set of mocked hiera data for windows 34 | shared_context :windows_hiera do 35 | # example only, 36 | let(:hiera_data) do 37 | {:some_key => "some_value" } 38 | end 39 | end 40 | 41 | # you cannot use this in addition to any of the hiera_data contexts above 42 | shared_context :real_hiera_data do 43 | let(:hiera_config) do 44 | hiera_config_file 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /spec/spec.opts.old: -------------------------------------------------------------------------------- 1 | --format 2 | s 3 | --colour 4 | mtime 5 | --backtrace 6 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'puppetlabs_spec_helper/module_spec_helper' 2 | require 'rspec-puppet-facts' 3 | 4 | require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) 5 | 6 | include RspecPuppetFacts 7 | 8 | default_facts = { 9 | puppetversion: Puppet.version, 10 | facterversion: Facter.version, 11 | } 12 | 13 | default_fact_files = [ 14 | File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), 15 | File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), 16 | ] 17 | 18 | default_fact_files.each do |f| 19 | next unless File.exist?(f) && File.readable?(f) && File.size?(f) 20 | 21 | begin 22 | default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) 23 | rescue => e 24 | RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" 25 | end 26 | end 27 | 28 | RSpec.configure do |c| 29 | c.default_facts = default_facts 30 | c.before :each do 31 | # set to strictest setting for testing 32 | # by default Puppet runs at warning level 33 | Puppet.settings[:strict] = :warning 34 | end 35 | c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] 36 | c.after(:suite) do 37 | end 38 | end 39 | 40 | # Ensures that a module is defined 41 | # @param module_name Name of the module 42 | def ensure_module_defined(module_name) 43 | module_name.split('::').reduce(Object) do |last_module, next_module| 44 | last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false) 45 | last_module.const_get(next_module, false) 46 | end 47 | end 48 | 49 | # 'spec_overrides' from sync.yml will appear below this line 50 | -------------------------------------------------------------------------------- /templates/bash_profile.epp: -------------------------------------------------------------------------------- 1 | <%- | String $oracle_home, 2 | String $oracle_base, 3 | String $temp_dir = '/tmp' | -%> 4 | 5 | if [ -f ~/.bashrc ]; then 6 | . ~/.bashrc 7 | fi 8 | 9 | ORACLE_TERM=xterm; export ORACLE_TERM 10 | 11 | LD_LIBRARY_PATH=<%= $oracle_home %>/lib 12 | ORACLE_BASE=<%= $oracle_base %> 13 | ORACLE_HOME=<%= $oracle_home %> 14 | SQLPLUS_HOME=<%= $oracle_home %> 15 | PATH=/bin:/usr/local/bin:/usr/bin:/bin:<%= $oracle_home %>/bin 16 | 17 | export LD_LIBRARY_PATH 18 | export ORACLE_BASE 19 | export ORACLE_HOME 20 | export SQLPLUS_HOME 21 | export PATH 22 | 23 | export TEMP=<%= $temp_dir %> 24 | export TMPDIR=<%= $temp_dir %> 25 | umask 022 26 | -------------------------------------------------------------------------------- /templates/db_client_12.2.0.1.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $group_install = 'oinstall', 2 | String $oraInventory, 3 | String $oracle_home, 4 | String $oracle_base | -%> 5 | 6 | 7 | #------------------------------------------------------------------------------- 8 | # Do not change the following system generated value. 9 | #------------------------------------------------------------------------------- 10 | oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v12.2.0 11 | 12 | #------------------------------------------------------------------------------- 13 | # Unix group to be set for the inventory directory. 14 | #------------------------------------------------------------------------------- 15 | UNIX_GROUP_NAME=<%= $group_install %> 16 | #------------------------------------------------------------------------------- 17 | # Inventory location. 18 | #------------------------------------------------------------------------------- 19 | INVENTORY_LOCATION=<%= $oraInventory %> 20 | #------------------------------------------------------------------------------- 21 | # Complete path of the Oracle Home 22 | #------------------------------------------------------------------------------- 23 | ORACLE_HOME=<%= $oracle_home %> 24 | 25 | #------------------------------------------------------------------------------- 26 | # Complete path of the Oracle Base. 27 | #------------------------------------------------------------------------------- 28 | ORACLE_BASE=<%= $oracle_base %> 29 | 30 | #------------------------------------------------------------------------------ 31 | #Name : INSTALL_TYPE 32 | #Datatype : String 33 | #Description: Installation type of the component. 34 | # 35 | # The following choices are available. The value should contain 36 | # only one of these choices. 37 | # - InstantClient 38 | # - Administrator 39 | # - Runtime 40 | # - Custom 41 | # 42 | #Example : INSTALL_TYPE = Administrator 43 | #------------------------------------------------------------------------------ 44 | oracle.install.client.installType=Administrator 45 | 46 | #------------------------------------------------------------------------------- 47 | # Name : oracle.install.client.customComponents 48 | # Datatype : StringList 49 | # 50 | # This property is considered only if INSTALL_TYPE is set to "Custom" 51 | # 52 | # Description: List of Client Components you would like to install 53 | # 54 | # The following choices are available. You may specify any 55 | # combination of these choices. The components you choose should 56 | # be specified in the form "internal-component-name:version" 57 | # Below is a list of components you may specify to install. 58 | # 59 | # oracle.sqlj:12.2.0.1.0 -- "Oracle SQLJ" 60 | # oracle.rdbms.util:12.2.0.1.0 -- "Oracle Database Utilities" 61 | # oracle.javavm.client:12.2.0.1.0 -- "Oracle Java Client" 62 | # oracle.sqlplus:12.2.0.1.0 -- "SQL*Plus" 63 | # oracle.dbjava.jdbc:12.2.0.1.0 -- "Oracle JDBC/THIN Interfaces" 64 | # oracle.ldap.client:12.2.0.1.0 -- "Oracle Internet Directory Client" 65 | # oracle.rdbms.oci:12.2.0.1.0 -- "Oracle Call Interface (OCI)" 66 | # oracle.precomp:12.2.0.1.0 -- "Oracle Programmer" 67 | # oracle.xdk:12.2.0.1.0 -- "Oracle XML Development Kit" 68 | # oracle.network.aso:12.2.0.1.0 -- "Oracle Advanced Security" 69 | # oracle.oraolap.mgmt:12.2.0.1.0 -- "OLAP Analytic Workspace Manager and Worksheet" 70 | # oracle.network.client:12.2.0.1.0 -- "Oracle Net" 71 | # oracle.network.cman:12.2.0.1.0 -- "Oracle Connection Manager" 72 | # oracle.network.listener:12.2.0.1.0 -- "Oracle Net Listener" 73 | # oracle.ordim.client:12.2.0.1.0 -- "Oracle Multimedia Client Option" 74 | # oracle.odbc:12.2.0.1.0 -- "Oracle ODBC Driver" 75 | # oracle.has.client:12.2.0.1.0 -- "Oracle Clusterware High Availability API" 76 | # oracle.dbdev:12.2.0.1.0 -- "Oracle SQL Developer" 77 | # oracle.rdbms.scheduler:12.2.0.1.0 -- "Oracle Scheduler Agent" 78 | # 79 | # Example : oracle.install.client.customComponents="oracle.precomp:12.2.0.1.0","oracle.oraolap.mgmt:12.2.0.1.0","oracle.rdbms.scheduler:12.2.0.1.0" 80 | #------------------------------------------------------------------------------- 81 | oracle.install.client.customComponents= 82 | 83 | #------------------------------------------------------------------------------- 84 | # Host name to be used for by the Oracle Scheduler Agent. 85 | # This needs to be entered in case oracle.rdbms.scheduler is selected in the 86 | # list of custom components during custom install 87 | # 88 | # Example : oracle.install.client.schedulerAgentHostName = acme.domain.com 89 | #------------------------------------------------------------------------------ 90 | oracle.install.client.schedulerAgentHostName= 91 | 92 | #------------------------------------------------------------------------------ 93 | # Port number to be used for by the Oracle Scheduler Agent. 94 | # This needs to be entered in case oracle.rdbms.scheduler is selected in the 95 | # list of custom components during custom install 96 | # 97 | # Example: oracle.install.client.schedulerAgentPortNumber = 1500 98 | #------------------------------------------------------------------------------ 99 | oracle.install.client.schedulerAgentPortNumber= -------------------------------------------------------------------------------- /templates/db_client_18.0.0.0.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $group_install = 'oinstall', 2 | String $oraInventory, 3 | String $oracle_home, 4 | String $oracle_base | -%> 5 | 6 | 7 | ############################################################################### 8 | ## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## 9 | ## ## 10 | ## Specify values for the variables listed below to customize ## 11 | ## your installation. ## 12 | ## ## 13 | ## Each variable is associated with a comment. The comment ## 14 | ## can help to populate the variables with the appropriate ## 15 | ## values. ## 16 | ## ## 17 | ############################################################################### 18 | 19 | 20 | #------------------------------------------------------------------------------- 21 | # Do not change the following system generated value. 22 | #------------------------------------------------------------------------------- 23 | oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v18.0.0 24 | 25 | #------------------------------------------------------------------------------- 26 | # Unix group to be set for the inventory directory. 27 | #------------------------------------------------------------------------------- 28 | UNIX_GROUP_NAME=<%= $group_install %> 29 | #------------------------------------------------------------------------------- 30 | # Inventory location. 31 | #------------------------------------------------------------------------------- 32 | INVENTORY_LOCATION=<%= $oraInventory %> 33 | #------------------------------------------------------------------------------- 34 | # Complete path of the Oracle Home 35 | #------------------------------------------------------------------------------- 36 | ORACLE_HOME=<%= $oracle_home %> 37 | 38 | #------------------------------------------------------------------------------- 39 | # Complete path of the Oracle Base. 40 | #------------------------------------------------------------------------------- 41 | ORACLE_BASE=<%= $oracle_base %> 42 | 43 | #------------------------------------------------------------------------------ 44 | #Name : INSTALL_TYPE 45 | #Datatype : String 46 | #Description: Installation type of the component. 47 | # 48 | # The following choices are available. The value should contain 49 | # only one of these choices. 50 | # - Administrator 51 | # - Runtime 52 | # - InstantClient 53 | # - Custom 54 | # 55 | #Example : INSTALL_TYPE = Administrator 56 | #------------------------------------------------------------------------------ 57 | oracle.install.client.installType=Administrator 58 | 59 | #------------------------------------------------------------------------------- 60 | # Name : oracle.install.client.customComponents 61 | # Datatype : StringList 62 | # 63 | # This property is considered only if INSTALL_TYPE is set to "Custom" 64 | # 65 | # Description: List of Client Components you would like to install 66 | # 67 | # The following choices are available. You may specify any 68 | # combination of these choices. The components you choose should 69 | # be specified in the form "internal-component-name:version" 70 | # Below is a list of components you may specify to install. 71 | # 72 | # oracle.sqlj:18.0.0.0.0 -- "Oracle SQLJ" 73 | # oracle.rdbms.util:18.0.0.0.0 -- "Oracle Database Utilities" 74 | # oracle.javavm.client:18.0.0.0.0 -- "Oracle Java Client" 75 | # oracle.sqlplus:18.0.0.0.0 -- "SQL*Plus" 76 | # oracle.dbjava.jdbc:18.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" 77 | # oracle.ldap.client:18.0.0.0.0 -- "Oracle Internet Directory Client" 78 | # oracle.rdbms.oci:18.0.0.0.0 -- "Oracle Call Interface (OCI)" 79 | # oracle.precomp:18.0.0.0.0 -- "Oracle Programmer" 80 | # oracle.xdk:18.0.0.0.0 -- "Oracle XML Development Kit" 81 | # oracle.network.aso:18.0.0.0.0 -- "Oracle Advanced Security" 82 | # oracle.oraolap.mgmt:18.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" 83 | # oracle.network.client:18.0.0.0.0 -- "Oracle Net" 84 | # oracle.network.cman:18.0.0.0.0 -- "Oracle Connection Manager" 85 | # oracle.network.listener:18.0.0.0.0 -- "Oracle Net Listener" 86 | # oracle.ordim.client:18.0.0.0.0 -- "Oracle Multimedia Client Option" 87 | # oracle.odbc:18.0.0.0.0 -- "Oracle ODBC Driver" 88 | # oracle.has.client:18.0.0.0.0 -- "Oracle Clusterware High Availability API" 89 | # oracle.dbdev:18.0.0.0.0 -- "Oracle SQL Developer" 90 | # oracle.rdbms.scheduler:18.0.0.0.0 -- "Oracle Scheduler Agent" 91 | # 92 | # Example : oracle.install.client.customComponents="oracle.precomp:18.0.0.0.0","oracle.oraolap.mgmt:18.0.0.0.0","oracle.rdbms.scheduler:18.0.0.0.0" 93 | #------------------------------------------------------------------------------- 94 | oracle.install.client.customComponents= 95 | 96 | #------------------------------------------------------------------------------- 97 | # Host name to be used for by the Oracle Scheduler Agent. 98 | # This needs to be entered in case oracle.rdbms.scheduler is selected in the 99 | # list of custom components during custom install 100 | # 101 | # Example : oracle.install.client.schedulerAgentHostName = acme.domain.com 102 | #------------------------------------------------------------------------------ 103 | oracle.install.client.schedulerAgentHostName= 104 | 105 | #------------------------------------------------------------------------------ 106 | # Port number to be used for by the Oracle Scheduler Agent. 107 | # This needs to be entered in case oracle.rdbms.scheduler is selected in the 108 | # list of custom components during custom install 109 | # 110 | # Example: oracle.install.client.schedulerAgentPortNumber = 1500 111 | #------------------------------------------------------------------------------ 112 | oracle.install.client.schedulerAgentPortNumber= 113 | -------------------------------------------------------------------------------- /templates/db_client_19.0.0.0.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $group_install = 'oinstall', 2 | String $oraInventory, 3 | String $oracle_home, 4 | String $oracle_base | -%> 5 | 6 | 7 | ############################################################################### 8 | ## Copyright(c) Oracle Corporation 1998,2019. All rights reserved. ## 9 | ## ## 10 | ## Specify values for the variables listed below to customize ## 11 | ## your installation. ## 12 | ## ## 13 | ## Each variable is associated with a comment. The comment ## 14 | ## can help to populate the variables with the appropriate ## 15 | ## values. ## 16 | ## ## 17 | ############################################################################### 18 | 19 | 20 | #------------------------------------------------------------------------------- 21 | # Do not change the following system generated value. 22 | #------------------------------------------------------------------------------- 23 | oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v19.0.0 24 | 25 | #------------------------------------------------------------------------------- 26 | # Unix group to be set for the inventory directory. 27 | #------------------------------------------------------------------------------- 28 | UNIX_GROUP_NAME=<%= $group_install %> 29 | #------------------------------------------------------------------------------- 30 | # Inventory location. 31 | #------------------------------------------------------------------------------- 32 | INVENTORY_LOCATION=<%= $oraInventory %> 33 | #------------------------------------------------------------------------------- 34 | # Complete path of the Oracle Home 35 | #------------------------------------------------------------------------------- 36 | ORACLE_HOME=<%= $oracle_home %> 37 | 38 | #------------------------------------------------------------------------------- 39 | # Complete path of the Oracle Base. 40 | #------------------------------------------------------------------------------- 41 | ORACLE_BASE=<%= $oracle_base %> 42 | 43 | #------------------------------------------------------------------------------ 44 | #Name : INSTALL_TYPE 45 | #Datatype : String 46 | #Description: Installation type of the component. 47 | # 48 | # The following choices are available. The value should contain 49 | # only one of these choices. 50 | # - Administrator 51 | # - Runtime 52 | # - InstantClient 53 | # - Custom 54 | # 55 | #Example : INSTALL_TYPE = Administrator 56 | #------------------------------------------------------------------------------ 57 | oracle.install.client.installType=Administrator 58 | 59 | #------------------------------------------------------------------------------- 60 | # Name : oracle.install.client.customComponents 61 | # Datatype : StringList 62 | # 63 | # This property is considered only if INSTALL_TYPE is set to "Custom" 64 | # 65 | # Description: List of Client Components you would like to install 66 | # 67 | # The following choices are available. You may specify any 68 | # combination of these choices. The components you choose should 69 | # be specified in the form "internal-component-name:version" 70 | # Below is a list of components you may specify to install. 71 | # 72 | # oracle.sqlj:19.0.0.0.0 -- "Oracle SQLJ" 73 | # oracle.rdbms.util:19.0.0.0.0 -- "Oracle Database Utilities" 74 | # oracle.javavm.client:19.0.0.0.0 -- "Oracle Java Client" 75 | # oracle.sqlplus:19.0.0.0.0 -- "SQL*Plus" 76 | # oracle.dbjava.jdbc:19.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" 77 | # oracle.ldap.client:19.0.0.0.0 -- "Oracle Internet Directory Client" 78 | # oracle.rdbms.oci:19.0.0.0.0 -- "Oracle Call Interface (OCI)" 79 | # oracle.precomp:19.0.0.0.0 -- "Oracle Programmer" 80 | # oracle.xdk:19.0.0.0.0 -- "Oracle XML Development Kit" 81 | # oracle.network.aso:19.0.0.0.0 -- "Oracle Advanced Security" 82 | # oracle.oraolap.mgmt:19.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" 83 | # oracle.network.client:19.0.0.0.0 -- "Oracle Net" 84 | # oracle.network.cman:19.0.0.0.0 -- "Oracle Connection Manager" 85 | # oracle.network.listener:19.0.0.0.0 -- "Oracle Net Listener" 86 | # oracle.ordim.client:19.0.0.0.0 -- "Oracle Multimedia Client Option" 87 | # oracle.odbc:19.0.0.0.0 -- "Oracle ODBC Driver" 88 | # oracle.has.client:19.0.0.0.0 -- "Oracle Clusterware High Availability API" 89 | # oracle.dbdev:19.0.0.0.0 -- "Oracle SQL Developer" 90 | # oracle.rdbms.scheduler:19.0.0.0.0 -- "Oracle Scheduler Agent" 91 | # 92 | # Example : oracle.install.client.customComponents="oracle.precomp:19.0.0.0.0","oracle.oraolap.mgmt:19.0.0.0.0","oracle.rdbms.scheduler:19.0.0.0.0" 93 | #------------------------------------------------------------------------------- 94 | oracle.install.client.customComponents= 95 | 96 | #------------------------------------------------------------------------------- 97 | # Host name to be used for by the Oracle Scheduler Agent. 98 | # This needs to be entered in case oracle.rdbms.scheduler is selected in the 99 | # list of custom components during custom install 100 | # 101 | # Example : oracle.install.client.schedulerAgentHostName = acme.domain.com 102 | #------------------------------------------------------------------------------ 103 | oracle.install.client.schedulerAgentHostName= 104 | 105 | #------------------------------------------------------------------------------ 106 | # Port number to be used for by the Oracle Scheduler Agent. 107 | # This needs to be entered in case oracle.rdbms.scheduler is selected in the 108 | # list of custom components during custom install 109 | # 110 | # Example: oracle.install.client.schedulerAgentPortNumber = 1500 111 | #------------------------------------------------------------------------------ 112 | oracle.install.client.schedulerAgentPortNumber= 113 | -------------------------------------------------------------------------------- /templates/dbca_vars.epp: -------------------------------------------------------------------------------- 1 | <%- | Hash $vars | -%> 2 | <%- $vars.each |$key, $value| { -%> 3 | <%= $key %>=<%= $value %> 4 | <%- } -%> -------------------------------------------------------------------------------- /templates/dbora_Linux.epp: -------------------------------------------------------------------------------- 1 | <%- | String $oracle_home, 2 | String $user, 3 | String $service_name 4 | | -%> 5 | #!/bin/bash 6 | # chkconfig: 35 99 10 7 | # description: Starts and stops Oracle processes 8 | # 9 | # Set ORA_HOME to be equivalent to the $ORACLE_HOME 10 | # from which you wish to execute dbstart and dbshut; 11 | # 12 | # Set ORA_OWNER to the user id of the owner of the 13 | # Oracle database in ORA_HOME. 14 | # 15 | # This script currently handles on ORACLE_HOME and 16 | # LISTENER,EMAGENT running on same ORACLE_HOME 17 | # 18 | ORA_HOME=<%= $oracle_home %> 19 | ORA_OWNER=<%= $user %> 20 | LOCK_FILE=/var/lock/subsys/<%= $service_name %> 21 | 22 | if [ ! -f $ORA_HOME/bin/dbstart ] 23 | then 24 | echo "Oracle startup: cannot start" 25 | exit 26 | fi 27 | 28 | case "$1" in 29 | 'start') 30 | 31 | # Start the Oracle databases and Listener: 32 | # The following command assumes that the oracle login 33 | # will not prompt the user for any values 34 | su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" 35 | 36 | # Start the Intelligent Agent 37 | if [ -f $ORA_HOME/bin/emctl ]; then 38 | su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start agent" 39 | elif [ -f $ORA_HOME/bin/agentctl ]; then 40 | su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl start" 41 | else 42 | echo "Intelligent Agent startup not required" 43 | fi 44 | 45 | # Start Management Server 46 | if [ -f $ORA_HOME/bin/emctl ]; then 47 | su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole" 48 | elif [ -f $ORA_HOME/bin/oemctl ]; then 49 | su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl start oms" 50 | fi 51 | 52 | # Start HTTP Server 53 | if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then 54 | su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl start" 55 | fi 56 | touch $LOCK_FILE 57 | ;; 58 | 59 | 'stop') 60 | # Stop HTTP Server 61 | if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then 62 | su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl stop" 63 | fi 64 | 65 | # Stop the Oracle databases and Listener: 66 | # The following command assumes that the oracle login 67 | # will not prompt the user for any values 68 | su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" 69 | rm -f $LOCK_FILE 70 | ;; 71 | esac 72 | 73 | # End of script dbora -------------------------------------------------------------------------------- /templates/dbora_SunOS.epp: -------------------------------------------------------------------------------- 1 | <%- | String $oracle_home, 2 | String $user, 3 | Optional[String] $service_name 4 | | -%> 5 | 6 | #!/bin/sh 7 | ORA_HOME=<%= $oracle_home %> 8 | ORA_OWNER=<%= $user %> 9 | 10 | export ORA_HOME 11 | export ORA_OWNER 12 |   13 | if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ] 14 | then 15 | echo "The Oracle Startup file (dbstart) was not found" 16 | exit 17 | fi 18 |   19 | case "$1" in 20 | 'start') 21 | # start Oracle databases 22 | su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" 23 | ;; 24 | 'stop') 25 | # stop Oracle databases 26 | su $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" 27 | ;; 28 | 'restart') 29 | su $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" 30 | su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /templates/em_agent_pull.properties.epp: -------------------------------------------------------------------------------- 1 | <%- | Optional[String] $agent_instance_home_dir, 2 | Optional[String] $oms_host, 3 | Optional[Integer] $oms_port, 4 | Optional[Integer] $agent_port, 5 | Optional[Integer] $em_upload_port, 6 | Optional[String] $agent_base_dir, 7 | Optional[String] $agent_registration_password | -%> 8 | 9 | <% if $agent_instance_home_dir { %> 10 | AGENT_INSTANCE_HOME=<%= $agent_instance_home_dir %> 11 | <% } %> 12 | 13 | <% if $agent_base_dir { %> 14 | AGENT_BASE_DIR=<%= $agent_base_dir %> 15 | <% } %> 16 | 17 | <% if $agent_registration_password { %> 18 | AGENT_REGISTRATION_PASSWORD=<%= $agent_registration_password %> 19 | <% } %> 20 | 21 | <% if $oms_host { %> 22 | OMS_HOST=<%= $oms_host %> 23 | <% } %> 24 | <% if $oms_port { %> 25 | OMS_PORT=<%= $oms_port %> 26 | <% } %> 27 | <% if $agent_port { %> 28 | AGENT_PORT=<%= $agent_port %> 29 | <% } %> 30 | <% if $em_upload_port { %> 31 | EM_UPLOAD_PORT=<%= $em_upload_port %> 32 | <% } %> 33 | -------------------------------------------------------------------------------- /templates/em_install_static_12.1.0.4.ini.epp: -------------------------------------------------------------------------------- 1 | <%- | Integer $admin_server_https_port, 2 | Integer $managed_server_http_port, 3 | Integer $managed_server_https_port, 4 | Integer $em_upload_http_port, 5 | Integer $em_upload_https_port, 6 | Integer $em_central_console_http_port, 7 | Integer $em_central_console_https_port, 8 | Integer $bi_publisher_http_port, 9 | Integer $bi_publisher_https_port, 10 | Integer $nodemanager_https_port, 11 | Integer $agent_port | -%> 12 | # staticports.ini Template File 13 | 14 | # This file is a template for specifying port numbers at installation time. 15 | # To specify a port number, uncomment the appropriate line (remove #) and 16 | # replace "port_num" with the desired port number. 17 | # You can then launch Oracle Universal Installer with special options to use this file. 18 | # Please refer to Enterprise Manager Cloud Control 11gR1 Installation Guide for instructions. 19 | 20 | # Enterprise Manager 21 | 22 | Admin Server Http SSL Port=<%=$admin_server_https_port %> 23 | Managed Server Http Port=<%=$managed_server_http_port%> 24 | Managed Server Http SSL Port=<%=$managed_server_https_port%> 25 | Enterprise Manager Upload Http Port=<%=$em_upload_http_port%> 26 | Enterprise Manager Upload Http SSL Port=<%=$em_upload_https_port%> 27 | Enterprise Manager Central Console Http Port=<%=$em_central_console_http_port%> 28 | Enterprise Manager Central Console Http SSL Port=<%=$em_central_console_https_port%> 29 | BI Publisher Http Port=<%=$bi_publisher_http_port%> 30 | BI Publisher Http SSL Port=<%=$bi_publisher_https_port%> 31 | Node Manager Http SSL Port=<%=$nodemanager_https_port%> 32 | 33 | #For Agent 34 | 35 | Oracle Management Agent Port=<%=$agent_port%> 36 | 37 | -------------------------------------------------------------------------------- /templates/em_install_static_12.1.0.5.ini.epp: -------------------------------------------------------------------------------- 1 | <%- | Integer $admin_server_https_port, 2 | Integer $managed_server_http_port, 3 | Integer $managed_server_https_port, 4 | Integer $em_upload_http_port, 5 | Integer $em_upload_https_port, 6 | Integer $em_central_console_http_port, 7 | Integer $em_central_console_https_port, 8 | Integer $bi_publisher_http_port, 9 | Integer $bi_publisher_https_port, 10 | Integer $nodemanager_https_port, 11 | Integer $agent_port | -%> 12 | # staticports.ini Template File 13 | 14 | # This file is a template for specifying port numbers at installation time. 15 | # To specify a port number, uncomment the appropriate line (remove #) and 16 | # replace "port_num" with the desired port number. 17 | # You can then launch Oracle Universal Installer with special options to use this file. 18 | # Please refer to Enterprise Manager Cloud Control 11gR1 Installation Guide for instructions. 19 | 20 | # Enterprise Manager 21 | 22 | Admin Server Http SSL Port=<%=$admin_server_https_port %> 23 | Managed Server Http Port=<%=$managed_server_http_port%> 24 | Managed Server Http SSL Port=<%=$managed_server_https_port%> 25 | Enterprise Manager Upload Http Port=<%=$em_upload_http_port%> 26 | Enterprise Manager Upload Http SSL Port=<%=$em_upload_https_port%> 27 | Enterprise Manager Central Console Http Port=<%=$em_central_console_http_port%> 28 | Enterprise Manager Central Console Http SSL Port=<%=$em_central_console_https_port%> 29 | BI Publisher Http Port=<%=$bi_publisher_http_port%> 30 | BI Publisher Http SSL Port=<%=$bi_publisher_https_port%> 31 | Node Manager Http SSL Port=<%=$nodemanager_https_port%> 32 | 33 | #For Agent 34 | 35 | Oracle Management Agent Port=<%=$agent_port%> 36 | 37 | -------------------------------------------------------------------------------- /templates/em_install_static_13.2.0.0.ini.epp: -------------------------------------------------------------------------------- 1 | <%- | Integer $admin_server_https_port, 2 | Integer $managed_server_http_port, 3 | Integer $managed_server_https_port, 4 | Integer $em_upload_http_port, 5 | Integer $em_upload_https_port, 6 | Integer $em_central_console_http_port, 7 | Integer $em_central_console_https_port, 8 | Integer $bi_publisher_http_port, 9 | Integer $bi_publisher_https_port, 10 | Integer $nodemanager_https_port, 11 | Integer $agent_port | -%> 12 | # staticports.ini Template File 13 | 14 | # This file is a template for specifying port numbers at installation time. 15 | # To specify a port number, uncomment the appropriate line (remove #) and 16 | # replace "port_num" with the desired port number. 17 | # You can then launch Oracle Universal Installer with special options to use this file. 18 | # Please refer to Enterprise Manager Cloud Control 11gR1 Installation Guide for instructions. 19 | 20 | # Enterprise Manager 21 | 22 | Admin Server Http SSL Port=<%=$admin_server_https_port %> 23 | Managed Server Http Port=<%=$managed_server_http_port%> 24 | Managed Server Http SSL Port=<%=$managed_server_https_port%> 25 | Enterprise Manager Upload Http Port=<%=$em_upload_http_port%> 26 | Enterprise Manager Upload Http SSL Port=<%=$em_upload_https_port%> 27 | Enterprise Manager Central Console Http Port=<%=$em_central_console_http_port%> 28 | Enterprise Manager Central Console Http SSL Port=<%=$em_central_console_https_port%> 29 | BI Publisher Http Port=<%=$bi_publisher_http_port%> 30 | BI Publisher Http SSL Port=<%=$bi_publisher_https_port%> 31 | Node Manager Http SSL Port=<%=$nodemanager_https_port%> 32 | 33 | #For Agent 34 | 35 | Oracle Management Agent Port=<%=$agent_port%> 36 | 37 | -------------------------------------------------------------------------------- /templates/grid_bash_profile.epp: -------------------------------------------------------------------------------- 1 | <%- | String $grid_home, String $grid_base, String $grid_type, String $temp_dir | -%> 2 | 3 | if [ -f ~/.bashrc ]; then 4 | . ~/.bashrc 5 | fi 6 | 7 | ORACLE_TERM=xterm; export ORACLE_TERM 8 | 9 | LD_LIBRARY_PATH=<%= $grid_home %>/lib 10 | ORACLE_BASE=<%= $grid_base %> 11 | ORACLE_HOME=<%= $grid_home %> 12 | SQLPLUS_HOME=<%= $grid_home %> 13 | PATH=/bin:/usr/local/bin:/usr/bin:/bin:<%= $grid_home %>/bin 14 | 15 | <% if $grid_type == 'HA_CONFIG' {%> 16 | export ORACLE_SID=+ASM 17 | <% } %> 18 | <% unless $grid_type == 'HA_CONFIG' {%> 19 | export ORACLE_SID=+ASM1 20 | <% } %> 21 | 22 | export ORACLE_UNQNAME=+ASM 23 | 24 | export LD_LIBRARY_PATH 25 | export ORACLE_BASE 26 | export ORACLE_HOME 27 | export SQLPLUS_HOME 28 | export PATH 29 | 30 | export TEMP=<%= $temp_dir %> 31 | export TMPDIR=<%= $temp_dir %> 32 | umask 022 33 | -------------------------------------------------------------------------------- /templates/grid_password.properties.epp: -------------------------------------------------------------------------------- 1 | <%- | String $sys_asm_password | -%> 2 | oracle.assistants.asm|S_ASMPASSWORD=<%= $sys_asm_password %> 3 | oracle.assistants.asm|S_ASMMONITORPASSWORD=<%= $sys_asm_password %> 4 | oracle.crs|S_BMCPASSWORD=<%= $sys_asm_password %> -------------------------------------------------------------------------------- /templates/listener.epp: -------------------------------------------------------------------------------- 1 | <%- | String $title, 2 | Hash $server, 3 | Optional[String] $loadbalance = undef, 4 | Optional[String] $failover = undef, 5 | Optional[String] $connect_server = undef, 6 | Optional[String] $connect_service_name = undef, 7 | Integer $size | -%> 8 | 9 | <%= $title %> = 10 | <%- if $size == 1 {-%> 11 | <%- $server.each |$key, $server2| { -%> 12 | (ADDRESS = (PROTOCOL = <%= $server2['protocol'] %>)(HOST = <%= $server2['host'] %>)(PORT = <%= $server2['port'] %>)) 13 | <%- } -%> 14 | <%- } -%> 15 | <%- unless $size == 1 { -%> 16 | (ADDRESS_LIST= 17 | <%- $server.each |$key, $server2| { -%> 18 | (ADDRESS = (PROTOCOL = <%= $server2['protocol'] %>)(HOST = <%= $server2['host'] %>)(PORT = <%= $server2['port'] %>)) 19 | <%- } -%> 20 | ) 21 | <%- } -%> -------------------------------------------------------------------------------- /templates/netca_client_11.2.0.1.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | Integer $db_port | -%> 2 | ############################################################### 3 | ## Copyright(c) Oracle Corporation 2002. All rights reserved.## 4 | ## ## 5 | ## Specify values for the variables listed below to customize## 6 | ## your installation. ## 7 | ## ## 8 | ## Each variable is associated with a comment. The comment ## 9 | ## identifies the variable type. ## 10 | ## ## 11 | ## Please specify the values in the following format: ## 12 | ## ## 13 | ## Type Example ## 14 | ## String "Sample Value" ## 15 | ## Boolean True or False ## 16 | ## Number 1000 ## 17 | ## StringList {"String value 1","String Value 2"} ## 18 | ## ## 19 | ############################################################### 20 | ## ## 21 | ## This sample response file causes the Oracle Net ## 22 | ## Configuration Assistant (NetCA) to complete an Oracle Net ## 23 | ## configuration during a custom install of the Oracle11g ## 24 | ## server which is similar to what would be created by the ## 25 | ## NetCA during typical Oracle11g install. It also documents ## 26 | ## all of the NetCA response files variables so you can ## 27 | ## create your own response file to configure Oracle Net ## 28 | ## during an install the way you wish. ## 29 | ## ## 30 | ############################################################### 31 | 32 | [GENERAL] 33 | RESPONSEFILE_VERSION="11.2" 34 | CREATE_TYPE="CUSTOM" 35 | 36 | #------------------------------------------------------------------------------- 37 | # Name : SHOW_GUI 38 | # Datatype : Boolean 39 | # Description: This variable controls appearance/suppression of the NetCA GUI, 40 | # Pre-req : N/A 41 | # Default : TRUE 42 | # Note: 43 | # This must be set to false in order to run NetCA in silent mode. 44 | # This is a substitute of "/silent" flag in the NetCA command line. 45 | # The command line flag has precedence over the one in this response file. 46 | # This feature is present since 10.1.0.3. 47 | #------------------------------------------------------------------------------- 48 | SHOW_GUI=false 49 | 50 | #------------------------------------------------------------------------------- 51 | # Name : LOG_FILE 52 | # Datatype : String 53 | # Description: If present, NetCA will log output to this file in addition to the 54 | # standard out. 55 | # Pre-req : N/A 56 | # Default : NONE 57 | # Note: 58 | # This is a substitute of "/log" in the NetCA command line. 59 | # The command line argument has precedence over the one in this response file. 60 | # This feature is present since 10.1.0.3. 61 | #------------------------------------------------------------------------------- 62 | #LOG_FILE=""/oracle11gHome/network/tools/log/netca.log"" 63 | 64 | [oracle.net.ca] 65 | #INSTALLED_COMPONENTS;StringList;list of installed components 66 | # The possible values for installed components are: 67 | # "net8","server","client","aso", "cman", "javavm" 68 | INSTALLED_COMPONENTS={"client","net8","javavm"} 69 | 70 | #INSTALL_TYPE;String;type of install 71 | # The possible values for install type are: 72 | # "typical","minimal" or "custom" 73 | INSTALL_TYPE=""typical"" 74 | 75 | #LISTENER_NUMBER;Number;Number of Listeners 76 | # A typical install sets one listener 77 | LISTENER_NUMBER=0 78 | 79 | #LISTENER_NAMES;StringList;list of listener names 80 | # The values for listener are: 81 | # "LISTENER","LISTENER1","LISTENER2","LISTENER3", ... 82 | # A typical install sets only "LISTENER" 83 | LISTENER_NAMES={"LISTENER"} 84 | 85 | #LISTENER_PROTOCOLS;StringList;list of listener addresses (protocols and parameters separated by semicolons) 86 | # The possible values for listener protocols are: 87 | # "TCP;1521","TCPS;2484","NMP;ORAPIPE","IPC;IPCKEY","VI;1521" 88 | # A typical install sets only "TCP;1521" 89 | LISTENER_PROTOCOLS={"TCP;<%= $db_port %>"} 90 | 91 | #LISTENER_START;String;name of the listener to start, in double quotes 92 | LISTENER_START=""LISTENER"" 93 | 94 | #NAMING_METHODS;StringList;list of naming methods 95 | # The possible values for naming methods are: 96 | # LDAP, TNSNAMES, ONAMES, HOSTNAME, NOVELL, NIS, DCE 97 | # A typical install sets only: "TNSNAMES","ONAMES","HOSTNAMES" 98 | # or "LDAP","TNSNAMES","ONAMES","HOSTNAMES" for LDAP 99 | NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"} 100 | 101 | #NOVELL_NAMECONTEXT;String;Novell Directory Service name context, in double quotes 102 | # A typical install does not use this variable. 103 | #NOVELL_NAMECONTEXT = ""NAMCONTEXT"" 104 | 105 | #SUN_METAMAP;String; SUN meta map, in double quotes 106 | # A typical install does not use this variable. 107 | #SUN_METAMAP = ""MAP"" 108 | 109 | #DCE_CELLNAME;String;DCE cell name, in double quotes 110 | # A typical install does not use this variable. 111 | #DCE_CELLNAME = ""CELL"" 112 | 113 | #NSN_NUMBER;Number;Number of NetService Names 114 | # A typical install sets one net service name 115 | NSN_NUMBER=1 116 | 117 | #NSN_NAMES;StringList;list of Net Service names 118 | # A typical install sets net service name to "EXTPROC_CONNECTION_DATA" 119 | NSN_NAMES={"EXTPROC_CONNECTION_DATA"} 120 | 121 | #NSN_SERVICE;StringList;Oracle11g database's service name 122 | # A typical install sets Oracle11g database's service name to "PLSExtProc" 123 | NSN_SERVICE={"PLSExtProc"} 124 | 125 | #NSN_PROTOCOLS;StringList;list of coma separated strings of Net Service Name protocol parameters 126 | # The possible values for net service name protocol parameters are: 127 | # "TCP;HOSTNAME;1521","TCPS;HOSTNAME;2484","NMP;COMPUTERNAME;ORAPIPE","VI;HOSTNAME;1521","IPC;IPCKEY" 128 | # A typical install sets parameters to "IPC;EXTPROC" 129 | NSN_PROTOCOLS={"TCP;HOSTNAME;<%= $db_port %>"} 130 | -------------------------------------------------------------------------------- /templates/netca_client_11.2.0.4.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | Integer $db_port | -%> 2 | ###################################################################### 3 | ## Copyright(c) 1998, 2011 Oracle Corporation. All rights reserved. ## 4 | ## ## 5 | ## Specify values for the variables listed below to customize your ## 6 | ## installation. ## 7 | ## ## 8 | ## Each variable is associated with a comment. The comment ## 9 | ## identifies the variable type. ## 10 | ## ## 11 | ## Please specify the values in the following format: ## 12 | ## ## 13 | ## Type Example ## 14 | ## String "Sample Value" ## 15 | ## Boolean True or False ## 16 | ## Number 1000 ## 17 | ## StringList {"String value 1","String Value 2"} ## 18 | ## ## 19 | ###################################################################### 20 | ## ## 21 | ## This sample response file causes the Oracle Net Configuration ## 22 | ## Assistant (NetCA) to complete an Oracle Net configuration during ## 23 | ## a custom install of the Oracle11g server which is similar to ## 24 | ## what would be created by the NetCA during typical Oracle11g ## 25 | ## install. It also documents all of the NetCA response file ## 26 | ## variables so you can create your own response file to configure ## 27 | ## Oracle Net during an install the way you wish. ## 28 | ## ## 29 | ###################################################################### 30 | 31 | [GENERAL] 32 | RESPONSEFILE_VERSION="11.2" 33 | CREATE_TYPE="CUSTOM" 34 | 35 | #------------------------------------------------------------------------------- 36 | # Name : SHOW_GUI 37 | # Datatype : Boolean 38 | # Description: This variable controls appearance/suppression of the NetCA GUI, 39 | # Pre-req : N/A 40 | # Default : TRUE 41 | # Note: 42 | # This must be set to false in order to run NetCA in silent mode. 43 | # This is a substitute of "/silent" flag in the NetCA command line. 44 | # The command line flag has precedence over the one in this response file. 45 | # This feature is present since 10.1.0.3. 46 | #------------------------------------------------------------------------------- 47 | #SHOW_GUI=false 48 | 49 | #------------------------------------------------------------------------------- 50 | # Name : LOG_FILE 51 | # Datatype : String 52 | # Description: If present, NetCA will log output to this file in addition to the 53 | # standard out. 54 | # Pre-req : N/A 55 | # Default : NONE 56 | # Note: 57 | # This is a substitute of "/log" in the NetCA command line. 58 | # The command line argument has precedence over the one in this response file. 59 | # This feature is present since 10.1.0.3. 60 | #------------------------------------------------------------------------------- 61 | #LOG_FILE=""/oracle11gHome/network/tools/log/netca.log"" 62 | 63 | [oracle.net.ca] 64 | #INSTALLED_COMPONENTS;StringList;list of installed components 65 | # The possible values for installed components are: 66 | # "net8","server","client","aso", "cman", "javavm" 67 | INSTALLED_COMPONENTS={"client","net8","javavm"} 68 | 69 | #INSTALL_TYPE;String;type of install 70 | # The possible values for install type are: 71 | # "typical","minimal" or "custom" 72 | INSTALL_TYPE=""typical"" 73 | 74 | #LISTENER_NUMBER;Number;Number of Listeners 75 | # A typical install sets one listener 76 | LISTENER_NUMBER=1 77 | 78 | #LISTENER_NAMES;StringList;list of listener names 79 | # The values for listener are: 80 | # "LISTENER","LISTENER1","LISTENER2","LISTENER3", ... 81 | # A typical install sets only "LISTENER" 82 | LISTENER_NAMES={"LISTENER"} 83 | 84 | #LISTENER_PROTOCOLS;StringList;list of listener addresses (protocols and parameters separated by semicolons) 85 | # The possible values for listener protocols are: 86 | # "TCP;1521","TCPS;2484","NMP;ORAPIPE","IPC;IPCKEY","VI;1521" 87 | # A typical install sets only "TCP;1521" 88 | LISTENER_PROTOCOLS={"TCP;<%= $db_port %>"} 89 | 90 | #LISTENER_START;String;name of the listener to start, in double quotes 91 | LISTENER_START=""LISTENER"" 92 | 93 | #NAMING_METHODS;StringList;list of naming methods 94 | # The possible values for naming methods are: 95 | # LDAP, TNSNAMES, ONAMES, HOSTNAME, NOVELL, NIS, DCE 96 | # A typical install sets only: "TNSNAMES","ONAMES","HOSTNAMES" 97 | # or "LDAP","TNSNAMES","ONAMES","HOSTNAMES" for LDAP 98 | NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"} 99 | 100 | #NOVELL_NAMECONTEXT;String;Novell Directory Service name context, in double quotes 101 | # A typical install does not use this variable. 102 | #NOVELL_NAMECONTEXT = ""NAMCONTEXT"" 103 | 104 | #SUN_METAMAP;String; SUN meta map, in double quotes 105 | # A typical install does not use this variable. 106 | #SUN_METAMAP = ""MAP"" 107 | 108 | #DCE_CELLNAME;String;DCE cell name, in double quotes 109 | # A typical install does not use this variable. 110 | #DCE_CELLNAME = ""CELL"" 111 | 112 | #NSN_NUMBER;Number;Number of NetService Names 113 | # A typical install sets one net service name 114 | NSN_NUMBER=1 115 | 116 | #NSN_NAMES;StringList;list of Net Service names 117 | # A typical install sets net service name to "EXTPROC_CONNECTION_DATA" 118 | NSN_NAMES={"EXTPROC_CONNECTION_DATA"} 119 | 120 | #NSN_SERVICE;StringList;Oracle11g database's service name 121 | # A typical install sets Oracle11g database's service name to "PLSExtProc" 122 | NSN_SERVICE={"PLSExtProc"} 123 | 124 | #NSN_PROTOCOLS;StringList;list of coma separated strings of Net Service Name protocol parameters 125 | # The possible values for net service name protocol parameters are: 126 | # "TCP;HOSTNAME;1521","TCPS;HOSTNAME;2484","NMP;COMPUTERNAME;ORAPIPE","VI;HOSTNAME;1521","IPC;IPCKEY" 127 | # A typical install sets parameters to "IPC;EXTPROC" 128 | NSN_PROTOCOLS={"TCP;HOSTNAME;<%= $db_port %>"} 129 | -------------------------------------------------------------------------------- /templates/ocm.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $patchDir | -%> 2 | #!/usr/bin/ksh 3 | 4 | EMOCMRSP=<%= $patchDir %>/ocm/bin/emocmrsp 5 | 6 | /usr/bin/expect - < 7 | #################################################################### 8 | ## Copyright(c) Oracle Corporation 2012. All rights reserved. ## 9 | ## ## 10 | ## Specify values for the variables listed below to customize ## 11 | ## your installation. ## 12 | ## ## 13 | ## Each variable is associated with a comment. The comment ## 14 | ## can help to populate the variables with the appropriate ## 15 | ## values. ## 16 | ## ## 17 | ## IMPORTANT NOTE: This file contains plain text passwords and ## 18 | ## should be secured to have read permission only by oracle user ## 19 | ## or administrator who owns this installation. ## 20 | ## ## 21 | #################################################################### 22 | 23 | #------------------------------------------------------------------------------- 24 | # Do not change the following system generated value. 25 | #------------------------------------------------------------------------------- 26 | oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v12_1_2 27 | 28 | 29 | ################################################################################ 30 | ## ## 31 | ## Oracle GoldenGate installation option and details ## 32 | ## ## 33 | ################################################################################ 34 | 35 | #------------------------------------------------------------------------------- 36 | # Specify the installation option. 37 | # Specify ORA12c for installing Oracle GoldenGate for Oracle Database 12c and 38 | # ORA11g for installing Oracle GoldenGate for Oracle Database 11g 39 | #------------------------------------------------------------------------------- 40 | INSTALL_OPTION=<%= $database_version %> 41 | 42 | #------------------------------------------------------------------------------- 43 | # Specify a location to install Oracle GoldenGate 44 | #------------------------------------------------------------------------------- 45 | SOFTWARE_LOCATION=<%= $goldengate_home %> 46 | 47 | #------------------------------------------------------------------------------- 48 | # Specify true to start the manager after installation. 49 | #------------------------------------------------------------------------------- 50 | START_MANAGER=true 51 | 52 | #------------------------------------------------------------------------------- 53 | # Specify a free port within the valid range for the manager process. 54 | # Required only if START_MANAGER is true. 55 | #------------------------------------------------------------------------------- 56 | MANAGER_PORT=<%= $manager_port %> 57 | 58 | #------------------------------------------------------------------------------- 59 | # Specify the location of the Oracle Database. 60 | # Required only if START_MANAGER is true. 61 | #------------------------------------------------------------------------------- 62 | DATABASE_LOCATION=<%= $database_home %> 63 | 64 | 65 | ################################################################################ 66 | ## ## 67 | ## Specify details to Create inventory for Oracle installs ## 68 | ## Required only for the first Oracle product install on a system. ## 69 | ## ## 70 | ################################################################################ 71 | 72 | #------------------------------------------------------------------------------- 73 | # Specify the location which holds the install inventory files. 74 | # This is an optional parameter if installing on 75 | # Windows based Operating System. 76 | #------------------------------------------------------------------------------- 77 | INVENTORY_LOCATION=<%= $ora_inventory %> 78 | 79 | #------------------------------------------------------------------------------- 80 | # Unix group to be set for the inventory directory. 81 | # This parameter is not applicable if installing on 82 | # Windows based Operating System. 83 | #------------------------------------------------------------------------------- 84 | UNIX_GROUP_NAME=<%= $group_install %> 85 | -------------------------------------------------------------------------------- /templates/oggcore_12.2.1.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $database_version, 2 | String $goldengate_home, 3 | String $database_home, 4 | String $ora_inventory, 5 | String $group_install, 6 | Integer $manager_port | -%> 7 | #################################################################### 8 | ## Copyright(c) Oracle Corporation 2012. All rights reserved. ## 9 | ## ## 10 | ## Specify values for the variables listed below to customize ## 11 | ## your installation. ## 12 | ## ## 13 | ## Each variable is associated with a comment. The comment ## 14 | ## can help to populate the variables with the appropriate ## 15 | ## values. ## 16 | ## ## 17 | ## IMPORTANT NOTE: This file contains plain text passwords and ## 18 | ## should be secured to have read permission only by oracle user ## 19 | ## or administrator who owns this installation. ## 20 | ## ## 21 | #################################################################### 22 | 23 | #------------------------------------------------------------------------------- 24 | # Do not change the following system generated value. 25 | #------------------------------------------------------------------------------- 26 | oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v12_1_2 27 | 28 | 29 | ################################################################################ 30 | ## ## 31 | ## Oracle GoldenGate installation option and details ## 32 | ## ## 33 | ################################################################################ 34 | 35 | #------------------------------------------------------------------------------- 36 | # Specify the installation option. 37 | # Specify ORA12c for installing Oracle GoldenGate for Oracle Database 12c and 38 | # ORA11g for installing Oracle GoldenGate for Oracle Database 11g 39 | #------------------------------------------------------------------------------- 40 | INSTALL_OPTION=<%= $database_version %> 41 | 42 | #------------------------------------------------------------------------------- 43 | # Specify a location to install Oracle GoldenGate 44 | #------------------------------------------------------------------------------- 45 | SOFTWARE_LOCATION=<%= $goldengate_home %> 46 | 47 | #------------------------------------------------------------------------------- 48 | # Specify true to start the manager after installation. 49 | #------------------------------------------------------------------------------- 50 | START_MANAGER=true 51 | 52 | #------------------------------------------------------------------------------- 53 | # Specify a free port within the valid range for the manager process. 54 | # Required only if START_MANAGER is true. 55 | #------------------------------------------------------------------------------- 56 | MANAGER_PORT=<%= $manager_port %> 57 | 58 | #------------------------------------------------------------------------------- 59 | # Specify the location of the Oracle Database. 60 | # Required only if START_MANAGER is true. 61 | #------------------------------------------------------------------------------- 62 | DATABASE_LOCATION=<%= $database_home %> 63 | 64 | 65 | ################################################################################ 66 | ## ## 67 | ## Specify details to Create inventory for Oracle installs ## 68 | ## Required only for the first Oracle product install on a system. ## 69 | ## ## 70 | ################################################################################ 71 | 72 | #------------------------------------------------------------------------------- 73 | # Specify the location which holds the install inventory files. 74 | # This is an optional parameter if installing on 75 | # Windows based Operating System. 76 | #------------------------------------------------------------------------------- 77 | INVENTORY_LOCATION=<%= $ora_inventory %> 78 | 79 | #------------------------------------------------------------------------------- 80 | # Unix group to be set for the inventory directory. 81 | # This parameter is not applicable if installing on 82 | # Windows based Operating System. 83 | #------------------------------------------------------------------------------- 84 | UNIX_GROUP_NAME=<%= $group_install %> 85 | -------------------------------------------------------------------------------- /templates/oggcore_12.3.0.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $database_version, 2 | String $goldengate_home, 3 | String $database_home, 4 | String $ora_inventory, 5 | String $group_install, 6 | Integer $manager_port | -%> 7 | #################################################################### 8 | ## Copyright(c) Oracle Corporation 2012. All rights reserved. ## 9 | ## ## 10 | ## Specify values for the variables listed below to customize ## 11 | ## your installation. ## 12 | ## ## 13 | ## Each variable is associated with a comment. The comment ## 14 | ## can help to populate the variables with the appropriate ## 15 | ## values. ## 16 | ## ## 17 | ## IMPORTANT NOTE: This file contains plain text passwords and ## 18 | ## should be secured to have read permission only by oracle user ## 19 | ## or administrator who owns this installation. ## 20 | ## ## 21 | #################################################################### 22 | 23 | #------------------------------------------------------------------------------- 24 | # Do not change the following system generated value. 25 | #------------------------------------------------------------------------------- 26 | oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v12_1_2 27 | 28 | 29 | ################################################################################ 30 | ## ## 31 | ## Oracle GoldenGate installation option and details ## 32 | ## ## 33 | ################################################################################ 34 | 35 | #------------------------------------------------------------------------------- 36 | # Specify the installation option. 37 | # Specify ORA12c for installing Oracle GoldenGate for Oracle Database 12c and 38 | # ORA11g for installing Oracle GoldenGate for Oracle Database 11g 39 | #------------------------------------------------------------------------------- 40 | INSTALL_OPTION=<%= $database_version %> 41 | 42 | #------------------------------------------------------------------------------- 43 | # Specify a location to install Oracle GoldenGate 44 | #------------------------------------------------------------------------------- 45 | SOFTWARE_LOCATION=<%= $goldengate_home %> 46 | 47 | #------------------------------------------------------------------------------- 48 | # Specify true to start the manager after installation. 49 | #------------------------------------------------------------------------------- 50 | START_MANAGER=true 51 | 52 | #------------------------------------------------------------------------------- 53 | # Specify a free port within the valid range for the manager process. 54 | # Required only if START_MANAGER is true. 55 | #------------------------------------------------------------------------------- 56 | MANAGER_PORT=<%= $manager_port %> 57 | 58 | #------------------------------------------------------------------------------- 59 | # Specify the location of the Oracle Database. 60 | # Required only if START_MANAGER is true. 61 | #------------------------------------------------------------------------------- 62 | DATABASE_LOCATION=<%= $database_home %> 63 | 64 | 65 | ################################################################################ 66 | ## ## 67 | ## Specify details to Create inventory for Oracle installs ## 68 | ## Required only for the first Oracle product install on a system. ## 69 | ## ## 70 | ################################################################################ 71 | 72 | #------------------------------------------------------------------------------- 73 | # Specify the location which holds the install inventory files. 74 | # This is an optional parameter if installing on 75 | # Windows based Operating System. 76 | #------------------------------------------------------------------------------- 77 | INVENTORY_LOCATION=<%= $ora_inventory %> 78 | 79 | #------------------------------------------------------------------------------- 80 | # Unix group to be set for the inventory directory. 81 | # This parameter is not applicable if installing on 82 | # Windows based Operating System. 83 | #------------------------------------------------------------------------------- 84 | UNIX_GROUP_NAME=<%= $group_install %> 85 | -------------------------------------------------------------------------------- /templates/oggcore_18.1.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $database_version, 2 | String $goldengate_home, 3 | String $database_home, 4 | String $ora_inventory, 5 | String $group_install, 6 | Integer $manager_port | -%> 7 | #################################################################### 8 | ## Copyright(c) Oracle Corporation 2017. All rights reserved. ## 9 | ## ## 10 | ## Specify values for the variables listed below to customize ## 11 | ## your installation. ## 12 | ## ## 13 | ## Each variable is associated with a comment. The comment ## 14 | ## can help to populate the variables with the appropriate ## 15 | ## values. ## 16 | ## ## 17 | ## IMPORTANT NOTE: This file should be secured to have read ## 18 | ## permission only by the oracle user or an administrator who ## 19 | ## own this installation to protect any sensitive input values. ## 20 | ## ## 21 | #################################################################### 22 | 23 | #------------------------------------------------------------------------------- 24 | # Do not change the following system generated value. 25 | #------------------------------------------------------------------------------- 26 | oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v18_1_0 27 | 28 | 29 | ################################################################################ 30 | ## ## 31 | ## Oracle GoldenGate installation option and details ## 32 | ## ## 33 | ################################################################################ 34 | 35 | #------------------------------------------------------------------------------- 36 | # Specify the installation option. 37 | # Specify ORA18c for installing Oracle GoldenGate for Oracle Database 18c or 38 | # ORA12c for installing Oracle GoldenGate for Oracle Database 12c or 39 | # ORA11g for installing Oracle GoldenGate for Oracle Database 11g 40 | #------------------------------------------------------------------------------- 41 | INSTALL_OPTION=<%= $database_version %> 42 | 43 | #------------------------------------------------------------------------------- 44 | # Specify a location to install Oracle GoldenGate 45 | #------------------------------------------------------------------------------- 46 | SOFTWARE_LOCATION=<%= $goldengate_home %> 47 | 48 | #------------------------------------------------------------------------------- 49 | # Specify true to start the manager after installation. 50 | #------------------------------------------------------------------------------- 51 | START_MANAGER=true 52 | 53 | #------------------------------------------------------------------------------- 54 | # Specify a free port within the valid range for the manager process. 55 | # Required only if START_MANAGER is true. 56 | #------------------------------------------------------------------------------- 57 | MANAGER_PORT=<%= $manager_port %> 58 | 59 | #------------------------------------------------------------------------------- 60 | # Specify the location of the Oracle Database. 61 | # Required only if START_MANAGER is true. 62 | #------------------------------------------------------------------------------- 63 | DATABASE_LOCATION=<%= $database_home %> 64 | 65 | 66 | ################################################################################ 67 | ## ## 68 | ## Specify details to Create inventory for Oracle installs ## 69 | ## Required only for the first Oracle product install on a system. ## 70 | ## ## 71 | ################################################################################ 72 | 73 | #------------------------------------------------------------------------------- 74 | # Specify the location which holds the install inventory files. 75 | # This is an optional parameter if installing on 76 | # Windows based Operating System. 77 | #------------------------------------------------------------------------------- 78 | INVENTORY_LOCATION=<%= $ora_inventory %> 79 | 80 | #------------------------------------------------------------------------------- 81 | # Unix group to be set for the inventory directory. 82 | # This parameter is not applicable if installing on 83 | # Windows based Operating System. 84 | #------------------------------------------------------------------------------- 85 | UNIX_GROUP_NAME=<%= $group_install %> 86 | -------------------------------------------------------------------------------- /templates/oggcore_19.1.rsp.epp: -------------------------------------------------------------------------------- 1 | <%- | String $database_version, 2 | String $goldengate_home, 3 | String $database_home, 4 | String $ora_inventory, 5 | String $group_install, 6 | Integer $manager_port | -%> 7 | #################################################################### 8 | ## Copyright(c) Oracle Corporation 2019. All rights reserved. ## 9 | ## ## 10 | ## Specify values for the variables listed below to customize ## 11 | ## your installation. ## 12 | ## ## 13 | ## Each variable is associated with a comment. The comment ## 14 | ## can help to populate the variables with the appropriate ## 15 | ## values. ## 16 | ## ## 17 | ## IMPORTANT NOTE: This file should be secured to have read ## 18 | ## permission only by the oracle user or an administrator who ## 19 | ## own this installation to protect any sensitive input values. ## 20 | ## ## 21 | #################################################################### 22 | 23 | #------------------------------------------------------------------------------- 24 | # Do not change the following system generated value. 25 | #------------------------------------------------------------------------------- 26 | oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v19_1_0 27 | 28 | 29 | ################################################################################ 30 | ## ## 31 | ## Oracle GoldenGate installation option and details ## 32 | ## ## 33 | ################################################################################ 34 | 35 | #------------------------------------------------------------------------------- 36 | # Specify the installation option. 37 | # Specify ORA19c for installing Oracle GoldenGate for Oracle Database 19c or 38 | # ORA18c for installing Oracle GoldenGate for Oracle Database 18c or 39 | # ORA12c for installing Oracle GoldenGate for Oracle Database 12c or 40 | # ORA11g for installing Oracle GoldenGate for Oracle Database 11g 41 | #------------------------------------------------------------------------------- 42 | INSTALL_OPTION=<%= $database_version %> 43 | 44 | #------------------------------------------------------------------------------- 45 | # Specify a location to install Oracle GoldenGate 46 | #------------------------------------------------------------------------------- 47 | SOFTWARE_LOCATION=<%= $goldengate_home %> 48 | 49 | #------------------------------------------------------------------------------- 50 | # Specify true to start the manager after installation. 51 | #------------------------------------------------------------------------------- 52 | START_MANAGER=true 53 | 54 | #------------------------------------------------------------------------------- 55 | # Specify a free port within the valid range for the manager process. 56 | # Required only if START_MANAGER is true. 57 | #------------------------------------------------------------------------------- 58 | MANAGER_PORT=<%= $manager_port %> 59 | 60 | #------------------------------------------------------------------------------- 61 | # Specify the location of the Oracle Database. 62 | # Required only if START_MANAGER is true. 63 | #------------------------------------------------------------------------------- 64 | DATABASE_LOCATION=<%= $database_home %> 65 | 66 | 67 | ################################################################################ 68 | ## ## 69 | ## Specify details to Create inventory for Oracle installs ## 70 | ## Required only for the first Oracle product install on a system. ## 71 | ## ## 72 | ################################################################################ 73 | 74 | #------------------------------------------------------------------------------- 75 | # Specify the location which holds the install inventory files. 76 | # This is an optional parameter if installing on 77 | # Windows based Operating System. 78 | #------------------------------------------------------------------------------- 79 | INVENTORY_LOCATION=<%= $ora_inventory %> 80 | 81 | #------------------------------------------------------------------------------- 82 | # Unix group to be set for the inventory directory. 83 | # This parameter is not applicable if installing on 84 | # Windows based Operating System. 85 | #------------------------------------------------------------------------------- 86 | UNIX_GROUP_NAME=<%= $group_install %> 87 | -------------------------------------------------------------------------------- /templates/ohas.service.epp: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Oracle High Availability Services 3 | After=syslog.target 4 | 5 | [Service] 6 | ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple 7 | Restart=always 8 | RestartSec=10s 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /templates/oraInst.loc.epp: -------------------------------------------------------------------------------- 1 | <%- | String $ora_inventory_dir, 2 | String $os_group = 'dba' | -%> 3 | inventory_loc=<%= $ora_inventory_dir %> 4 | inst_group=<%= $os_group %> 5 | -------------------------------------------------------------------------------- /templates/oradb_smf.xml.epp: -------------------------------------------------------------------------------- 1 | <%- | String $dboraLocation, 2 | String $service_name | -%> 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | -------------------------------------------------------------------------------- /templates/rcu_passwords.txt.epp: -------------------------------------------------------------------------------- 1 | <%- | String $sys_password, Array $componentsPasswords | -%> 2 | <%= $sys_password %> 3 | <% $componentsPasswords.each | $val | { -%> 4 | <%= $val %> 5 | <% } -%> -------------------------------------------------------------------------------- /templates/tnsnames.epp: -------------------------------------------------------------------------------- 1 | <%- | String $title, 2 | Hash $server, 3 | String $loadbalance, 4 | String $failover, 5 | String $connect_server, 6 | Optional[Integer] $connect_timeout = undef, 7 | Optional[Integer] $transport_connect_timeout = undef, 8 | Optional[Integer] $retry_count = undef, 9 | String $connect_service_name | -%> 10 | 11 | <%= $title %> = 12 | (DESCRIPTION = 13 | <%- unless $connect_timeout.empty { -%> 14 | (CONNECT_TIMEOUT = <%= $connect_timeout %>) 15 | <%- } -%> 16 | <%- unless $transport_connect_timeout.empty { -%> 17 | (TRANSPORT_CONNECT_TIMEOUT = <%= $transport_connect_timeout %>) 18 | <%- } -%> 19 | <%- unless $retry_count.empty { -%> 20 | (RETRY_COUNT = <%= $retry_count %>) 21 | <%- } -%> 22 | <%- if $server.size() > 1 { -%> 23 | (ADDRESS_LIST= 24 | (LOAD_BALANCE = <%= $loadbalance %>) 25 | (FAILOVER = <%= $failover %>) 26 | <%- } -%> 27 | <%- $server.each |$key, $server2| { -%> 28 | (ADDRESS = (PROTOCOL = <%= getvar('server2.protocol','TCP').upcase() -%> )(HOST = <%= $server2['host'] %>)(PORT = <%= $server2['port'] %>)) 29 | <%- } -%> 30 | (CONNECT_DATA = 31 | <%- unless $connect_server.empty { -%> 32 | (SERVER = <%= $connect_server %>) 33 | <%- } -%> 34 | (SERVICE_NAME = <%= $connect_service_name %>) 35 | ) 36 | ) 37 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ~/.profile 4 | source ~/.rvm/scripts/rvm 5 | 6 | rvm --version 7 | 8 | # rvm install ruby-1.8.7 9 | # rvm use ruby-1.8.7 10 | # rvm install ruby-2.3.1 11 | # rvm use ruby-2.3.1 12 | rvm install ruby-2.3.6 13 | rvm use ruby-2.3.6 14 | 15 | 16 | set -e 17 | 18 | ruby -v 19 | echo "gem version" 20 | gem --version 21 | gem install bundler --no-rdoc --no-ri 22 | bundle install --without development 23 | bundle --version 24 | 25 | bundle exec rake syntax 26 | bundle exec rake lint 27 | bundle exec rake ci:setup:rspec spec 28 | #bundle exec rake spec 29 | 30 | # Release the Puppet module, doing a clean, build, tag, push, bump_commit 31 | rake module:clean 32 | bundle exec puppet strings generate ./\*\*/*.pp ./lib/puppet/functions/**/*.rb 33 | 34 | rake build 35 | 36 | rake module:push 37 | rake module:tag 38 | rake module:bump_commit # Bump version and git commit 39 | 40 | 41 | 42 | brew cask install puppetlabs/puppet/pdk 43 | brew cask upgrade pdk 44 | 45 | /opt/puppetlabs/pdk/bin/pdk convert 46 | or 47 | /opt/puppetlabs/pdk/bin/pdk update 48 | 49 | /opt/puppetlabs/pdk/bin/pdk validate metadata,puppet 50 | /opt/puppetlabs/pdk/bin/pdk test unit 51 | 52 | /opt/puppetlabs/pdk/bin/pdk build 53 | --------------------------------------------------------------------------------