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

Two databases, two pillar files, one minion #219

Open
grandmasterv opened this issue May 28, 2019 · 2 comments
Open

Two databases, two pillar files, one minion #219

grandmasterv opened this issue May 28, 2019 · 2 comments

Comments

@grandmasterv
Copy link

I tried to break out the pillar config per website we are hosting on a server and found that most formulas can handle it but not this one. I would like to be able to define individual database level config per pillar file if possible. Can anyone provide an example of defining two databases in separate pillar files that would work on a single minion with this formula?

As the formula currently stands, site2.sls config for the database overwrites site1.sls config. The user configs however are properly merged and work.

site1.sls

mysql:
  database:
    - name: site1
      character_set: utf8
  user:
    site1-user:
      password: site1-pass
      host: localhost
      databases:
        - database: site1          
          grants: ['select', 'insert', 'update', 'delete', 'create', 'alter','drop', 'index']

site2.sls

mysql:
  database:
    - name: site2
      character_set: utf8
  user:
    site2-user:
      password: site2-pass
      host: localhost
      databases:
        - database: site2          
          grants: ['select', 'insert', 'update', 'delete', 'create', 'alter','drop', 'index']

top.sls

'example-host':
    - site1.sls
    - site2.sls

I'm still new to modifying formulas but if someone could point me in a direction I can try my hand at an update to make the formula more flexible and support this. I am worried though that this could be a big change to the functionality and would require everyone to update their pillar files so it may not be welcomed.

@getSurreal
Copy link
Contributor

getSurreal commented May 29, 2019 via email

@grandmasterv
Copy link
Author

Oh neat thx for the tip for that salt master config item. Its going to take a fair bit of testing across all of our states though before I can enable it in production as messing with pillar merge has the possibility of changing behaviour across all of our states.

However, the default setting of pillar_merge_lists is false. Should this formula not be designed with the default setting in mind?

https://docs.saltstack.com/en/latest/ref/configuration/master.html#pillar-merge-lists

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

No branches or pull requests

2 participants