Hi,
I'm trying to set up multiple environments in saltstack and have read through the documentation, but I'm not sure I'm doing it right. Here's what I have configured:
/etc/salt/master:
##### File Server settings #####
##########################################
# Default:
file_roots:
base:
- /srv/salt/base
dev:
- /srv/salt/dev
qa:
- /srv/salt/qa
prod:
- /srv/salt/prod
top.sls:
base:
'*':
- global
prod:
'storm*prod':
- prod.storm
'kafka*prod:
- prod.kafka
'hadoop*prod':
- prod.CDH4
dev:
'*dev':
- dev
qa:
'*qa':
- qa
Directory structure for saltstates:
[root@salt-server salt]$ ls /srv/salt/
dev global prod qa server top.sls
What I'm looking to have happen is that a minion with a hostname like kafka-randomstringhere-prod would pull from the /srv/salt/prod/kafka state tree. However, it's unclear to me whether I have to specify the sls files underneath the kafka directory or not. By default I believe it pulls kafka/init.sls, right?
Does that look like a feasible setup? Am I understanding the way this works?
Related question is if I have a specific version of Java that needs to be installed on only some hosts, like the CDH4 hosts, if I put a java.sls file under the /prod/cdh4 directory will it run that automatically or do I have to do something like an include? Is there a way to make sure it runs the java.sls file before it runs the init.sls file?
Thanks in advance.