Skip to content

Instantly share code, notes, and snippets.

@nickanderson
Forked from rpetre/gist:4000674
Created November 2, 2012 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nickanderson/4001312 to your computer and use it in GitHub Desktop.
Save nickanderson/4001312 to your computer and use it in GitHub Desktop.
duplicate selection of variable
infra:~ # cf-agent -KI
!! Duplicate selection of value for variable "missing" in scope dead_hosts
!! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38
!! Duplicate selection of value for variable "missing" in scope dead_hosts
!! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38
-------------------
bundle agent dead_hosts {
vars:
"delay" int => "24";
# Allow the variable to be set to a different value on subsequent pass
"missing" slist => { hostsseen ("$(delay)","notseen","name") },
policy => "free";
# Only set the missing list once
!first_class_pass::
"missing" slist => { hostsseen ("$(delay)","notseen","name") };
classes:
any::
"first_class_pass" expression => "any";
reports:
cfengine3::
"I haven't seen $(missing) for the last $(delay) hours!"
action => if_elapsed("240"); # every 4h
}
-----------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment