On Jan 13, 9:26 pm, Corey Osman <[email protected]> wrote:
> Hi,
>
> I am somewhat new to puppet and I wanted to show a demo that automated the 
> install of oracle to my DBA in hopes to entice him to start automating his 
> procedures.
>
> I have linked my manifest code below for review.  In the code I have 
> attempted to automate a complete oracle install by following the instructions 
> provided by my DBA.  Its very rough code as I am not an expert yet.
>
> http://pastebin.com/Qw39iP7z
>
> The code assumes that the oracle pre-install checklist has been completed via 
> another class called oraclebase.  I am using oracle generated response files 
> to automate the actual oracle install.  However since oracle doesn't come 
> inside an rpm I don't know of a good way to check if oracle is installed.  
> Using du is probably the worst way since after an install it will take too 
> long to determine if the size is bigger than 5 (line 16).  
>
> I thought about using NFS to install which would change my cwd to 
> /net/nfsserver/oracle_install/database which would save bandwidth but there 
> may be times when NFS is unavailable or slow WAN links.

It was the very first module I wrote back in 2009, so no guarantees
that it is the best or prettiest approach, but the set of classes
linked to below can install either the oracle server or client.

http://pastebin.com/nVnrkf2J

I was not aware of the oracle-validated rpm, I'll have to check it
out. I wouldn't trust it for the oracle user and groups, since those
IDs should be consistent across systems and rpm won't ensure that. For
some of the other setup (e.g. sysctl) I worry that it would clobber
existing configuration.

> How can I tell if oracle is install or any program when its install without 
> rpm?

Check for a file it creates, like lsnrctl. For example, from my
oracle::install_base class.

exec { run_installer:
  cwd => "$tmp",
  creates => "$oracle_home/bin/$installer_creates",
  command => "su - oracle -c \"$tmp/$pkg/runInstaller -
ignoreSysPrereqs -waitforcompletion -silent -responseFile $tmp/
$response_file &> $tmp/runInstaller.log\"",
  require => [ Class["oracle::packages"], Exec["extract_installer"],
File["response"], File["inventory"]];
}

> How can I tell when the untar command is finished?

This strikes me as the wrong way of thinking about things. Anything
that can't happen before the untar should require the exec that
performs the untar.

> What happens when it takes a while to transfer 1.8GB file?

As far as I know while one step in your manifest is being done, puppet
won't do anything else. As others have said, be wary of using a file
resource for this.

> Does the "user => oracle" give me the environment of the user like su - 
> oracle would?

No.

> Is there a provider for patching oracle?  Is there a patch type?

No. This is something the DBAs where I work handle themselves using
oracle-specific tools.

> Is it bad to have lots of exec statements?

It's messy, but sometimes there's no an obviously better way, or the
amount of work required to do it more cleanly can't be justified. I'm
not sure that I see the advantage of your rpm scheme, for instance,
since you're clearly not going to upgrade oracle by putting newer rpms
in your repository and running yum. If you do go the route of
installing oracle and copying files, rather than running the installer
on each server, be sure not to miss files, like /etc/oratab, that will
end up outside of your oracle base directory. Also, be sure to discuss
this thoroughly with your DBAs and test to make sure it doesn't break
any of their tools; I wonder if there might be identifiers in the
oracle inventory catalog that are supposed to be globally unique, for
example.

All the best,
Brian Pitts

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to