Advertisement
stevage

Comments on SaltStac documentation

Feb 11th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.50 KB | None | 0 0
  1. Comments on salt doco
  2.  
  3. Disclaimer: it's hard finding the right time to comment on docs because either:
  4. - you comment too early, before you really understand anything, and it's hard to describe what you're having trouble understanding
  5. - you comment too late, and now you understand everything and the doc seems to make sense now.
  6.  
  7. Confusing having both docs.saltstack (with several versions and lots of developer doc mixed in) and salt.readthedocs.org
  8.  
  9. No clear understanding of the names of the different bits in a .sls file: state, component, function, id, module
  10. [solution here is not another page, but just to highlight those terms where used, and be consistent]
  11.  
  12. Unclear to me what the rules of the yaml file are: can you repeat function names? Most of the examples are kind of trivial
  13. and don't cover real cases. Example: embedded bash examples are all single line. Took a bit of searching on stackoverflow to
  14. discover how to do multi-line bash (with | character).
  15.  
  16. Requisites (http://docs.saltstack.com/ref/states/requisites.html)
  17. - no examples of depending on more than one thing
  18. - no explanation of what the 'vim' in 'pkg: vim' refers to (is it the package name, or the id of the component that installed it)
  19.  
  20. pgkrepo: I was trying to find the equivalent of apt-add-repository and assumed salt.modules.apt.mod_repo was the right one. It didn't work,
  21. but eventually pkgrepo.managed did the trick - but it's hard to find (I came across a forum post that guided me).
  22.  
  23. *Really* unclear to me where order matters and where it doesn't. Specifically:
  24. - order of states in top file
  25. - order of components (is that what they're called?) in state file
  26. - order of functions within component
  27.  
  28. Confusing to me that in much of the doc, the examples are command line commands (eg from http://docs.saltstack.com/ref/modules/all/salt.modules.apt.html):
  29.  
  30. salt '*' pkg.del_repo "myrepo definition"
  31. ----
  32. Also confusing: some functions specify their behaviour as if they were Python functions:
  33. "
  34. Returns a dict of dicts containing the state, and package names:
  35.  
  36. {'<host>':
  37. {'<state>': ['pkg1',
  38. ...
  39. ]
  40. },
  41. ...
  42. }"
  43.  
  44. (I really can't understand how to use this apt.get_selections function, or why I would want to...)
  45.  
  46. Suggestion: every function should have a meaningful .sls example.
  47. ----
  48. http://docs.saltstack.com/topics/tutorials/walkthrough.html
  49. IMHO the 'official walkthrough' should start with something more interesting than how to install the master and minion. For someone evaluating Salt, it's quite a slog through this tedium before you get anywhere like *why* you would want to do this. I'd suggest cutting it back to the bare essentials, removing the verbosity (eg, giving two different ways to start the minion - you don't need that yet).
  50.  
  51. Similarly, it's confusing explaining the targeting system before you have anything to run. And the stuff about verifying keys can surely come later.
  52.  
  53. The "note" under Salt States is unfortunately completely meaningless to a newbie. It's well-intentioned, but all a newbie can take from it is "Salt does stuff with states."
  54.  
  55. >The state system is built on sls formulas
  56.  
  57. Meaning? What's an SLS formula? Is a .sls file a 'state' or an 'sls formula'? You can read through the whole 'Salt States' section and still have no idea what a 'state' is. Is it just a Salt abstraction that is not exposed directly to the end user? If so, why does the user need to know about it now?
  58.  
  59. >Adding Some Depth¶
  60. Here would be a good place to use some formatting and links to highlight terms like 'formula', 'statement' etc. It'd also be nice to label what the whole unit of content from 'nginx:' downwards is called (I think 'component'?)
  61.  
  62. > Obviously maintaining sls formulas right in the root of the file server will not scale out to reasonably sized deployments.
  63. I didn't understand this sentence at all. Was there a previous version of this doc where the .sls file was stored in /?
  64.  
  65. (Wait, maybe I do. It's saying you shouldn't put all your .sls files in /srv/salt, but under subdirectories? If so, IMHO it's way too early to get into niceties. Surely that will only be a problem when you have a dozen or more formulas...)
  66.  
  67. >nginx:
  68. > pkg:
  69. > - installed
  70. > service:
  71. > - running
  72. > - require:
  73. > - pkg: nginx
  74.  
  75. As a newbie, I found this example pretty underwhelming. 7 lines, of which the last two appear to be repetitive and redundant. "Install nginx. Then, if nginx has been installed, start the service." Is this really necessary? Wouldn't ordering suffice?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement