On Tue, Sep 14, 2010 at 12:12 PM, Douglas Garstang
<[email protected]> wrote:
> If I have...
>
> $version_core = "t.1538-1"
> $is_trunk_release = regsubst($version_core, '^(.*?)\.(.*?)$', '\1')
> if $is_trunk_release == "t" {
> notice ("here 1")
> if $t >= 1583 {
> notice ("here 2")
> }
> }
>
> Puppet complains with:
> comparison of String with 1583 failed at
> /etc/puppet/modules/elements/manifests/init.pp:220 on node
> app09.fr.xxx.com
>
> However, the documentation says you can do:
>
> if $ram > 1024 {
> $maxclient = 500
> }
>
> So, therefore .... how can I convert $is_trunk_release to an integer
> so I can do a numerical comparison against it?
>
> Doug.
>
Tried this:
$is_trunk_release = regsubst($version_core, '^(.*?)\.(.*?)$', '\1')
if $is_trunk_release == "t" {
$trunk_release = regsubst($version_core, '^(.*?)\.(.*?)$', '\2')
if (versioncmp($trunk_release, "1583") >= 0 {
notice ("Trunk release > 1583")
}
}
}
This gives the same error.
Doug.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.