Created
November 27, 2016 17:13
-
-
Save mikeweilgart/79f814e2b11c1f05c01fc0ba9ff0ea64 to your computer and use it in GitHub Desktop.
CFEngine 3 limits promise evaluation to three passes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run me with: | |
# cf-agent -vKf ./dependencies.cf | |
bundle agent main { | |
vars: | |
any:: | |
"pre_eval" string => "This is set during a pre-eval pass."; | |
first_pass_complete:: | |
"second_pass" string => "Vars before classes, so this is set 2nd pass."; | |
second_pass_class:: | |
"third_pass" string => "The class will be set by end of 2nd pass. | |
This var will be set during the 3rd pass."; | |
end_of_third_pass:: | |
"oops" string => "Thanks to implementation quirks, this never gets set."; | |
classes: | |
any:: | |
"first_pass_complete" expression => isvariable("pre_eval"); | |
"second_pass_class" expression => isvariable("second_pass"); | |
"end_of_third_pass" expression => isvariable("third_pass"); | |
"i_am_not_set_but_logically_should_be" expression => isvariable("oops"); | |
} | |
# Note: This behavior is *documented*; | |
# see https://docs.cfengine.com/lts/guide-language-concepts-normal-ordering.html | |
# The point is that documenting odd behavior doesn't make it optimal design. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment