A repo of Salt stack examples, I will be using over various talks.
How to use this repo
- I have only uploaded the srv folder, where I keep all the sls, shell and the relative virtualevn requirements file.
- For the above sls to work, you should open the master config in /etc/salt/master and enabled a config called file_roots and set it to /srv/salt
- You should also have minions pointing to the correct master.
- I use httpd(apache) as the webserver. The default path for httpd is /var/www/html/
- All the rpm I serve with be download via a yum plugin called yum-downloadonly
- yum install yum-downloadonly createrepo httpd
- cd /var/www/html
- mkdir packages
- cd packages
- yum install your-list-of-pacakages --downloadonly --downloaddir=/var/www/html/packages/
- createrepo .
- At this point the repo called packages will be created. Please do change the ip in demo1.sls to your actual master or whereever the httpd service is running. Esle, I wont work, just like it didnt today.
- cd ../ && mkdir tars
- you can use the tars folder to actually keep all the tar.gz file to be served for un-zipping or whatever you want to do with this.
- The whole point is, except for the repo, everything else can be arranged as you wish. You can have the shell and the virtualenv folder served through httpd or the tars served through the salt using salt://tars/tar-file-name.tar.gz It up to you to configure it the way you like
- But like a college grad, dont mix up everything and put everything in one folder. It might work, but not the best practise. Keep things neatly organized. like rpms in packages folder, tars in tars folder, shell files in shell folder. In that way, your code becomes more organized and understandable.
- If you have any questions, as in the bangpypers mailing list (if you think that question would be helpful to a few more people than you alone) or email me @email@example.com / firstname.lastname@example.org (if you think its just your personal issue and not generally interesting to a few more people).
Also, please do note that, I am equally new to salt stack as such, so there is deep learning curve associated with me too. So excuse my brevity ...!
But dont let that spoil your fun with a pinch of salt.
Always remember, Tequila is much better with a pinch of salt and a slice of lemon :-D