Git Product home page Git Product logo

Comments (6)

amendlik avatar amendlik commented on July 17, 2024

Would it be possible for you to test your configuration under PillarStack?
GitStack is just a wrapper around PillarStack, so we need to make sure that is working first.

from gitstack-pillar.

mrichar1 avatar mrichar1 commented on July 17, 2024

I've updated the master config to have:

ext_pillar:
  - stack: /etc/salt/stack/stack.cfg

And dropped the above files into /srv/pillar and /etc/salt/stack/ as appropriate.

Now I see {{ pillar }} being expanded properly in the logs:

Ignoring pillar stack template "TESTING/{u'roles': [u'a', u'b']}" ...

And the for seems to be looping as expected - if I create roles/a.sls then it's pillar contents ends up being processed correctly and appear when calling pillar.items.

So it does look like a gitstack issue I'm afraid!

from gitstack-pillar.

mrichar1 avatar mrichar1 commented on July 17, 2024

OK - I just managed to solve this one.

It turns out that if you have stack config and pillars in the same git repo, then you must put the git entry before the gitstack entry in the master ext_pillar section:

ext_pillar:
  - git: 
    - master http://example.com/salt.git
  - gitstack:
      - master http://example.com/salt.git:
      - stack: _stack/stack.cfg

I'm guessing what happens is that ext_pillar parts are processed in order, and that otherwise gitstackruns 'before' top.sls has been read in from the git repo, so gets an empty pillar. However top.sls is then read in subsequently, which is why the roles defined in it do end up in the pillar by the time we call pillar.items. Having swapped them round it all works as expected.

I'm guessing this will never have been spotted if top.sls is local, or in a different git repo included before gitstack?

Could you update the documentation to reflect this? (There's also a minor bug in that the configuration yaml for gitstack in ext_pillar is missing a colon).

from gitstack-pillar.

amendlik avatar amendlik commented on July 17, 2024

That makes sense. It wasn't clear to me that you were using the Git pillar. I assumed you were using the standard, built-in, pillar and I was having a very hard time understanding the issue.

from gitstack-pillar.

amendlik avatar amendlik commented on July 17, 2024

@mrichar1 I've added some documentation on pillar chaining. Please let me know if this looks sufficient.
https://github.com/amendlik/gitstack-pillar/blob/develop/docs/configuration.md

from gitstack-pillar.

mrichar1 avatar mrichar1 commented on July 17, 2024

That looks great - thanks!

from gitstack-pillar.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.