biemond / biemond-orawls

Puppet 3/4 module for WebLogic provisioning module ( Linux & Solaris )
Apache License 2.0
63 stars 104 forks source link

Puppet run keeps adding resource adapter (scope lookup issue?) #542

Open ds2000 opened 5 years ago

ds2000 commented 5 years ago

Hi,

I'm hoping you can help. I've got a domain with multiple resource adapters, puppet creates them as per the yaml, yet on the next run puppet says they don't exist and creates them again.

I've added some debugging to the module and narrowed it down to the scope lookups in "resource_adapter_exists.rb", planValue and planEntry - here's my config and logs. We're running on

├── biemond-oradb (v3.0.16)
├── biemond-orautils (v0.5.4)
├── biemond-orawls (v2.0.16)

hiera.yaml

resource_adapter_instances:
  'Kim':
    domain_name:               "%{hiera('domain_name')}"
    weblogic_password:         "%{hiera('wls_weblogic_password')}"
    adminserver_address:       "%{hiera('domain_adminserver_address')}"
    adapter_name:              'DbAdapter'
    adapter_path:              '/opt/weblogic/middleware/soa/soa/connectors/DbAdapter.rar'
    adapter_plan_dir:          "%{hiera('wls_domains_dir')}/%{hiera('domain_name')}/config"
    adapter_plan:              'Plan_DB.xml'
    adapter_entry:             'eis/DB/Kim'
    adapter_entry_property:    'DataSourceName'
    adapter_entry_value:       'jdbc/Kim'
  'KimXA':
    domain_name:               "%{hiera('domain_name')}"
    weblogic_password:         "%{hiera('wls_weblogic_password')}"
    adminserver_address:       "%{hiera('domain_adminserver_address')}"
    adapter_name:              'DbAdapter'
    adapter_path:              '/opt/weblogic/middleware/soa/soa/connectors/DbAdapter.rar'
    adapter_plan_dir:          "%{hiera('wls_domains_dir')}/%{hiera('domain_name')}/config"
    adapter_plan:              'Plan_DB.xml'
    adapter_entry:             'eis/DB/KimXA'
    adapter_entry_property:    'XADataSourceName'
    adapter_entry_value:       'jdbc/KimXA'

resource_adapter_exists.rb (with my added debug messages)

          if domain == full_domain_path

            case wls_type
            when 'resource'
              adapter = adapter_name.downcase
              plan = adapter_entry.downcase
              log "DSDEBUG: adapter - " + adapter 
              log "DSDEBUG: plan - " + plan               
              planValue =  scope['facts'][prefix + '_' + n.to_s + '_eis_' + adapter + '_plan']
              log "DSDEBUG: planValue - " + planValue              
              unless planValue == 'NotFound'
                log "#{adapter_name} resource #{planValue} compare with #{plan}"
                return true if planValue.strip.downcase == plan
              end

            when 'resource_entry'
              adapter = adapter_name.downcase
              entry = adapter_entry.strip
              log "DSDEBUG: adapter - " + adapter               
              log "DSDEBUG: entry - " + entry
              planEntries = scope['facts'][prefix + '_' + n.to_s + '_eis_' + adapter + '_entries']
              log "DSDEBUG: planEntries - " + planEntries                           
              unless planEntries == 'NotFound'
                log "#{adapter_name} resource_entry #{planEntries} compare with #{entry}"
                return true if planEntries.include? entry
              end
            end

Puppet Server log:

2018-09-26 14:47:55,343 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter resource_entry  compare with eis/DB/Kim
2018-09-26 14:47:55,343 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter end of function return false
2018-09-26 14:47:55,374 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDebug: full_domain_path /opt/weblogic/user_projects/domains/orl_domain
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDebug: wls_type resource
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDebug: adapter_name DbAdapter
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDebug: adapter_entry /opt/weblogic/user_projects/domains/orl_domain/config/Plan_DB.xml
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDebug: prefix ora_mdw_domain
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter total domains 1
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter compare /opt/weblogic/user_projects/domains/orl_domain with /opt/weblogic/user_projects/domains/orl_domain
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDEBUG: adapter - dbadapter
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDEBUG: plan - /opt/weblogic/user_projects/domains/orl_domain/config/plan_db.xml
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDEBUG: planValue - config/Plan_DB.xml
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter resource config/Plan_DB.xml compare with /opt/weblogic/user_projects/domains/orl_domain/config/plan_db.xml
2018-09-26 14:47:55,375 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter end of function return false

and

2018-09-26 14:47:55,426 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter compare /opt/weblogic/user_projects/domains/orl_domain with /opt/weblogic/user_projects/domains/orl_domain
2018-09-26 14:47:55,426 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDEBUG: adapter - dbadapter
2018-09-26 14:47:55,426 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDEBUG: entry - eis/DB/OrlandoXA
2018-09-26 14:47:55,426 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DSDEBUG: planEntries -
2018-09-26 14:47:55,426 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter resource_entry  compare with eis/DB/OrlandoXA
2018-09-26 14:47:55,426 INFO  [qtp756298365-6723] [puppetserver] orawls::resource_adapter_exists DbAdapter end of function return false
2018-09-26 14:48:09,939 INFO  [qtp756298365-6755] [puppetserver] orawls::resource_adapter_exists DbAdapter total domains 1

I can see a prefix at the top of the file specifying a domain name but I assume this is something to do with the module?

If I hard code planValue with the plan_db.xml's full path the module returns true, so I can only think that the scope isn't getting created properly. Do I need to update to the latest module?

Thanks

Dave

ds2000 commented 5 years ago

Just to update, I've added more debugging and believe I have found the issue

Debugging the scope I can see puppet is creating the value as:

  "ora_mdw_domain_0_eis_dbadapter_plan"=>"config/Plan_DB.xml"

I have double checked our hiera and I can't see where we are adding the leading "config/".
Adding more debugging to the module as below:

              log "DSDEBUG: What are we matching? planValue.strip.downcase = " + planValue.strip.downcase
              unless planValue == 'NotFound'
                log "#{adapter_name} resource #{planValue} compare with #{plan}"
                return true if planValue.strip.downcase == plan
              end

My statement returns:

DSDEBUG: What are we matching? planValue.strip.downcase = config/plan_db.xml

We can see the module is trying to match on just == plan. It looks as thought the strip doesn't work.

I can fix this by changing the statement to:

return true if "plan" in planValue.strip.downcase

But of course I would like your suggestions first. I don't want our module to go out of sync with the releases. Thanks again.

biemond commented 5 years ago

Thanks , I thinks the generating of facts is not working properly. So in orawls.rb the analyse of the domain went wrong and the resource facts are not set. Or it can be some ruby issue.

Because I don’t have your domain can you check if orawls.rb is not crashing ( this happens in the beginning of the run) and what are all the facts.

biemond commented 5 years ago

Best way is to have a new vm with only a domain and these resource adapters , I think 1 of the other wls artifacts are failing to detect on the domain and then the resource adapter facts are not set.

ds2000 commented 5 years ago

Thanks Edwin, I'll turn some extra debugging on the puppet run and see if I can spot any orawls.rb errors.
I'm working from a branch so I can also remove all other features from the domain and start rolling them back in one at a time. Thanks for the quick reply.

ds2000 commented 5 years ago

I've disabled most other things in the domain but sadly no change. I searched for orawls.rb errors but couldn't see any either.

The full ora_mdw facts resolve as follows:

Debug: Facter: fact "opatch_patches" has resolved to {
  /opt/weblogic/middleware => []
}.
Debug: Facter: fact "opco" has resolved to "nl".
Debug: Facter: fact "ora_inst_loc_data" has resolved to "/opt/weblogic/oraInventory".
Debug: Facter: fact "ora_inst_products" has resolved to "/opt/weblogic/middleware;".
Debug: Facter: fact "ora_mdw_0" has resolved to "/opt/weblogic/middleware".
Debug: Facter: fact "ora_mdw_cnt" has resolved to 1.
Debug: Facter: fact "ora_mdw_domain_0" has resolved to "/opt/weblogic/user_projects/domains/orl_domain".
Debug: Facter: fact "ora_mdw_domain_0_bam" has resolved to "NotFound".
Debug: Facter: fact "ora_mdw_domain_0_bpm" has resolved to "NotFound".
Debug: Facter: fact "ora_mdw_domain_0_clusters" has resolved to "wlsCluster;".
Debug: Facter: fact "ora_mdw_domain_0_coherence_clusters" has resolved to "defaultCoherenceCluster;".
Debug: Facter: fact "ora_mdw_domain_0_deployments" has resolved to "wsm-pm;em;usermessagingserver;usermessagingdriver-apns;usermessagingdriver-email;usermessagingdriver-extension;usermessagingdriver-gcm;usermessagingdriver-smpp;usermessagingdriver-twitter;usermessagingdriver-xmpp;Cloudsdk;soa-webapps;soa-infra;worklistapp;b2bui;DefaultToDoTaskFlow;ESSAPP;EssNativeHostingApp#V1.0;".
Debug: Facter: fact "ora_mdw_domain_0_eis_aqadapter_entries" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_aqadapter_plan" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_dbadapter_entries" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_dbadapter_plan" has resolved to "config/Plan_DB.xml".
Debug: Facter: fact "ora_mdw_domain_0_eis_fileadapter_entries" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_fileadapter_plan" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_ftpadapter_entries" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_ftpadapter_plan" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_jmsadapter_entries" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_jmsadapter_plan" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_mqseriesadapter_entries" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_mqseriesadapter_plan" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_filestores" has resolved to "mds-owsm;mds-soa;mds-ESS_MDS_DS;BPMJMSFileStore_auto_1;SOAJMSFileStore_auto_1;UMSJMSFileStore_auto_1;".
Debug: Facter: fact "ora_mdw_domain_0_jdbc" has resolved to "WLSSchemaDataSource;LocalSvcTblDataSource;opss-data-source;opss-audit-viewDS;opss-audit-DBDS;mds-owsm;OraSDPMDataSource;SOADataSource;EDNDataSource;EDNLocalTxDataSource;SOALocalTxDataSource;mds-soa;mds-ESS_MDS_DS;EssDS;EssXADS;EssInternalDS;KimXA;Kim;OrlandoXA;Orlando;".
Debug: Facter: fact "ora_mdw_domain_0_jdbcstores" has resolved to "SOAJMSJDBCStore;BPMJMSJDBCStore;UMSJMSJDBCStore;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_0_foreign_servers" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_0_name" has resolved to "UMSJMSSystemResource".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_0_objects" has resolved to "OraSDPMQueueConnectionFactory;OraSDPMEngineSndQ1_soa;OraSDPMEngineRcvQ1_soa;OraSDPMDriverDefSndQ1_soa;OraSDPMAppDefRcvErrorQ1_soa;OraSDPMAppDefRcvQ1_soa;OraSDPMWSRcvQ1_soa;OraSDPMEnginePendingRcvQ_soa;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_0_quotas" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_0_subdeployments" has resolved to "UMSJMSSubDMSOA;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_1_foreign_server_umsaqjmsforeignserver_objects" has resolved to "OraSDPM/Queues/OraSDPMAppDefRcvQ1;OraSDPM/Queues/OraSDPMAppDefRcvErrorQ1;OraSDPM/Queues/OraSDPMDriverDefSndQ1;OraSDPM/Queues/OraSDPMEngineRcvQ1;OraSDPM/Queues/OraSDPMEngineSndQ1;OraSDPM/Queues/OraSDPMEnginePendingRcvQ;OraSDPM/QueueConnectionFactory;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_1_foreign_servers" has resolved to "UMSAQJMSForeignServer;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_1_name" has resolved to "UMSAQJMSSystemResource".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_1_objects" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_1_quotas" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_1_subdeployments" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_2_foreign_servers" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_2_name" has resolved to "BPMJMSModule".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_2_objects" has resolved to "CubeCommandXAConnectionFactory;MeasurementTopicConnectionFactory;BeamActionXAConnectionFactory;BAMCommandXAConnectionFactory;PeopleQueryTopicConnectionFactory;PeopleQueryConnectionFactory;dist_MeasurementTopic_auto;dist_PeopleQueryTopic_auto;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_2_quotas" has resolved to "MeasurementQuota;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_2_subdeployments" has resolved to "BPMJMSServer1934982182;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_3_foreign_server_ednaqjmsforeignserver_objects" has resolved to "EDNAQjmsTopic;EDNAQjmsXATopicConnectionFactory;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_3_foreign_server_ednaqjmslocaltxforeignserver_objects" has resolved to "EDNAQjmsTopicLocalTxConnectionFactory;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_3_foreign_servers" has resolved to "EDNAQjmsLocalTxForeignServer;EDNAQjmsForeignServer;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_3_name" has resolved to "SOAJMSModule".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_3_objects" has resolved to "B2BEventQueueConnectionFactory;B2BQueueConnectionFactory;B2BBroadcastTopicConnectionFactory;TransportDispatcherQueueConnectionFactory;NotificationSenderQueueConnectionFactory;TestFwkQueueFactory;EDNConnectionFactory;XAEDNConnectionFactory;XmlSchemaChangeNotificationConnectionFactory;TenantTopicConnectionFactory;CaseEventConnectionFactory;HCEventConnectionFactory;dist_TestFwkQueue_auto;dist_NotificationSenderQueue_auto;dist_B2BEventQueue_auto;dist_TransportDispatcherQueue_auto;dist_B2B_IN_QUEUE_auto;dist_B2B_OUT_QUEUE_auto;dist_EDNQueue_auto;dist_CaseEventQueue_auto;dist_HCInboundQueue_auto;dist_HCOutboundQueue_auto;dist_HCAuditQueue_auto;dist_B2BBroadcastTopic_auto;dist_EDNTopic_auto;dist_TenantTopic_auto;dist_XmlSchemaChangeNotificationTopic_auto;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_3_quotas" has resolved to "EDNQuota;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_3_subdeployments" has resolved to "SOAJMSServer506992590;".
Debug: Facter: fact "ora_mdw_domain_0_jmsmodule_cnt" has resolved to 4.
Debug: Facter: fact "ora_mdw_domain_0_jmsmodules" has resolved to "UMSJMSSystemResource;UMSAQJMSSystemResource;BPMJMSModule;SOAJMSModule;".
Debug: Facter: fact "ora_mdw_domain_0_jmsservers" has resolved to "BPMJMSServer_auto_1;SOAJMSServer_auto_1;UMSJMSServer_auto_1;".
Debug: Facter: fact "ora_mdw_domain_0_jrf" has resolved to "wlsCluster,AdminServer".
Debug: Facter: fact "ora_mdw_domain_0_libraries" has resolved to "oracle.applcore.model#1.0@0.1;oracle.applcore.view#1.0@0.1;oracle.applcore.config#1.0@0.1;oracle.wsm.idmrest.sharedlib#1.0@12.2.1.3;oracle.wsm.seedpolicies#2.0@12.2.1.3;oracle.sdp.client#2.0@12.2.1.3.0;oracle.pwdgen#2.0@12.2.1;owasp.esapi#2.0@12.2.1;oracle.adf.dconfigbeans#1.0@12.2.1.3.0;adf.oracle.domain#1.0@12.2.1.3.0;adf.oracle.businesseditor#1.0@12.2.1.3.0;oracle.adf.management#1.0@12.2.1.3.0;adf.oracle.domain.webapp#1.0@12.2.1.3.0;jsf#2.0@1.0.0.0_2-2-8;jstl#1.2@1.2.0.1;UIX#11@12.2.1.3.0;ohw-rcf#5@12.2.1.3.0;ohw-uix#5@12.2.1.3.0;oracle.adf.desktopintegration.model#1.0@12.2.1.3.0;oracle.adf.desktopintegration#1.0@12.2.1.3.0;oracle.bi.jbips#11.1.1@0.1;oracle.bi.composer#11.1.1@0.1;oracle.bi.adf.model.slib#1.0@12.2.1.3.0;oracle.bi.adf.view.slib#1.0@12.2.1.3.0;oracle.bi.adf.webcenter.slib#1.0@12.2.1.3.0;adf.oracle.domain.groovy#1.0@12.2.1.3.0;adf.oracle.domain.webapp.antlr-runtime#1.0@12.2.1.3.0;adf.oracle.domain.webapp.guava#1.0@12.2.1.3.0;adf.oracle.domain.webapp.xml-apis-ext#1.0@12.2.1.3.0;adf.oracle.domain.webapp.apache.velocity#1.0@12.2.1.3.0;adf.oracle.domain.webapp.apache.httpclient#1.0@12.2.1.3.0;adf.oracle.domain.webapp.apache.httpclient-cache#1.0@12.2.1.3.0;adf.oracle.domain.webapp.apache.httpcore#1.0@12.2.1.3.0;adf.oracle.domain.webapp.apache.httpmime#1.0@12.2.1.3.0;adf.oracle.domain.webapp.batik-bundle#1.0@12.2.1.3.0;odl.clickhistory#1.0@12.2.1;odl.clickhistory.webapp#1.0@12.2.1;oracle.jrf.system.filter;oracle.jsp.next#12.2.1@12.2.1;oracle.dconfig-infra#2.0@12.2.1;orai18n-adf#11@11.1.1.1.0;oracle.webcenter.skin#2.0@12.2.1;oracle.webcenter.composer#2.0@12.2.1;oracle.wsm.console.core.view#1.0@12.2.1.3;oracle.soa.workflow.wc#11.1.1@12.1.2;oracle.soa.worklist.webapp#11.1.1@11.1.1;emcore;emas;oracle.sdp.messaging#2.0@12.2.1.3.0;oracle.ucs.userprefs.webapp#2.0@12.2.1.3.0;log4j_jar#1.3@1.2.15;emcore_jar;emagentsdk_jar#12.4@12.1.0.4.0;emagentsdkimpl_jar#12.4@12.1.0.4.0;emagentsdkimplpriv_jar#12.4@12.1.0.4.0;em_error#12.4@12.1.0.4.0;em_common#12.4@12.1.0.4.0;emcoresdk_jar#11.2.0.1.0@12.1.0.0.0;emcoreintsdk_jar#11.2.0.1.0@12.1.0.0.0;emcoresdkimpl_jar#11.2.0.1.0@12.1.0.0.0;emcorecommon_jar;emcoreconsole_jar;emcorepbs_jar;emcoreclient_jar;em_sdkcore_ppc_public_pojo_jar;em_core_ppc_pojo_jar;oracle.soa.management.webapp#12.1.2@12.1.2;oracle.bpm.management.webapp#12.1.3@12.1.3;soa.em;emai.fmwctrl.dep;oracle.rules#11.1.1@12.1.3;oracle.ess.thin.client#12@12.2.1.3.0;oracle.soa.common.dvmxref#12.1.1@12.1.2;oracle.soa.common.resequencer#12.1.1@12.1.2;oracle.adapter.ext#12.1.2@12.1.2;oracle.soa.commonconsole.webapp#12.1.2@12.1.2;oracle.soa.commonconsole.dependencies#12.1.2@12.1.2;oracle.cloud.adapter#12.1.2@12.1.2;oracle.soa.common.functions#12.2.1@12.1.2;oracle.soa.rules_dict_dc.webapp#11.1.1@11.1.1;oracle.soa.worklist#11.1.1@12.1.2;oracle.soa.bpel#11.1.1@12.1.2;oracle.soa.workflow#11.1.1@12.1.2;oracle.soa.mediator#11.1.1@12.1.2;oracle.soa.webmapper#11.1.1@12.1.2;oracle.soa.composer.webapp#11.1.1@12.1.2;oracle.soa.ext#11.1.1@12.1.2;oracle.soa.apps#11.1.1@12.1.2;oracle.soa.xquery#11.1.1@12.1.2;oracle.soa.common.sequencing#11.1.1@12.1.2;oracle.ess.client.api#12@12.2.1.3.0;oracle.ess.client#12@12.2.1.3.0;oracle.ess.runtime#12@12.2.1.3.0;oracle.ess#12@12.2.1.3.0;oracle.soa.ess.dc#12@12.2.1.0.0;oracle.ess.admin#12@12.2.1.3.0;ess.em;emai.ess.fmwctrl.dep;".
Debug: Facter: fact "ora_mdw_domain_0_machines" has resolved to "LocalMachine;nmAdmin;myserverwls002;myserverwls004;".
Debug: Facter: fact "ora_mdw_domain_0_name" has resolved to "orl_domain".
Debug: Facter: fact "ora_mdw_domain_0_oim_configured" has resolved to "false".
Debug: Facter: fact "ora_mdw_domain_0_osb" has resolved to "NotFound".
Debug: Facter: fact "ora_mdw_domain_0_safagents" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_server_0" has resolved to "AdminServer".
Debug: Facter: fact "ora_mdw_domain_0_server_0_machine" has resolved to "LocalMachine".
Debug: Facter: fact "ora_mdw_domain_0_server_1" has resolved to "myserverwls002".
Debug: Facter: fact "ora_mdw_domain_0_server_1_machine" has resolved to "myserverwls002".
Debug: Facter: fact "ora_mdw_domain_0_server_1_port" has resolved to "7003".
Debug: Facter: fact "ora_mdw_domain_0_server_2" has resolved to "myserverwls004".
Debug: Facter: fact "ora_mdw_domain_0_server_2_machine" has resolved to "myserverwls004".
Debug: Facter: fact "ora_mdw_domain_0_server_2_port" has resolved to "7003".
Debug: Facter: fact "ora_mdw_domain_0_server_3" has resolved to "MS0".
Debug: Facter: fact "ora_mdw_domain_0_server_3_machine" has resolved to "nmAdmin".
Debug: Facter: fact "ora_mdw_domain_0_server_3_port" has resolved to "7003".
Debug: Facter: fact "ora_mdw_domain_0_server_templates" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_servers" has resolved to "AdminServer;myserverwls002;myserverwls004;MS0;".
Debug: Facter: fact "ora_mdw_domain_0_soa" has resolved to "wlsCluster".
Debug: Facter: fact "ora_mdw_domain_cnt" has resolved to 1.
Debug: Facter: fact "ora_mdw_homes" has resolved to "/opt/weblogic/middleware;".
Debug: Facter: fact "oradb_inst_loc_data" has resolved to "/opt/weblogic/oraInventory".
Debug: Facter: fact "oradb_inst_opatch_opt_weblogic_middleware" has resolved to "13.9.2.0.0".
Debug: Facter: fact "oradb_inst_products" has resolved to "/opt/weblogic/middleware;".
ds2000 commented 5 years ago

