Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file_tree templating in develop breaks existing usage #40978

Closed
Shados opened this issue May 1, 2017 · 2 comments
Closed

file_tree templating in develop breaks existing usage #40978

Shados opened this issue May 1, 2017 · 2 comments
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix ZRELEASED - 2017.7.0rc1
Milestone

Comments

@Shados
Copy link

Shados commented May 1, 2017

Description of Issue/Question

In the develop branch templating/renderer functionality has been added to the file_tree external pillar. Unfortunately, this breaks the existing behaviour, where file contents are just read in to the pillar dict as strings.

Currently, if render_default and renderer_blacklist/whitelist aren't specified in the master configuration file for the file_tree, they're just left as None internally. As a result, the salt.template.compile_template_str function that is called to template each file thus attempts to pass it through an empty renderer pipeline and just returns an empty dictionary instead of a templated string.

I am not familiar enough with the codebase to know what the preferred change would be to solve the problem... on that note, in the mean-time is there an e.g. 'plaintext' renderer I can specify to get the old behaviour?

Setup

/etc/salt/master:

file_roots:
  base:
    - /srv/salt/tree

pillar_roots:
  base:
    - /srv/salt/pillar

ext_pillar:
  - file_tree:
      root_dir: /srv/salt/pillar_file_tree
      follow_dir_links: True
      keep_newline: True

Steps to Reproduce Issue

Have a minion called test. Do:

mkdir -p /srv/salt/pillar_file_tree/hosts/test/files/
echo "Hello world" > /srv/salt/pillar_file_tree/hosts/test/files/testfile
salt 'test' pillar.data

Expected output:

test:
    ----------
    files:
        ----------
        testfile:
            Hello world

Actual output:

test:
    ----------
    files:
        ----------
        testfile:
            ----------

Versions Report

salt 2017.5.0-85-g8f7e8e4

gtmanfred added a commit to gtmanfred/salt that referenced this issue May 1, 2017
This should only be templated if the user specifies that it should be
templated, otherwise we get a similar problem that is fixed here

saltstack#40464

Fixes saltstack#40978
@gtmanfred
Copy link
Contributor

I have fixed this in the PR #40994

This will require the user to specify template: True for templating to take place, this is how it should have been implemented to begin with.

Thanks,
Daniel

@gtmanfred gtmanfred added Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt ZRELEASED - 2017.7.0rc1 labels May 1, 2017
@gtmanfred gtmanfred added this to the Approved milestone May 1, 2017
@gtmanfred gtmanfred added the fixed-pls-verify fix is linked, bug author to confirm fix label May 1, 2017
@Shados
Copy link
Author

Shados commented May 2, 2017

Built salt with that, confirmed it fixes the issue.

@Shados Shados closed this as completed May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix ZRELEASED - 2017.7.0rc1
Projects
None yet
Development

No branches or pull requests

2 participants