Ashley, Thanks. One question though. I'm not much of an Oracle expert, and I guess this is more of an Oracle question, than a puppet one, but what did you do to configure Oracle on the command line once it was installed? It seems like there are some post install config steps, but the Oracle documentation is horrid, and I don't see anything in your module relating to that.
Eg: SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 20 02:11:31 2011 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter password: Connected to an idle instance. SQL> startup ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/initdb_1.ora' SQL> Doug. On Sat, Nov 19, 2011 at 2:24 PM, Ashley Penney <apen...@gmail.com> wrote: > Well, the (good) news is that the scripts as best I can tell just tweak a > few things in /etc/ - the way I handled this was to run the installer and > then just look at changes to the machine and capture those in a couple of > file{} statements, it wasn't too bad and so far the DBAs haven't found > anything glaringly wrong. > Because I feel like exposing the horrors of my work here is the > oracle::server class (Also, I want to state that this is a HORRIBLE class > and it was just written to do enough to get oracle up and move on): > > class oracle::server inherits oracle { > > > > include concat::setup > > include oracle::repo > > > > # ABANDON HOPE ALL YE WHO ENTER HERE > > #include HERE_BE_DRAGONS > > > > # XXX: Mount /dev/xvdj - the non-persistant storage to /oracle > > if $ec2_ami_id { > > exec { "mk-oracle-fs": > > command => "mkfs.ext4 /dev/xvdj", > > unless => "blkid /dev/xvdj | grep ext4", > > } > > > > mount { "/oracle": > > ensure => "mounted", > > fstype => "ext4", > > device => "/dev/xvdj", > > atboot => "true", > > options => "defaults", > > require => [ File["/oracle"], Exec["mk-oracle-fs"] ], > > } > > } > > > > firewall { "001 inbound port for oracle" : > > proto => 'tcp', > > dport => '1800', > > action => 'accept', > > } > > > > if $ec2_ami_id { > > file { "/oracle": > > ensure => directory, > > owner => "oracle", > > group => "dba", > > } > > } else { > > file { "/oracle": > > ensure => "/srv/oracle", > > require => File["/srv/oracle"], > > } > > file { "/srv/oracle": > > ensure => directory, > > mode => "0655", > > owner => "oracle", > > group => "dba", > > } > > } > > > > user { "oracle": > > ensure => present, > > uid => "1001", > > gid => "101", > > shell => "/bin/ksh93", > > home => "/oracle", > > #managehome => "true", > > require => File["/oracle"], > > } > > > > file { "/oracle/.profile": > > ensure => present, > > source => "puppet:///modules/oracle/home/oracle/.profile", > > owner => "oracle", > > group => "dba", > > require => User["oracle"], > > } > > > > group { "dba": > > ensure => present, > > gid => "101", > > } > > > > group { "oracle": > > ensure => present, > > gid => "1001", > > } > > > > # Clumsy workaround for group being unable to manage members. > > exec { "oracle_groups": > > command => "gpasswd -a oracle oracle && gpasswd -a oracle dba", > > unless => "grep ^dba /etc/group | grep -q oracle", > > require => [ User["oracle"], Group["dba"] ], > > } > > > > file { "/etc/oraInst.loc": > > ensure => present, > > owner => "oracle", > > group => "dba", > > content => template("oracle/etc/oraInst.loc.erb"), > > require => [ User["oracle"], Group["dba"] ], > > } > > > > # 5 create /var/opt/oracle directory and change ownership to oracle:dba > > > file { "/var/opt": > > ensure => directory, > > } > > > > file { "/var/opt/oracle": > > ensure => directory, > > owner => "oracle", > > group => "dba", > > require => File["/var/opt"], > > } > > > > file { "/var/opt/oracle/listener.ora": > > ensure => "/etc/listener.ora", > > require => File["/var/opt/oracle"], > > } > > > > file { "/var/opt/oracle/oratab": > > ensure => "/etc/oratab", > > require => File["/var/opt/oracle"], > > } > > > > file { "/var/opt/oracle/tnsnames.ora": > > ensure => "/etc/tnsnames.ora", > > require => File["/var/opt/oracle"], > > } > > > > # Binaries in /usr/local/bin required for path reasons I think. > > file { "/usr/local/bin/coraenv": > > ensure => "/oracle/common/coraenv", > > require => Package["oracle-perimeter"], > > } > > > > file { "/usr/local/bin/oraenv": > > ensure => "/oracle/common/oraenv", > > require => Package["oracle-perimeter"], > > } > > > > file { "/usr/local/bin/dbhome": > > ensure => "/oracle/common/dbhome", > > require => Package["oracle-perimeter"], > > } > > > > package { [ "libaio-devel", "elfutils-libelf-devel", "org-x11-xauth", > "libstdc++-devel" ]: > > ensure => present, > > } > > > > # Set up the required concat stuff for the various files in oracle. > > > > concat{ "/etc/oratab": > > owner => oracle, > > group => oracle, > > mode => 554, > > } > > > > concat{ "/etc/tnsnames.ora": > > owner => oracle, > > group => oracle, > > mode => 554, > > } > > concat{ "/etc/listener.ora": > > owner => oracle, > > group => oracle, > > mode => 554, > > } > > > > concat::fragment{ "oracle_oratab": > > target => "/etc/oratab", > > content => template("oracle/etc/oratab.erb"), > > order => 01, > > } > > > > concat::fragment{ "oracle_tnsnames.ora": > > target => "/etc/tnsnames.ora", > > content => template("oracle/etc/tnsnames.ora.erb"), > > order => 02, > > } > > > > concat::fragment{ "oracle_listener.ora": > > target => "/etc/listener.ora", > > content => template("oracle/etc/listener.ora.erb"), > > order => 02, > > } > > > > define oracle::server::oratab($content="", $order=10) { > > if $content == "" { > > $body = $name > > } else { > > $body = $content > > } > > > > concat::fragment{"oracle_oratab_fragment_$name": > > target => "/etc/oratab", > > content => "$body\n", > > } > > } > > > > define oracle::server::tnsnames($content="", $order=10) { > > if $content == "" { > > $body = $name > > } else { > > $body = $content > > } > > > > concat::fragment{"oracle_tnsnames_fragment_$name": > > target => "/etc/tnsnames.ora", > > content => "$body\n", > > } > > } > > define oracle::server::listener($content="", $order=10) { > > if $content == "" { > > $body = $name > > } else { > > $body = $content > > } > > > > concat::fragment{"oracle_listener_fragment_$name": > > target => "/etc/listener.ora", > > content => "$body\n", > > } > > } > > > > # Other oracle /etc settings > > > > # This fragment has order 3 because there are existing sysctl fragments > in the security module > > concat::fragment{ "oracle_sysctl.conf": > > target => "/etc/sysctl.conf", > > content => template("oracle/etc/sysctl.conf.erb"), > > order => 03, > > } > > > > file { "/etc/security/limits.conf": > > ensure => present, > > source => "puppet:///modules/oracle/etc/security/limits.conf", > > } > > > > # Other directories oracle makes and requires > > file { [ "/tmp/.oracle", "/var/tmp/.oracle" ]: > > ensure => directory, > > mode => "01777", > > owner => "root", > > } > > > > file { "/etc/init.d/oracle": > > ensure => directory, > > mode => "655", > > owner => "root", > > source => "puppet:///modules/oracle/etc/init.d/oracle", > > } > > > > # Actual oracle itself. > > > > package { [ "oracle", "oracle-libs" ]: > > ensure => present, > > #require => [ Mount["/oracle"], Yumrepo["oracle"] ], > > require => [ File["/oracle"], Yumrepo["oracle"] ], > > > > notify => Exec["oracle-fixperms"], > > } > > > > exec { "oracle-fixperms": > > command => "chown -R oracle:dba /oracle", > > refreshonly => true, > > #require => [ User["oracle"], Group["dba"], Mount["/oracle"] ], > > require => [ User["oracle"], Group["dba"] ], > > } > > > > service { "oracle": > > ensure => "running", > > enable => "true", > > require => [ File["/etc/init.d/oracle"], Package["oracle"] ], > > } > > > > } > > This is sort of a hack because the DBAs did some user/database creation so > it's not a totally clean and generic copy of Oracle, but that's because I > was in a rush and didn't have time to go back through the installer and > automate that piece. I also have three concat fragments to populate the > /etc/ oracle stuff for the listeners. This is an example of the kind of > horrors you'll have to go through and hopefully you'll do a vastly better > job than me and share the results so I can do something better than the > terrible thing I did. > > > > Still, it gets Oracle up and running and that's all I needed for now. > > On Sat, Nov 19, 2011 at 4:44 PM, Douglas Garstang <doug.garst...@gmail.com> > wrote: >> >> Ashely, >> >> Not familiar with fpm. What is it? Are you saying you installed >> Oracle, and then use fpm (rpm?) to create a package from the installed >> files? I thought about that... this approach would work if installing >> Oracle meant just installing files, but what if the installer executes >> scripts etc that are machine dependent? >> >> Doug. >> >> On Sat, Nov 19, 2011 at 11:43 AM, Ashley Penney <apen...@gmail.com> wrote: >> > This is not what you want to hear but I ended up installing oracle with >> > the >> > installer and then using "fpm" to bundle the entire thing into (two, >> > because >> > it's too goddamn big) rpms. I had no luck doing the installer via >> > Puppet so >> > I just cheated. >> > >> > On Sat, Nov 19, 2011 at 1:11 PM, Douglas Garstang >> > <doug.garst...@gmail.com> >> > wrote: >> >> >> >> That's what I am already using. >> >> >> >> On Fri, Nov 18, 2011 at 6:33 PM, Mohamed Lrhazi <lrh...@gmail.com> >> >> wrote: >> >> > Maybe you need something like this: >> >> > http://www.oracle-base.com/articles/misc/OuiSilentInstallations.php >> >> > >> >> > >> >> > On Fri, Nov 18, 2011 at 9:23 PM, Douglas Garstang >> >> > <doug.garst...@gmail.com> wrote: >> >> >> This is pretty ugly. >> >> >> >> >> >> I'm using puppet to install Oracle, ie an exec{} wrapped around: >> >> >> >> >> >> /u01/oracle_extract/linux.x64_11gR2_database/database/runInstaller >> >> >> -silent -responseFile /etc/oracle_response.rsp >> >> >> >> >> >> The problem is that the damn installer backgrounds itself and >> >> >> returns >> >> >> control to the shell. I tried putting the above command in a script, >> >> >> followed by a wait command, but that didn't help. Has anyone got any >> >> >> ideas how I can automate the installation of Oracle with puppet? >> >> >> >> >> >> I need to know when the install is finished, because there's >> >> >> additional commands that need to be run by root, as advised by the >> >> >> installer, when it's complete. >> >> >> >> >> >> Doug. >> >> >> >> >> >> -- >> >> >> You received this message because you are subscribed to the Google >> >> >> Groups "Puppet Users" group. >> >> >> To post to this group, send email to puppet-users@googlegroups.com. >> >> >> To unsubscribe from this group, send email to >> >> >> puppet-users+unsubscr...@googlegroups.com. >> >> >> For more options, visit this group at >> >> >> http://groups.google.com/group/puppet-users?hl=en. >> >> >> >> >> >> >> >> > >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups "Puppet Users" group. >> >> > To post to this group, send email to puppet-users@googlegroups.com. >> >> > To unsubscribe from this group, send email to >> >> > puppet-users+unsubscr...@googlegroups.com. >> >> > For more options, visit this group at >> >> > http://groups.google.com/group/puppet-users?hl=en. >> >> > >> >> > >> >> >> >> >> >> >> >> -- >> >> Regards, >> >> >> >> Douglas Garstang >> >> http://www.linkedin.com/in/garstang >> >> Email: doug.garst...@gmail.com >> >> Cell: +1-805-340-5627 >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups >> >> "Puppet Users" group. >> >> To post to this group, send email to puppet-users@googlegroups.com. >> >> To unsubscribe from this group, send email to >> >> puppet-users+unsubscr...@googlegroups.com. >> >> For more options, visit this group at >> >> http://groups.google.com/group/puppet-users?hl=en. >> >> >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Puppet Users" group. >> > To post to this group, send email to puppet-users@googlegroups.com. >> > To unsubscribe from this group, send email to >> > puppet-users+unsubscr...@googlegroups.com. >> > For more options, visit this group at >> > http://groups.google.com/group/puppet-users?hl=en. >> > >> >> >> >> -- >> Regards, >> >> Douglas Garstang >> http://www.linkedin.com/in/garstang >> Email: doug.garst...@gmail.com >> Cell: +1-805-340-5627 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.