The plot is thickening but not in a good way. Hiera is 100% getting parsed. On the client

 ****** DAVID DEBUG ****** : 
domainDir = /opt/weblogic/user_projects/domains/orl_domain, 
adapter_name = DbAdapter, 
adapter_plan_dir = /opt/weblogic/user_projects/domains/orl_domain, 
adapter_plan = Plan_DB.xml

Hiera

    adapter_name:             'DbAdapter'
    adapter_path:              "/opt/weblogic/middleware/soa/soa/connectors/DbAdapter.rar"
    adapter_plan_dir:         "/opt/weblogic/user_projects/domains/orl_domain"
    adapter_plan:              'Plan_DB.xml'

Debug statement in orawls.rb (note the leading config/ )

Debug: db config//opt/weblogic/user_projects/domains/orl_domain/Plan_DB.xml

Facts being set by puppet:

Debug: Facter: fact "ora_mdw_domain_0_eis_dbadapter_plan" has resolved to "config//opt/weblogic/user_projects/domains/orl_domain/Plan_DB.xml".

Interestingly if I try and set an adapter_plan_dir ending on config. i.e.

    adapter_plan_dir:         "/opt/weblogic/user_projects/domains/orl_domain/config"

The fact gets set as:

Debug: Facter: fact "ora_mdw_domain_0_eis_dbadapter_plan" has resolved to "config
biemond commented 5 years ago

