Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ds2000 opened this issue Sep 26, 2018 · 10 comments
Open

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

ds2000 opened this issue Sep 26, 2018 · 10 comments

Comments

@ds2000
Copy link

ds2000 commented Sep 26, 2018

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
Copy link
Author

ds2000 commented Sep 28, 2018

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
Copy link
Owner

biemond commented Sep 28, 2018

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
Copy link
Owner

biemond commented Sep 28, 2018

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
Copy link
Author

ds2000 commented Sep 28, 2018

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
Copy link
Author

ds2000 commented Sep 28, 2018

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#[email protected];oracle.applcore.view#[email protected];oracle.applcore.config#[email protected];oracle.wsm.idmrest.sharedlib#[email protected];oracle.wsm.seedpolicies#[email protected];oracle.sdp.client#[email protected];oracle.pwdgen#[email protected];owasp.esapi#[email protected];oracle.adf.dconfigbeans#[email protected];adf.oracle.domain#[email protected];adf.oracle.businesseditor#[email protected];oracle.adf.management#[email protected];adf.oracle.domain.webapp#[email protected];jsf#[email protected]_2-2-8;jstl#[email protected];UIX#[email protected];ohw-rcf#[email protected];ohw-uix#[email protected];oracle.adf.desktopintegration.model#[email protected];oracle.adf.desktopintegration#[email protected];oracle.bi.jbips#[email protected];oracle.bi.composer#[email protected];oracle.bi.adf.model.slib#[email protected];oracle.bi.adf.view.slib#[email protected];oracle.bi.adf.webcenter.slib#[email protected];adf.oracle.domain.groovy#[email protected];adf.oracle.domain.webapp.antlr-runtime#[email protected];adf.oracle.domain.webapp.guava#[email protected];adf.oracle.domain.webapp.xml-apis-ext#[email protected];adf.oracle.domain.webapp.apache.velocity#[email protected];adf.oracle.domain.webapp.apache.httpclient#[email protected];adf.oracle.domain.webapp.apache.httpclient-cache#[email protected];adf.oracle.domain.webapp.apache.httpcore#[email protected];adf.oracle.domain.webapp.apache.httpmime#[email protected];adf.oracle.domain.webapp.batik-bundle#[email protected];odl.clickhistory#[email protected];odl.clickhistory.webapp#[email protected];oracle.jrf.system.filter;oracle.jsp.next#[email protected];oracle.dconfig-infra#[email protected];orai18n-adf#[email protected];oracle.webcenter.skin#[email protected];oracle.webcenter.composer#[email protected];oracle.wsm.console.core.view#[email protected];oracle.soa.workflow.wc#[email protected];oracle.soa.worklist.webapp#[email protected];emcore;emas;oracle.sdp.messaging#[email protected];oracle.ucs.userprefs.webapp#[email protected];log4j_jar#[email protected];emcore_jar;emagentsdk_jar#[email protected];emagentsdkimpl_jar#[email protected];emagentsdkimplpriv_jar#[email protected];em_error#[email protected];em_common#[email protected];emcoresdk_jar#[email protected];emcoreintsdk_jar#[email protected];emcoresdkimpl_jar#[email protected];emcorecommon_jar;emcoreconsole_jar;emcorepbs_jar;emcoreclient_jar;em_sdkcore_ppc_public_pojo_jar;em_core_ppc_pojo_jar;oracle.soa.management.webapp#[email protected];oracle.bpm.management.webapp#[email protected];soa.em;emai.fmwctrl.dep;oracle.rules#[email protected];oracle.ess.thin.client#[email protected];oracle.soa.common.dvmxref#[email protected];oracle.soa.common.resequencer#[email protected];oracle.adapter.ext#[email protected];oracle.soa.commonconsole.webapp#[email protected];oracle.soa.commonconsole.dependencies#[email protected];oracle.cloud.adapter#[email protected];oracle.soa.common.functions#[email protected];oracle.soa.rules_dict_dc.webapp#[email protected];oracle.soa.worklist#[email protected];oracle.soa.bpel#[email protected];oracle.soa.workflow#[email protected];oracle.soa.mediator#[email protected];oracle.soa.webmapper#[email protected];oracle.soa.composer.webapp#[email protected];oracle.soa.ext#[email protected];oracle.soa.apps#[email protected];oracle.soa.xquery#[email protected];oracle.soa.common.sequencing#[email protected];oracle.ess.client.api#[email protected];oracle.ess.client#[email protected];oracle.ess.runtime#[email protected];oracle.ess#[email protected];oracle.soa.ess.dc#[email protected];oracle.ess.admin#[email protected];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
Copy link
Author

ds2000 commented Oct 1, 2018

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

@ds2000 ds2000 closed this as completed Oct 1, 2018
@ds2000 ds2000 reopened this Oct 1, 2018
@biemond
Copy link
Owner

biemond commented Oct 1, 2018

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
Copy link
Author

ds2000 commented Oct 1, 2018

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
Copy link
Owner

biemond commented Oct 1, 2018

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
Copy link
Author

ds2000 commented Oct 1, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants