My collegues are maintaining a configuration file, which is deployed to production/test/staging environments by SaltStack. I am maintaining this file by using diff to see what has changed and code the appropriate jinja snippet.
The file name is program.conf and the SaltStack version is program.conf.jinja.
program.conf has lines of the form:
variable = "value"
program.conf.jinja is:
variable = "{{ value }}"
From diff's point of view, these are different. But from my point of view, they are same. I am looking for a pragma-like feature where I can say mark the jinja file as following so that I won't get that in the output of diff:
variable = "{{ value }}" # pragma-same: variable = "value"
I will also be using that utility to generate alerts to force people to update the jinja file for any missing variable.
variable = "value" sometimes resolve to more complex stanzas like:
{% if pillar.get(...) %}
variable = {{ value }}
{% else %}
variable = {{ value + 2 }}
{% endif %}
program.conf.jinjasays thatoblongnessmight be 17 and might be 19, what canprogram.confsay to avoid being flagged as different? – Scott - Слава Україні Jul 15 '14 at 21:13When a change Y comes in, until I make Y', I want diff to show me that I still need to translate Y to Y'.
I can wrap a relevant change in .jinja with and hope diff to detect that and if any line around those line numbers is equal to X, it will show "no change". I am aware that this won't be as simple as that for sure.
– Can Burak Çilingir Jul 16 '14 at 15:51