Multiple Environments in SaltStack

874 views
Skip to first unread message

particlepineapple

unread,
Mar 19, 2013, 1:30:02 PM3/19/13
to salt-...@googlegroups.com
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.

ArKam

unread,
May 14, 2014, 9:34:58 AM5/14/14
to salt-...@googlegroups.com
Hi particulepinneapple,

did you find a way to achieve this? I'm looking for the really same solution and don't really know how to operate my filesystem structure as you indeed. :D
Reply all
Reply to author
Forward
0 new messages