Re: Execution order of classes in a node

213 views
Skip to first unread message

jcbollinger

unread,
May 24, 2013, 10:06:23 AM5/24/13
to puppet...@googlegroups.com


On Thursday, May 23, 2013 1:45:55 PM UTC-5, Bikram Agarwal wrote:
Hi.

I have three modules in my puppet/modules - 
  1. jdk_installer
  2. weblogic_installer
  3. wldomain_create
Each of them have one class (same names as modules).

I have a node in site.pp which calls these 3 classes. And these classes need to be executed in a particular order. This is what I have in site.pp - 

$config = hiera('domaincreation')
class{'jdk_installer':
 }
class{'weblogic_installer':
   require => Class["jdk_installer"],
}
class{'wldomain_create':
   require => Class["weblogic_installer"],
}
}

Execution order that I am trying to implement is first - jdk_installer followed by weblogic_installer and ending at wldomain_create.

When I run the puppet agent --verbose --test from the agent node, in the output it even looks like it is executing in the correct order. But towards the end, when it is running the wldomain_create class, it errors out saying the domain is already created; as if this class was already ran. Here's the last part of the output - 

notice: /Stage[main]/Weblogic_installer/Exec[Delete Existing jar]/returns: executed successfully
notice: /Stage[main]/Weblogic_installer/File[Copy_weblogic_jar]/ensure: defined content as '{md5}33d45745ff0510381de84427a7536f65'
notice: /Stage[main]/Weblogic_installer/File[Copy_silent_xml]/ensure: defined content as '{md5}e71e523800541d4cfa6d60a1da0f4e2a'
notice: /Stage[main]/Weblogic_installer/Exec[install_wls]/returns: Extracting 0%....................................................................................................100%
notice: /Stage[main]/Weblogic_installer/Exec[install_wls]/returns: executed successfully
notice: /Stage[main]/Wldomain_create/File[Copy domaincreate script]/ensure: defined content as '{md5}9eb3f3645f8fb3be20af4f64116a9861'
info: /Stage[main]/Wldomain_create/File[Copy domaincreate script]: Scheduling refresh of Exec[Execute domain create script]
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: CLASSPATH=/opt/oracle/middleware/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/jdk/lib/tools.jar:/opt/oracle/middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/oracle/middleware/modules/features/weblogic.server.modules_10.3.6.0.jar:/opt/oracle/middleware/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/oracle/middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/opt/oracle/middleware/utils/config/10.3/config-launch.jar::/opt/oracle/middleware/wlserver_10.3/common/derby/lib/derbynet.jar:/opt/oracle/middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/opt/oracle/middleware/wlserver_10.3/common/derby/lib/derbytools.jar::
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Initializing WebLogic Scripting Tool (WLST) ...
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Welcome to WebLogic Server Administration Scripting Shell
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Type help() for help on available commands
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Length of args:  8 ['create_domain.py', '/opt/oracle/user_projects/domains/domaincreation', '8901', '8902', 'managed_test', '8903', '8904', 'weblogic1']
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Error: Current path is invalid for creation. cd() to its parent first.
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Domain Created Successfully!
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: executed successfully
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: CLASSPATH=/opt/oracle/middleware/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/jdk/lib/tools.jar:/opt/oracle/middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/oracle/middleware/modules/features/weblogic.server.modules_10.3.6.0.jar:/opt/oracle/middleware/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/oracle/middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/opt/oracle/middleware/utils/config/10.3/config-launch.jar::/opt/oracle/middleware/wlserver_10.3/common/derby/lib/derbynet.jar:/opt/oracle/middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/opt/oracle/middleware/wlserver_10.3/common/derby/lib/derbytools.jar::
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Initializing WebLogic Scripting Tool (WLST) ...
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Welcome to WebLogic Server Administration Scripting Shell
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Type help() for help on available commands
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Length of args:  8 ['create_domain.py', '/opt/oracle/user_projects/domains/domaincreation', '8901', '8902', 'managed_test', '8903', '8904', 'weblogic1']
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Error: writeDomain() failed. Do dumpStack() to see details.
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: Problem invoking WLST - Traceback (innermost last):
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:   File "/opt/oracle/middleware/wlserver_10.3/common/bin/create_domain.py", line 45, in ?
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:   File "/tmp/WLSTOfflineIni2948488573983965516.py", line 71, in writeDomain
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:        at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:51)
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:        at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:1538)
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:        at com.oracle.cie.domain.script.jython.WLScriptContext.writeDomain(WLScriptContext.java:803)
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:        at java.lang.reflect.Method.invoke(Method.java:601)
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns:
notice: /Stage[main]/Wldomain_create/Exec[Execute domain create script]/returns: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: A domain with an identical name exists at the location you have selected.  Change the domain name or location.
err: /Stage[main]/Wldomain_create/Exec[Execute domain create script]: Failed to call refresh: sh /opt/oracle/middleware/wlserver_10.3/common/bin/wlst.sh create_domain.py /opt/oracle/user_projects/domains/domaincreation 8901 8902 managed_test 8903 8904 weblogic1 returned 1 instead of one of [0] at /etc/puppetlabs/puppet/modules/wldomain_create/manifests/init.pp:63
notice: /Stage[main]/Wldomain_create/File[Copy server script]/ensure: defined content as '{md5}bd373cdcf6cd24a059705b6bf7f125b4'
info: /Stage[main]/Wldomain_create/File[Copy server script]: Scheduling refresh of Exec[create server startup script]
notice: /Stage[main]/Wldomain_create/Exec[create server startup script]/returns: executed successfully
notice: /Stage[main]/Wldomain_create/Exec[create server startup script]/returns: mkdir: cannot create directory `servers/managed_test': File exists
notice: /Stage[main]/Wldomain_create/Exec[create server startup script]/returns: mkdir: cannot create directory `servers/managed_test/security': File exists
notice: /Stage[main]/Wldomain_create/Exec[create server startup script]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 172.26 seconds


After execution completes, I see yep, the domain is there. I rm -rf the whole user_projects directory and run the puppet agent again. And I get the same error.
The wldomain_create class itself is not wrongly coded. If I comment out everything else other than that, i.e.

$config = hiera('domaincreation')
class{'wldomain_create':
}
}

This runs just fine and creates the domain. (provided I already have jdk and weblogic installed, of course).

Anyone has any ideas what exactly is happening here? Even though it looks like it is executing classes in the order, it ends up creating the domain first. What's wrong here?


If you apply only the first two classes to a clean system, does the domain get created?  I bet it does.


John

Bikram

unread,
May 28, 2013, 4:02:20 PM5/28/13
to puppet...@googlegroups.com
jcbollinger <John.Bollinger <at> stJude.org> writes:

> If you apply only the first two classes to a clean system, does the domain
get created?  I bet it does.John
>


Yes, if I run the first two classes first and then separately run the
wldomain_create class, it creates the domain successfully. When I run all of
them together, in that order, that's when it fails. I'm baffled.

jcbollinger

unread,
May 29, 2013, 9:06:12 AM5/29/13
to puppet...@googlegroups.com

That's not what I meant.  If you apply ONLY the first two classes, and not the third, then does the domain get created?

In any case, the behavior you observe is surely related to the details of the modules involved.  As such, I can only guess about causes without having the modules to examine.  Nevertheless, my guesses are sometimes pretty good, and in this case I suspect you have a containment problem.  See the docs (http://docs.puppetlabs.com/puppet/3/reference/lang_containment.html) for an explanation of the issue and a possible solution.


John

Reply all
Reply to author
Forward
0 new messages