News for hackers. Stuff that matters.
Re:Puppet 4 is now production-ready by mercurial on Thursday April 16, 2015 @04:42AM (#9386643)
At first glance, I don't see that m4 does anything jinja2 (Ansible's templating system) doesn't do better.
Re:Puppet 4 is now production-ready by e12e on Friday April 17, 2015 @07:10PM (#9397696)
As 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...
Re:Puppet 4 is now production-ready by 23david on Thursday April 16, 2015 @04:53PM (#9390683)
If 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.
Re:Puppet 4 is now production-ready by mercurial on Friday April 17, 2015 @01:08AM (#9392346)
What do you like more about Mako? I haven't used it in years, but I remember it being fairly similar in capabilities to Jinja2.
Re:Puppet 4 is now production-ready by 23david on Friday April 17, 2015 @07:49AM (#9393663)
Not 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-adva...

http://www.reddit.com/r/Python/comments/ktjm2/jinja2_or_mako...

http://stackoverflow.com/questions/3435972/mako-or-jinja2

Re:Puppet 4 is now production-ready by e12e on Thursday April 16, 2015 @05:43AM (#9386798)
If 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?