3

How should Salt State Files and Pillar configurations be structured to enable smooth deployment of varying minion roles for staged environments like dev, qa and production as well as feature branches?

I have arranged my root and pillar state files as follows in a separate repository from my Python project's source code:

salt-states/
    pillar/
        web/
            init.sls
            production.sls
            qa.sls
            dev.sls
        db/
            init.sls
            production.sls
            qa.sls
            dev.sls
        top.sls
    roots/
        web/
            init.sls
            production.sls
            qa.sls
            dev.sls
        db/
            init.sls
            production.sls
            qa.sls
            dev.sls
    top.sls

How should my top.sls file look to take advantage of this structure and how can I target feature branches in this fashion?

1 Answer 1

2

I would suggest using gitfs and git_pillar.

Gitfs allows you to keep your file_roots in a git repo. Your master branch becomes your "base" environment and each branch and tag become environments as well.

http://docs.saltstack.com/topics/tutorials/gitfs.html?highlight=gitfs

Git_pillar is similar.

http://docs.saltstack.com/ref/pillar/all/salt.pillar.git_pillar.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .