Changes between Version 1 and Version 2 of Internal/salt


Ignore:
Timestamp:
May 31, 2018, 3:21:00 AM (6 years ago)
Author:
msherman
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/salt

    v1 v2  
    4141}}}
    4242
     43This is a slightly more complex set up with multiple environments. The roots for each environment are set in /etc/salt/master, under file_roots and pillar_roots.
     44
     45When referring to a state or pillar, salt looks for the matching id in the corresponding environment tree, here base, orbit, or winlab. However, TOP FILES ARE GLOBAL. There is nothing stopping you from targeting an orbit machine with a winlab state, or both via sloppy use of wildcards.
     46
     47This can be used to benefit by putting common configuration under the base tree, and only keeping environment specific states under their respective trees. Code reuse means we fix problems fewer times. Environment specific configuration will in most cases be in pillars, not states anyway.
     48
     49It is possible to have multiple top files, but salt merges them upon execution, so it is better to manually configure it.
     50
     51=== Usage ===
     52The simplest use case is remote execution, with the format:
     53{{{ salt 'client pattern match' cmd.run 'command' }}}
     54This will match all clients in the pattern match, and execute that command, returning the result.
     55
     56To apply a specifc state:
     57{{{ salt 'client pattern match' state.apply environment:state_id }}}
     58
     59To apply the configuration from the top file:
     60{{{ salt 'client pattern match' state.apply}}}