westurner / provis

Infrastructure Provisioning Scripts and Configuration Sets https://provis.readthedocs.org/
https://provis.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

BLD: GitFS configuration #4

Open westurner opened 9 years ago

westurner commented 8 years ago

see: https://github.com/saltstack-formulas/salt-formula

westurner commented 8 years ago

salt-formula

| Src: https://github.com/saltstack-formulas/salt-formula

The salt::master::gitfs_remotes pillar value contains a list of git repositories (and configuration): https://github.com/saltstack-formulas/salt-formula/blob/master/pillar.example#L24

westurner commented 8 years ago

| Docs: https://docs.saltstack.com/en/develop/ref/configuration/master.html#gitfs-remotes | Docs: https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html | Docs: https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html#per-remote-configuration-parameters | Docs: https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html#branches-environments-and-top-files

westurner commented 8 years ago

The salt::master::gitfs_remotes pillar value contains a list of git repositories (and configuration): https://github.com/saltstack-formulas/salt-formula/blob/master/pillar.example#L24

Is this more or less flexible than the alternatives:

westurner commented 8 years ago

Is this more or less flexible than the alternatives:

GitFS is more flexible (e.g. with branch mapping)

westurner commented 8 years ago

Is branch name mapping on by default?

| Docs: https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html#branches-environments-and-top-files

BRANCHES, ENVIRONMENTS, AND TOP FILES

When using the gitfs backend, branches, and tags will be mapped to environments using the branch/tag name as an identifier.

There is one exception to this rule: the master branch is implicitly mapped to the base environment.

So, for a typical base, qa, dev setup, the following branches could be used:

master qa dev

top.sls files from different branches will be merged into one at runtime. Since this can lead to overly complex configurations, the recommended setup is to have a separate repository, containing only the top.sls file with just one single master branch.

To map a branch other than master as the base environment, use the gitfs_base parameter.

gitfs_base: salt-base

The base can also be configured on a per-remote basis.

westurner commented 8 years ago
westurner commented 8 years ago

fileserver_backend does fall-through lookup.

so, e.g. with the following configuration, a locally cloned module (formula) would preempt the GitFS configuration (resulting in (n*env/branchmap)+(1*local clone)).

fileserver_backend:
  - roots
  - git
westurner commented 8 years ago
westurner commented 8 years ago

What do I think I need here?

westurner commented 8 years ago

What do I think I need here?

So, my tendency is to punt and say "if this was a shell script I could just [...] in like [...] commands" [with quoting and interpolation]; or a more linear-scripty configuration management tool like chef or ansible; but, the real utility of working with [salt formulas, puppet modules], IMHO, is that you can fairly easily port the same formula to different platforms; reusably.

westurner commented 8 years ago

So, my tendency is to punt and say "if this was a shell script I could just [...] in like [...] commands" [with quoting and interpolation];

Advantages of [salt] over shell scripts:

westurner commented 8 years ago

Salt Pillar backends: https://docs.saltstack.com/en/latest/ref/pillar/all/


cmd_json    
cmd_yaml    
cmd_yamlex  
cobbler 
django_orm  
ec2_pillar  
etcd_pillar 
file_tree   
foreman 
git_pillar  
hg_pillar   
hiera   
libvirt 
mongo   
mysql   
pepa    
pillar_ldap 
puppet  
reclass_adapter 
redismod    
s3  
svn_pillar  
varstack_pillar 
virtkey

| Src: https://github.com/saltstack/salt/tree/develop/salt/pillar | Docs: https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html | Docs: https://docs.saltstack.com/en/latest/topics/pillar/#viewing-minion-pillar | Docs: https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html#setting-pillar-data-on-the-command-line

arnisoph commented 8 years ago

The Salt Package Manager might be a solution for this issue in the future. I think it's still in a very early state. I'll file some feature requests.. :)

24896 (PR)

25210

25211

https://docs.saltstack.com/en/develop/topics/spm/

westurner commented 8 years ago

@bechtoldt thanks. so ./_states and/or ./_modules from SPM packages can override stock salt modules?