Open leonkatz opened 7 years ago
2 spaces- ref: master Github markup is not displaying the spaces, just like the renderer is not doing it.
If you wrap the code block in triple backtics, it markdown will not modify your issue.
Can you make sure that I have updated the initial comment to display what you were trying to how?
Thanks, Daniel
Thanks for you help. Updated with the correct info.
Is this still blocked?
What is the remote
here?
state.sls
gitfs_saltenv:
{{ remote.gitfs_saltenv|yaml(false) }}
I do not see it anywhere in your setup?
I have been able to replicate this issue with the following setup.
[root@salt ~]# tail -c +0 /srv/*/*.sls
==> /srv/pillar/test.sls <==
remote:
gitfs_saltenv:
- sdev:
- ref: master
==> /srv/pillar/top.sls <==
base:
'*':
- test
==> /srv/salt/test.sls <==
gitfs_saltenv:
{{ pillar.remote.gitfs_saltenv|yaml(false) }}
The output with yaml(false) does not indent the ordered dictionary correctly.
[root@salt ~]# salt-call cp.get_template salt://test.sls /test template=jinja
local:
/test
[root@salt ~]# cat /test
gitfs_saltenv:
- sdev:
- ref: master
Which means that the file renders to json like this.
{
"gitfs_saltenv": [
{
"sdev": null
},
{
"ref": "master"
}
]
}
Instead of this
{
"gitfs_saltenv": [
{
"sdev": [
{
"ref": "master"
}
]
}
]
}
The work around would be to just not set yaml(false) and use the default, which will print it out in json format, but also renders it correctly for later use.
Thanks for reporting. Daniel
I think I have more specifics on the issue. I found another symptom. Starting yaml
A:
B:
C:
C:
C:
C:
After yaml filter
A:
B:
C:
C:
C:
C:
Please surround them by triple backtics so that the spacing appears correctly
On Sat, Feb 25, 2017 at 12:37 AM leonkatz notifications@github.com wrote:
I think I have more specifics on the issue. I found another symptom. Starting yaml A: B: C: C: C: C:
After yaml filter A: B: C: C: C: C:
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/saltstack/salt/issues/38862#issuecomment-282464793, or mute the thread https://github.com/notifications/unsubscribe-auth/AAssoZBiyHRU2_qvQCA7Xfzcbimzu6dOks5rf8wwgaJpZM4LqPnZ .
for above, it seems that the yaml filter just doesn't work after the second line of indentation of repeating indentation, but keeps previous indentation.
Any updates on this? We're experience this issue as well. For example, given the following Pillar data:
elasticsearch:
config:
bootstrap.memory_lock: true
network.host:
- _local_
- _site_
Used like so:
elasticsearch_configured:
file.managed:
- name: /etc/elasticsearch/elasticsearch.yml
- contents: |
{{ elasticsearch.config|yaml(False)|indent(8) }}
The contents are incorrectly rendered as:
bootstrap.memory_lock: true
network.host:
- _local_
- _site_
Note the missing indentation of the network.host
list items.
Any update?
for @forty8bits technically
bootstrap.memory_lock: true
network.host:
- _local_
- _site_
Is correct yaml, you do not need any more indentation on list items there. They will appear inside of network.host.
And anyone else asking for an update, it is marked as a bug, but no one is currently working on this as there are hire priority issues. Any PR would be greatly appreciated.
+1
+1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Thank you for updating this issue. It is no longer marked as stale.
any update on this bug ?
Description of Issue/Question
without (false) option
with (false) option
Expected
Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
Versions Report
(Provided by running
salt --versions-report
. Please also mention any differences in master/minion versions.)