Open sureshr7 opened 4 years ago
Looks like using virtual resource solves this problem. I will test and confirm
@oradb::autostartdatabase { 'DEV': oracle_home => '/u01/oracle/product/12.1.0.2/db', db_name => 'DEV', user => 'oracle', service_name => 'DEV', } @oradb::autostartdatabase { 'STG': oracle_home => '/u01/oracle/product/12.1.0.2/dbstage', db_name => 'STG', user => 'oracle', service_name => 'STG', }
Still its failing with same error if i use realize in the class
yep, need to make a tempate Prepareautostart for this, class can only exists once.
Thanks for the quick ack Edwin. Any workarounds to handle this ?
I think I need to make this a define https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/manifests/prepareautostart.pp but maybe you only need to define it once and update oratab to y for the 2nd instance. I think the service will start both.
yes. You are correct. making https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/manifests/prepareautostart.pp as define and removing the class call in https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/manifests/autostartdatabase.pp fixes the problem
Call both resources explicity
oradb::autostartdatabase { $db_name:
oracle_home => $oracle_home,
db_name => $db_name,
user => $user,
service_name => $db_name,
}
oradb::prepareautostart{ $db_name: oracle_home => $oracle_home, user => $user, service_name => $db_name, }
Hi Edwin,
Is it possible to push this fix ?
Thanks Suresh
Hi,
oradb::autostartdatabase { 'DEV': oracle_home => '/u01/oracle/product/12.1.0.2/db', db_name => 'DEV', user => 'oracle', service_name => 'DEV', } oradb::autostartdatabase { 'STG': oracle_home => '/u01/oracle/product/12.1.0.2/dbstage', db_name => 'STG', user => 'oracle', service_name => 'STG', } Using above code on a single server fails with error message
Error while evaluating a Resource Statement, Duplicate declaration: Class[Oradb::Prepareautostart] is already declared at (file: modules/oradb/manifests/autostartdatabase.pp, line: 27); cannot redeclare (file:modules/oradb/manifests/autostartdatabase.pp, line: 27)
Thanks Suresh