Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
When doing so, salt will fail with the following error:
Encountered error managing block: Unterminated marked block. End of file reached before marker_end.. See the log for details.
I assume the problem is that the second occurrence (end marker) will be matched when looking for the start marker.
When using in combination with append_if_not_found: true, the error will only appear after the second run.
Suggested Fix
In the documentation, this is technically covered where it says that the whole line containing the start marker will be used.
But i feel like there should be an extra mention that the two markers have to be differ.
Add something like this:
The markers cannot be the same or contain each other.
Maybe the state should also check for this and display a better error message.
Great news! We have a community member who is working on improving the file module documentation and is preparing a PR as we speak. I'll make sure it gets seen!
Description When using
file.blockreplace
, the end marker cannot contain the whole start marker. Example:When doing so, salt will fail with the following error:
I assume the problem is that the second occurrence (end marker) will be matched when looking for the start marker.
When using in combination with
append_if_not_found: true
, the error will only appear after the second run.Suggested Fix In the documentation, this is technically covered where it says that the whole line containing the start marker will be used. But i feel like there should be an extra mention that the two markers have to be differ.
Add something like this:
Maybe the state should also check for this and display a better error message.
Type of documentation Salt state module for
file
Location or format of documentation salt.states.file.blockreplace
Additional context Example sls: