After month of working great and no changes, Rudder agent stopped to expand variables
On a Rudder node I had an old configuration using "file_lines_present" which showed a very surprising behaviour last week.
The configuration did not change for months on this node.
I had a "file_lines_present" to setup some special crontab rules in /etc/crontab using variables. It has work for months, but suddenly, the variable stopped to be expanded in the file.
The agent was updated 10 days before it happened, so I do not think it is correlated. The reports were "success" even if the variable was not expanded, this is VERY misleading.
Updated by François ARMAND about 3 years ago
So, after some discussion on the suject:
- variables were defined with a "variable from command". So likely something changed in that command output,
- undefined variables are silently not expanded by cfengine.
We need to address these two problems.
For the first one, we can add a check in all "variable from ..." to validate that after variable definition, the variable is ACTUALLY defined. CFEngine doesn't help for that, but we could exploit some trick (predefined variable to some string like "the variable 'XXXX' is not correctly defined" (also usable as an understandable error message for human where the variable will be used), check that it's not that anymore after method exec)
For the second, we need a definitive solution to avoid that class of bug. I don't see any other solution than "rudder lang" (long term) and "finding a way to change that behavior in cfengine" (short term, but perhaps out of reach).