<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Jinja on ads' corner</title><link>https://andreas.scherbaum.la/tags/jinja/</link><description>Recent content in Jinja on ads' corner</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 21 Mar 2021 19:08:00 +0100</lastBuildDate><atom:link href="https://andreas.scherbaum.la/tags/jinja/index.xml" rel="self" type="application/rss+xml"/><item><title>Blog website crawlers and bots in Apache2</title><link>https://andreas.scherbaum.la/post/2021-03-21_blog-website-crawlers-and-bots-in-apache2/</link><pubDate>Sun, 21 Mar 2021 19:08:00 +0100</pubDate><guid>https://andreas.scherbaum.la/post/2021-03-21_blog-website-crawlers-and-bots-in-apache2/</guid><description>&lt;p&gt;Found a couple more bots crawling my website, and from the look at online resources it seems I catched a few of the bad guys. Crawlers which ignore the &lt;a href="https://en.wikipedia.org/wiki/Robots_exclusion_standard"&gt;robots.txt&lt;/a&gt; standard, and just crawl a website for content.&lt;/p&gt;&#10;&lt;p&gt;Decided to do something against it, and added a filter in &lt;a href="https://httpd.apache.org/"&gt;Apache2&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Use namespace as global variable in Ansible Jinja templates</title><link>https://andreas.scherbaum.la/post/2020-07-09_use-namespace-as-global-variable-in-ansible-jinja-templates/</link><pubDate>Thu, 09 Jul 2020 21:46:00 +0200</pubDate><guid>https://andreas.scherbaum.la/post/2020-07-09_use-namespace-as-global-variable-in-ansible-jinja-templates/</guid><description>&lt;p&gt;A simple task, or so I thought: in a &lt;em&gt;Jinja&lt;/em&gt; template keep track of the number of items in a loop. And then use that count afterwards.&lt;/p&gt;&#10;&lt;p&gt;Disclaimer: the number of items is not equal the number of times the loop runs, so I can&amp;rsquo;t use the loop variables.&lt;/p&gt;&#10;&lt;p&gt;Turns out that &lt;em&gt;Jinja&lt;/em&gt; has other opinions, and variables inside a loop are all local. When a variable is changed inside the loop, the scope of the variable stays local, and once the loop ends the original value of the variable is restored. That&amp;rsquo;s even true for variables which are created outside the loop.&lt;/p&gt;</description></item><item><title>Install openHAB2 bindings using Ansible</title><link>https://andreas.scherbaum.la/post/2018-07-01_install-openhab2-bindings-using-ansible/</link><pubDate>Sun, 01 Jul 2018 11:33:00 +0200</pubDate><guid>https://andreas.scherbaum.la/post/2018-07-01_install-openhab2-bindings-using-ansible/</guid><description>&lt;p&gt;Recently I started looking into Home Automation, using a &lt;a href="https://en.wikipedia.org/wiki/Raspberry_Pi"&gt;Raspberry Pi&lt;/a&gt; and the &lt;a href="https://www.openhab.org/"&gt;openHAB&lt;/a&gt; as platform. The website provides ready-to-go images based on &lt;em&gt;Debian&lt;/em&gt;, named &lt;a href="https://docs.openhab.org/installation/openhabian.html"&gt;openHABian&lt;/a&gt;. Me being me, I decided to install the image, let it boot up for the first time, and then take it from there using &lt;a href="https://www.ansible.com/"&gt;Ansible&lt;/a&gt; as automation tool. That&amp;rsquo;s a bit more effort in the beginning, but ensures that I can always just wipe the SDcard, and start over from the beginning. Especially useful if I screw up at some point during testing.&lt;/p&gt;</description></item></channel></rss>