it is the same I have. I will do some tests myself

so it cannot find the entries because the plan is not updated, or resource adapter reload went wrong. Can you make the changes, check the domain.xml and maybe restart the adminserver.

Debug: Facter: fact "ora_mdw_domain_0_eis_dbadapter_entries" has resolved to "".
Debug: Facter: fact "ora_mdw_domain_0_eis_dbadapter_plan" has resolved to "config/Plan_DB.xml".

In the domain xml there should be a reference to this plan. it should be updated to yours and reload the resource adapter.

  dbAdapterPlan = ''
  dbAdapterPlanEntries = ''
  root.elements.each("app-deployment[name = 'DbAdapter']") do |apps|
    unless apps.elements['plan-path'].nil?
      unless apps.elements['plan-dir'].attributes['xsi:nil'] == 'true'
        dbAdapterPlan += apps.elements['plan-dir'].text + '/' + apps.elements['plan-path'].text
      else
        dbAdapterPlan += apps.elements['plan-path'].text
      end
      Puppet.debug "db #{dbAdapterPlan}"
      if FileTest.exists?(dbAdapterPlan)

        subfile = File.read(dbAdapterPlan)
        subdoc = REXML::Document.new subfile

        planroot = subdoc.root
        planroot.elements['variable-definition'].elements.each('variable') do |eis|
          entry = eis.elements['value'].text
          if entry != nil and entry.include? 'eis'
            dbAdapterPlanEntries +=  eis.elements['value'].text + ';'
          end
        end
      end

    end
  end

  Facter.add("#{prefix}_domain_#{n}_eis_dbadapter_plan") do
    setcode do
      dbAdapterPlan
    end
  end

  Facter.add("#{prefix}_domain_#{n}_eis_dbadapter_entries") do
    setcode do
      dbAdapterPlanEntries
    end
  end

my config

  'DbAdapter_hr':
    adapter_name:              'DbAdapter'
    adapter_path:              "/opt/oracle/middleware12c/soa/soa/connectors/DbAdapter.rar"
    adapter_plan_dir:          "/opt/oracle/middleware12c"
    adapter_plan:              'Plan_DB.xml'
    adapter_entry:             'eis/DB/hr'
    adapter_entry_property:    'XADataSourceName'
    adapter_entry_value:       'jdbc/hrDS'
    domain_name:                *domain_name
    weblogic_password:          *domain_wls_password                 
    adminserver_address:        *domain_adminserver_address
  'DbAdapter_hr2':
    adapter_name:              'DbAdapter'
    adapter_path:              "/opt/oracle/middleware12c/soa/soa/connectors/DbAdapter.rar"
    adapter_plan_dir:          "/opt/oracle/middleware12c"
    adapter_plan:              'Plan_DB.xml'
    adapter_entry:             'eis/DB/hr2'
    adapter_entry_property:    'xADataSourceName'
    adapter_entry_value:       'jdbc/hrDS2'
    log_output:                *logoutput
    domain_name:                *domain_name
    weblogic_password:          *domain_wls_password                 
    adminserver_address:        *domain_adminserver_address
ds2000 commented 5 years ago

Hi Edwin, We've found the issue, it seems we cannot put the plan.xml into the domain_home directory. I've moved it to the middleware home and it works....

My colleague put it in domain_home so that it gets zipped up and distributed as part of the domain creation. I'll change the location and rebuild these AWS instances to see it the application works as expected or if the plan.xml does indeed need shipping.

Thanks again

biemond commented 5 years ago

ah ok. I forget that part I guess.

yeah you need to put it on a shared storage ( or some rsync step) and on all vm the plan path should be the same. with jms and xa they have now DB support but not yet for resource adapters (I think )

ds2000 commented 5 years ago

We're not quite at the shared storage point yet (next 6 month maybe) but I can write a quick shipper and store it in s3 and then get the managed servers to download it from there. That way puppet can manage the file state and only update the file when it's edited.

Thanks again for the quick replies. If anything I've learnt a good deal more about the module.

Dave