4 ms·
IMHO puppet isn't significantly better than bash scripts. There are some improvements, but it has significant drawbacks too. Ansible is way better though, main
by crdoconnor 12y ago
IMHO puppet isn't significantly better than bash scripts. There are some improvements, but it has significant drawbacks too.
Ansible is way better though, mainly due to:
* Idempotence
* Templating
* Being declarative (turing completeness in a language = more likely to be buggy)
- e12e 12y agoI agree with you, but re: templating: if you're using shell scripts, why not use m4 as well? Shell of course has templating -- but it's a little dangerous...: template=teapot size=short build=stout \ cat <<eof > teapot.conf I'm a $template - $size and $build. I live at $(hostname). eof [ed: m4 is a little like cpp (the c pre-prosessor) on steroids (or acid). To get a feel for how it relates to templating for config files etc, see eg: http://box.matto.nl/m4.html http://box.matto.nl/m4.html ]
- mercurial 12y agoAt first glance, I don't see that m4 does anything jinja2 (Ansible's templating system) doesn't do better.
- e12e 12y agoIf you're going to use shell and not ansible, then why not use shell with m4. I'm not suggesting shell+m4 is better than ansible, or that ansible+m4 (wtf?! right?) would be a good idea. Just why not use a readily available template/macro language along with shell scripts, if you've decided to use shell scripts. I suppose you could use jinja and bash -- but why pull in two full interpreters as a dependency?
- 23david 12y agoIf we're discussing templating languages, I definitely prefer Mako over Jinja2 and think it's much more appropriate for devops templating. But Jinja2 is the default in a lot of projects, including Saltstack and Ansible, and it's hard to fight the currents all the time.
- mercurial 12y agoWhat do you like more about Mako? I haven't used it in years, but I remember it being fairly similar in capabilities to Jinja2.
- 23david 12y agoNot sure if it's a good idea for me to wade into that particular religious war... :-) Some good comments on both sides here: http://www.quora.com/Python-Web-Frameworks/What-are-the-advantages-and-disadvantages-of-using-Mako-vs-Jinja2 http://www.quora.com/Python-Web-Frameworks/What-are-the-adva... http://www.reddit.com/r/Python/comments/ktjm2/jinja2_or_mako_templating/ http://www.reddit.com/r/Python/comments/ktjm2/jinja2_or_mako... http://stackoverflow.com/questions/3435972/mako-or-jinja2 http://stackoverflow.com/questions/3435972/mako-or-jinja2
- e12e 12y agoAs I mentioned in another comment, I'm not suggesting using m4 with/in-place of ansible -- rather as a compliment to the shell. I suppose one could use jinja2 stand-alone with the shell -- but then you get the python dependency etc... I meant that m4 might be a better fit to go along with bash/ksh. Eg: dpkg-query --show \ --showformat='${Package;6} ${Installed-Size;4}^L\n' \ m4 python2.7-minimal dash bash mksh ksh \| sort -n -k2 dash 212 m4 382 mksh 878 ksh 3110 bash 3941 python 5456 (Not that you can avoid python-minmal on Debian - but in a chroot you might, etc). As for can and cannot do, consider this "feature" of m4: $ cat <<eof|m4 -Dme=you -Dpredictable=surprise me=predictable eof you=surprise Again, I'm not suggesting m4+dash is a great idea vs ansible -- just clarifying a couple of things...
- crdoconnor 12y ago>why not use m4 as well * Because jinja2 is overall a better templating language. * YAML (not turing complete) + templating = readable and clear (this is how ansible does it). * Bash (turing complete) + templating = unreadable and messy. "I want my configuration code to look as clear and readable as my C++" <-- not a great sales pitch :)
- brandonmenc 12y agoAren't those also features of Puppet?
- crdoconnor 12y agoYes, but puppet has other issues. You don't have to mess around with certificates, master servers and extra services with bash. You do with puppet.
- brandonmenc 12y agoSo why ansible? I use puppet. A quick glance at ansible suggests that all of that (certs, servers, services) is replaced in ansible with SSH, right? But you still need to manage keys. What am I missing?
- crdoconnor 12y agoYou would need to manage keys whatever you did. Puppet just means that you have to manage keys AND certs, so you have double the headache. Puppet also means you have to babysit the client service and the puppet master, and if they go down, you have to get them back up again. I deal with this problem a lot and I wish I didn't have to.
- 23david 12y agoAnsible is a good simple tool with a small learning curve so it's not very intimidating for developers. But it has its strengths and weaknesses just like everything else. Puppet, Chef and Saltstack are all fantastic tools. It all depends on how you use them.