Hi List,
As part of my module pre-checks I would like to confirm that a value passed
in for the state of a package is part of two valid values. Currently I am
doing this by:
$valid_ensure_values = [ "present", "absent" ]
if ! ("$::{ensure}" in $::{valid_ensure_values}) {
$test_ = inline_template("<%=
($::apt-cacher-ng::params::valid_ensure_values).join(', ') %>")
fail("${module_name}::server - Invalid ensure value [currently -
${ensure}], valid values are [$::{valid_ensure_values}]")
}
I was hoping that I could just simply do a:
validate_in($::{ensure}, $::{valid_ensure_values})
I have checked the documentation at
https://github.com/puppetlabs/puppetlabs-stdlib and looked in the
lib/puppet/parser directory and cannot see anything.
Thanks,
Peter.
--
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.