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

Can't create ext_pillar config with nested lists #383

Open
mrichar1 opened this issue Aug 27, 2018 · 5 comments
Open

Can't create ext_pillar config with nested lists #383

mrichar1 opened this issue Aug 27, 2018 · 5 comments
Labels

Comments

@mrichar1
Copy link
Contributor

I'm trying to add the following config via this formula:

ext_pillar:
  - saltclass:
    - path: /srv/salt/saltclass

However the logic in the formula doesn't seem to have a path that can output this style of config: https://github.com/saltstack-formulas/salt-formula/blob/master/salt/files/master.d/f_defaults.conf#L1180

It's probably possible to extend the logic to handle it, but given how horribly complex it already is, is there a reason not to just insert literal yaml in this kind of config, rather than trying to unpack yaml and rebuild it again?

Something like (untested):

{% if 'ext_pillar' in cfg_master %}
{%- do default_keys.append('ext_pillar') %}
ext_pillar:
  {{ cfg_master['ext_pillar'] | yaml }}
{% endif %}
@jochumdev
Copy link
Member

For mongodb i use:

salt:
  master:
    ext_pillar:
      - mongo: "{ collection: salt_pillar }"

Works for me (tm)

@aboe76
Copy link
Member

aboe76 commented Feb 2, 2019

@mrichar1 tried with the following config and it works:

salt:
  master:
    master_tops:
      saltclass: "{ path: /srv/saltclass }"
    ext_pillar:
      - saltclass: "[ path: /srv/saltclass ]"

@mrichar1
Copy link
Contributor Author

mrichar1 commented Feb 4, 2019

Yep that's the solution I've gone with - will close this, thanks!

@mrichar1 mrichar1 closed this as completed Feb 4, 2019
@aboe76 aboe76 reopened this Oct 5, 2019
@aboe76
Copy link
Member

aboe76 commented Oct 5, 2019

This should be addressed if somebody else runs into this, they won't find this closed issue.

@aboe76 aboe76 added bug and removed question labels Oct 5, 2019
@adamcstephens
Copy link

For me, master_tops will actually take a dict, so the hack only seems to be necessary for ext_pillar:

salt:
  master:                                                                                                
    ext_pillar:                                                                                          
      - saltclass: "[ path: /srv/saltclass ]"                                                                                                                                        
    master_tops:                                                                                         
      saltclass:                                                                                              
        path: /srv/saltclass   
❯ grep -A4 '^master_tops' /etc/salt/master.d/f_defaults.conf
master_tops:
  saltclass:
    path: /srv/saltclass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants