-
-
Save wwalker/957a49d190738989bc1b6620589ee420 to your computer and use it in GitHub Desktop.
pillar merging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I would expect: | |
ubuntu@car-salt-01:/vagrant/tg-salt/pillar$ sudo salt 'car-salt-01' pillar.items | grep -A10 base: | |
base: | |
---------- | |
val1: | |
A | |
val2: | |
B | |
val3: | |
3 | |
val4: | |
D | |
however I got : | |
ubuntu@car-salt-01:/vagrant/tg-salt/pillar$ sudo salt 'car-salt-01' pillar.items | grep -A10 base: | |
base: | |
---------- | |
val1: | |
1 | |
val2: | |
2 | |
val3: | |
3 | |
val4: | |
D | |
How do we use a base pillar for default values and then override them for the local datacenter (in this case car)? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!jinja|yaml|gpg | |
base: | |
val1: 1 | |
val2: 2 | |
val3: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base: | |
val1: A | |
val2: B | |
val4: D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jinja_trim_blocks: True | |
jinja_lstrip_blocks: True | |
file_recv: True | |
state_output: mixed | |
hash_type: sha256 | |
file_roots: | |
base: | |
- /vagrant/saltstack | |
- /vagrant/salt-top | |
pillar_roots: | |
base: | |
- /vagrant/pillar/base | |
car: | |
- /vagrant/pillar/car | |
top_file_merge_strategy: merge_all | |
pillar_source_merging_strategy: recurse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl stop salt-master | |
sudo rm -rf /var/cache/salt/master/git_pillar | |
sudo rm -rf /var/cache/salt/master/gitfs | |
sudo systemctl start salt-master | |
sleep 10 | |
sudo salt-run cache.clear_git_lock gitfs type=update | |
sudo salt-run fileserver.clear_cache | |
sudo salt-run fileserver.clear_file_list_cache | |
sudo salt-run fileserver.update | |
sudo salt-run fileserver.file_list | |
sudo salt-run git_pillar.update | |
sudo salt '*' saltutil.pillar_refresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu@car-salt-01:/vagrant/tg-salt/pillar$ cat car/top.sls | |
car: | |
'car-*': | |
- monkey | |
ubuntu@car-salt-01:/vagrant/tg-salt/pillar$ cat base/top.sls | |
base: | |
'*': | |
- monkey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pillar/ | |
├── base | |
│ ├── monkey.sls | |
│ ├── top.sls | |
├── car | |
│ ├── monkey.sls | |
│ ├── top.sls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment