Comments (16)
Hi,
interesting ,
can you also try to use the sleep parameter on the nodemanager manifest and see if this works.
$sleep = hiera('wls_nodemanager_sleep' , 20), # default sleep time
I am doing the same with version & port number
define orawls::domain (
$version = hiera('wls_version' , 1111), # 1036|1111|1211|1212|1213
I think hiera always return a string and the puppet code find its ok and ruby /fiddyspence-sleep is more strict
newproperty(:bedtime) do
desc "how long to sleep for"
munge do |snore|
Integer(snore)
end
validate do |zzzz|
fail("sleepy time isn't an integer") unless zzzz =~ /^\d+$/
end
probably 20 is ok, it is only longer when the server got a hard reboot and the nodemanager also tries to start the admin server again.
and you get an error but it is only showing this error.
from biemond-orawls.
Yeah, that is what I think is happening somehow. I thought wls_nodemanager_sleep was supposed to be interpreted as an integer, but fiddyspence-sleep doesn't seem to deal with that well.
I did comment out the setting in one of my hiera values, and the puppet run did go through (using the default value of 20 from the nodemanager manifest).
I can try some of my other offerings with 20 seconds, but experience has shown that this will not be long enough for me. I had to set that sleep time to up to 260 seconds on some WebLogic 10 clusters with an admin server, node manager, and 2 managed nodes all on the same VM. Weblogic 10 seems to take a bit longer than 12.
I wasn't sure if we can force that variable to be an integer after reading it from hiera or something. Or, since the sleep is a maximum sleep, maybe we can just increase your default value to something a bit larger, since it is a maximum sleep and not a definite sleep (won't hold up execution any longer than it takes the node manager port to come up).
from biemond-orawls.
I will increase it
when I read this
https://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#numbers
can you try this in the nodemanager.pp
$bedtime = $sleep * 1
sleep { "wake up ${title}":
bedtime => $bedtime,
from biemond-orawls.
Ah, nice find, sir. Interesting to know.
I should be able to try, but would it just be easier to multiply the hiera lookup * 1? Then, after you do a hiera lookup or default to 20, we multiple by 1 and get the same as an integer either way?
from biemond-orawls.
I am not even sure that fixed it, did you try it? I changed that and it is still failing...
from biemond-orawls.
indeed , also got an error.
will try something else
from biemond-orawls.
Glad I am not the only one, haha. Thanks!
from biemond-orawls.
Nothing helps,
only can make a custom parser function which returns an integer.
First will try to change puppet-sleep.
fiddyspence/puppet-sleep#1
from biemond-orawls.
Crazy, that sounds like overkill, I would hope we wouldn't need that. I guess another option is to include library code in your module and control it yourself, but nice to use the provided module.
Also, still have the option to increase the default value since it is just a maximum and shouldn't slow progress for fast node manager startups etc.
from biemond-orawls.
Hi - I'm trying to reproduce your behaviour (sorry - been a bit busy), but I can't get it to fail using any of the below, which makes me wonder what values your hiera call is returning that makes the validation fail.
The bottom line is that the sleep type manages to cope with '3' as well as 3 - you don't need to cast, but it does need to be a round Fixnum (not a Float) - I could find the time to make it cope with floats (ruby sleep returns a Fixnum, but it seems like a low value activity)
The validation treats the input like a string, and expects it to match the regex /^\d+$/ (i.e. a whole number)
sleep { 'sdfsd': bedtime => '3', refreshonly => false}
sleep { 3: refreshonly => false}
$foo = hiera('foo','3')
sleep { 'sdfsd': bedtime => $foo, refreshonly => false}
$foo = hiera('foo',3)
sleep { $foo: refreshonly => false}
from biemond-orawls.
Hi
I got it failing in all situations ( I know in vagrant I am using ruby 1.8.7 and on the puppet master ruby 1.9.3 )
only executes when I do not set the sleep parameter and then uses the default 20
# manifest
define orawls::nodemanager (
$sleep = hiera('wls_nodemanager_sleep' , 20), # default sleep time
) {
# using fiddyspence/sleep module
sleep { "wake up ${title}":
bedtime => $sleep,
wakeupfor => "/bin/ps -ef | grep -v grep | /bin/grep 'weblogic.NodeManager'",
dozetime => 2,
failontimeout => true,
}
}
$default_params = {}
$nodemanager_instances = hiera('nodemanager_instances', {})
create_resources('orawls::nodemanager',$nodemanager_instances, $default_params)
# hiera
wls_nodemanager_sleep: 25
nodemanager_instances:
'nodemanager':
or
nodemanager_instances:
'nodemanager':
sleep: 25
or directly
orawls::nodemanager{'aaa':
sleep => 25
}
from biemond-orawls.
Are you somehow getting some whitespace in there (there is currently no legislation for whitespace which would cause what you're seeing)
sleep: 25
e.g.:
kanga:~ fids$ cat foo.pp
$test = hiera('sleep')
define testthing ($sleep = $name) {
sleep { $name: bedtime => $sleep, refreshonly => false}
}
testthing { 3: }
testthing { '5': }
testthing { 'farce': sleep => 10, }
testthing { 'farcefoo': sleep => '1', }
testthing { $test: }
kanga:~ fids$ cat /var/lib/hiera/common.yaml
---
sleep: 25
kanga:~ fids$ puppet apply foo.pp
Notice: Compiled catalog for kanga.spence.org.uk.local in environment production in 0.07 seconds
Error: Parameter bedtime failed on Sleep[25]: sleepy time isn't an integer at /Users/fids/foo.pp:4
Wrapped exception:
sleepy time isn't an integer
That last error caused by the $test instance of the define, all the others work fine
from biemond-orawls.
I also got this error when I don't use hiera
but I think with the current version of hiera everything is string. They gonna change this.
Also tried to cast it to integer inside the define ( $newsleep = 1 * $sleep ) ,this should work when you read the puppet documentation.
from biemond-orawls.
It doesn't matter if hiera returns a string, as long as it's /^\d+$/
from biemond-orawls.
I think we can close this issue now, since it was fixed in the fiddyspence-sleep module in version 1.2.0.
from biemond-orawls.
Indeed I will at this version as dependency
from biemond-orawls.
Related Issues (20)
- change wlst_action HOT 1
- Some "get" methods still exist after replacement by "get_attribute_value"
- Issues when trying to set nodemanager_username and _password HOT 1
- Managed server not creating using wlserver
- Datasource created in WLS 12.2.1.3 appears to not display in Monitoring tab
- Upgrade to 12.2.1.4 HOT 1
- Errors when running puppet on an AIX operating system HOT 1
- Repo description doesn't match Documentation HOT 1
- FMW install in Solaris for new version fails HOT 1
- wls_opatch and multiple orainst_dir HOT 1
- opatch not being applied when doing a puppet run
- Support for 12.2.1.4
- OHS 12.2.1.4 HOT 7
- extraproperties is not idempotent HOT 1
- Odd issue that we need assistance with
- JDBC_persistence_store - get('MigrationPolicy') & get('DistributionPolicy') causes timeout
- Support for Weblogic version 14.1.1.0
- for keystores of type pkcs12, wls_authentication_provider creation fails with "Error: No domain or domain template has been read." HOT 3
- 0400 Puppet (err): Failed to apply catalog: BUG! removeinfectedconnections should have been '0' or '1' HOT 19
- Does orawls supports puppet enterprisemodules-easy_type (v2.48.3) as hajee-easy_type (v0.15.6) is been depricated?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biemond-orawls.