-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Newlines may be rendered as literal \n for multi-line scalar variables in some circumstances #30690
Copy link
Copy link
Open
Labels
ConfirmedSalt engineer has confirmed bug/feature - often including a MCVESalt engineer has confirmed bug/feature - often including a MCVECorerelates to code central or existential to Saltrelates to code central or existential to SaltRenderersbugbroken, incorrect, or confusing behaviorbroken, incorrect, or confusing behaviorhelp-wantedCommunity help is needed to resolve thisCommunity help is needed to resolve thisseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Metadata
Metadata
Assignees
Labels
ConfirmedSalt engineer has confirmed bug/feature - often including a MCVESalt engineer has confirmed bug/feature - often including a MCVECorerelates to code central or existential to Saltrelates to code central or existential to SaltRenderersbugbroken, incorrect, or confusing behaviorbroken, incorrect, or confusing behaviorhelp-wantedCommunity help is needed to resolve thisCommunity help is needed to resolve thisseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around3rd level, incorrect or bad functionality, confusing and lacks a work around
Type
Fields
Give feedbackNo fields configured for issues without a type.
Template file
bar.jinja:State file
bar.sls:State file
baz.sls:And imitation pillar data
baz.yaml:So let's run these two states:
And compare output.
It looks like it makes a rather large difference how the variable
siteis passed into the template. Sinceimport_yamlis a Salt thing, and not a Jinja thing, I'm wondering if the newlines are getting mangled there.I'm trying to take advantage of the public apache-formula. It encourages you to store information about all your sites in the pillar (thus "imitation pillar data" above). It allows arbitrary bits of config to be passed as multi-line scalars, for when the provided templates don't do what you want. Look for Formula_Append. I'm not interested in Salting every possible bit of Apache configuration syntax when I only need to use this feature occasionally. Only 3 sites out of several dozen need it, and only for about 4 short lines at a time.
About the machine where my tests were run:
Salt was installed via salt-bootstrap on 19 January 2016, if that helps any.