Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class oracle10g{
- # Get files from NFS server or install From NFS server
- # require oracle validated to be installed
- # We need some way to check to see if oracle is installed that is reliable
- # Currently if the /opt/oracle is less than 5 bytes than I can assume its not installed
- # If its greater than 5 bytes than we better not mess with the directory
- # This will let us know if we have already started a transfer or install, in the event that it tries to restart
- exec { "start_transfer":
- creates => "/home/oracle/transfer_started.txt",
- unless => ["test -d /opt/oracle/product/10.2.0"],
- }
- # This is the oracle response files that I created during an oracle base install
- file { "/home/oracle/oracle10gresponse.txt":
- owner => "oracle",
- group => "dba",
- mode => "0644",
- source => "puppet:///files/oracle10gresponse.txt",
- unless => ["test -d /opt/oracle/product/10.2.0"],
- }
- # This is the oracle response files that I created during an oracle upgrade install
- file { "/home/oracle/oracle10gpatchresponse.txt":
- owner => "oracle",
- group => "dba",
- mode => "0644",
- source => "puppet:///files/oracle10gpatchresponse.txt",
- unless => ["test -d /opt/oracle/product/10.2.0"],
- }
- # It would be nice to have a way to see if we need to transfer a file or work from NFS
- # For now, lets assume we have lots of bandwidth
- file { "/home/oracle/oracle_install.tar.gz":
- owner => "oracle",
- group => "dba",
- mode => "0644",
- source => "puppet:///files/oracle_install.tar.gz",
- unless => ["test -d /opt/oracle/product/10.2.0"],
- }
- exec {"extract-oracle":
- user => oracle,
- command => "tar -zxvf oracle_install.tar.gz",
- require => File["/home/oracle/oracle_install.tar.gz"]
- }
- # This will let us know if we have already started a transfer or install, in the event that it tries to restart
- exec { "start-install":
- creates => "/home/oracle/install_started.txt",
- require => Exec['extract-oracle'],
- }
- # this should be split off into baseinstaller, postinstaller and then a patch for loop class
- # In the future I may just create a type/provider for opatch
- exec { "baseinstaller":
- command => "/home/oracle/oracle_install/database/runInstaller -silent -responseFile /home/oracle/oracle10gresponse.txt",
- path => "/home/oracle/oracle_install/database/",
- # only run if just the directory exists
- unless => ["test -d /opt/oracle/product/10.2.0"],
- # need to make sure the class oraclebase has installed everything needed
- require => [Class['oraclebase'],Exec['extract-oracle']],
- user => oracle
- }
- exec { "postinstaller":
- command => "/home/oracle/oracle_install/Disk1/runInstaller -silent -responseFile /home/oracle/oracle10gpatchresponse.txt",
- path => "/home/oracle/oracle_install/Disk1/",
- creates => "/home/oracle/post_install_started.txt",
- require => Exec["baseinstaller"],
- user => oracle
- }
- exec { "patch_4311273":
- command => "cd /home/oracle/oracle_install/4311273; opatch apply",
- path => "/opt/oracle/product/10.2.0/db/OPatch/",
- require => Exec["postinstaller"],
- user => oracle
- }
- exec { "patch_5177766":
- command => "cd /home/oracle/oracle_install/5177766; opatch apply",
- path => "/opt/oracle/product/10.2.0/db/OPatch/",
- require => Exec["patch_4311273"],
- user => oracle
- }
- exec { "install_finished":
- creates => "/home/oracle/install_finished.txt",
- require => Exec["patch_5177766"]
- }
- # Start the Cleanup process and remove all files and directories
- # Don't do this if you decide to host everything on nfs
- file { "remove_oracle10gresponse.txt":
- source => "/home/oracle/oracle10gresponse.txt",
- onlyif => ["test -d /home/oracle/install_finished.txt"],
- ensure => absent,
- }
- file { "remove_oracle10gpatchresponse.txt":
- source => "/home/oracle/oracle10gpatchresponse.txt",
- onlyif => ["test -d /home/oracle/install_finished.txt"],
- ensure => absent,
- }
- file { "remove_oracle_install.tar.gz":
- source => "/home/oracle/oracle_install.tar.gz",
- onlyif => ["test -d /home/oracle/install_finished.txt"],
- ensure => absent,
- }
- file { "remove_oracle_install":
- source => "/home/oracle/oracle_install",
- onlyif => ["test -d /home/oracle/install_finished.txt"],
- ensure => absent,
- recurse => true,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement