Here is the wlst.pp which executes the puppet-test1.py via a wlst interpreter, this script can be any of your wlst/python scripts,

wlst.pp contents :-

class wlstexec {
$javaCommand="/u01/app/java/bin/java"
$middlewareHome="/u01/middleware"
$scriptHome="/u01/wlst/scripts"
exec {'wlst-script':

environment => ["CLASSPATH=${middlewareHome}/wlserver/server/lib/weblogic.jar"],
command => "${javaCommand}  weblogic.WLST ${scriptHome}/puppet-test1.py",
logoutput => true,
}
}
include wlstexec

 

Puppet manual execution result:

[root@machine-1 test]# pwd
/etc/puppet/modules/test
[root@machine-1 test]#
[root@machine-1 test]# puppet apply wlst.pp
Notice: Compiled catalog for machine-1 in environment production in 0.05 seconds
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns:
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: Initializing WebLogic Scripting Tool (WLST) ...
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns:
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: Welcome to WebLogic Server Administration Scripting Shell
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns:
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: Type help() for help on available commands
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns:
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: SCRIPT IS BEING IMPORTED IN ANOTHER MODULE AND THEN EXECUTED
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: Puppet is running me...
Notice: /Stage[main]/Wlstexec/Exec[wlst-script]/returns: executed successfully
Notice: Finished catalog run in 2.95 seconds