r/saltstack • u/drawsmcgraw • Apr 27 '15
Salt State Catalog?
So you've automated user account creation, software installs, and tons of other properties of your data center. How do you document this?
Even for someone who knows their way around a state tree, it's easy for someone to re-implement a capability that already exists just because they didn't know about it. And for those who don't write Salt states regularly, figuring out what's been Salted and what hasn't is... well.. challenging.
Proper organization of files and directories and writing easily-read (and maintained) states is key, but I think it's just the first step. Has anyone found a good way of maintaining a list of Salted tasks for their environment - a catalog of sorts that provides an at-a-glance view?
1
u/acid_sphinx4 May 09 '15
We spent a great deal of time specifying our state tree definition for this very reason. Where everything goes is strictly spelled out and documented by simple markdown files visible in git. To generate a sort of catalog is more difficult, and I did have in mind a header each sls file would have (that a script could consume) but it is difficult to enforce and not optimal. Ideally there would be a salt command that could analyze an sls and report relevant info about it ... what is depends on, what depends on it, what pillars it uses, what files it pushes out, etc. You can rig something up with "test=true" to see what it will do but something more consise would be better. But yeah, the last thing anyone needs is a messy and huge state tree. Eeek!
2
u/sporkd2 Apr 28 '15
If you code it they will come....