On Fri, Nov 02, 2012 at 07:23:54AM -0700, Gavin Williams wrote:
> Afternoon all... 
> 
> I've started looking at coding this into our framework now, and have hit a 
> possible stumbling block... 
> 
> Currently, I've got a fact that reads out the configured Oracle SIDs in 
> /etc/oratab and sticks that into an 'oracle_sids' fact. 
> I've also got a Property (oracle_required_sids) against the host in Foreman 
> which contains a comma separated lists of SIDs that *should* be configured 
> on the host. 
> 
> What I want to do is compare those 2 lists, and action any changes... So if 
> there's a SID in the oracle_required_sids var that isn't in oracle_sids, 
> then it should be created. If there's a SID in the oracle_sids var that 
> isnt in oracle_required_sids, then it should be removed... 
> I've established that Looping isn't something that Puppet currently 
> handles, so I'm looking for an alternative method... 
> 
> Any ideas??? 
> 
> Cheers
> Gavin 

You can use the oratab type from https://github.com/stschulte/puppet-oracle
to describe the entries you do want (this assumes every instance has the same
ORACLE_HOME):

    $instances = split($oracle_required_sids, ',')
    oratab { $instances:
      ensure => present,
      home   => '/u01/app/oracle/product/10.1.0/db_1',
      atboot => yes,
    }

This will make sure the instances are present in the oratab file. This
will not remove unmanaged entries. But you can use the resources type do
that:

    resources { 'oratab':
      purge => true
    }

You don't even need your oracle_sids fact that way.

-Stefan

-- 
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.

Reply via email to