ads' corner

Auto-approve and link certain inbox items in openHAB using Ansible

After starting to look into openHAB, and automate the installation with Ansible, I discovered that there is an API, but the main focus of the documentation and examples clearly is on using the UI and don’t automate the installation. It takes some time to figure out the details. In my last blog post I automated the installation of extensions/bindings, and ended with running a rediscover scan.

Now it’s time to see if there are new items in the inbox, and possibly auto-approve and link them in Ansible.


Install openHAB2 bindings using Ansible

Recently I started looking into Home Automation, using a Raspberry Pi and the openHAB as platform. The website provides ready-to-go images based on Debian, named openHABian. Me being me, I decided to install the image, let it boot up for the first time, and then take it from there using Ansible as automation tool. That’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.


Create and renew Let's Encrypt certificates using Ansible

Update: Blog post using the acme_certificate module can be found here.

Ansible comes with a plugin which allows to create and renew Let’s Encrypt certificates. Documentation is sparse, so I decided to post about my own Playbook.


Configuring "locales" in Debian and Ubuntu, using Ansible - Reloaded

Last year I posted about how to configure “locales” in Debian or Ubuntu, using Ansible. Back then I did not know that there is an Ansible debconf module available, and I have no idea how I could miss it. Anyway, this makes things a bit easier, but not much.

First of all, the module let’s you both set and query values. However because the locales package does not use debconf for the list of locales, but stores this list in /etc/locale.gen, things are still unnecessary complicated. But I managed to get it working without having to use an additional file as flag if this step was completed before.


Ansible: unpack a file on the remote host - Ansible version 2.2

A while ago I posted about a nasty problem in the Ansible unarchive module: in version 2.0.x, if you do not specify copy=no, Ansible will happily copy the file again from the Ansible host.


Ansible: unpack a file on the remote host

Trying to unpack a file on the remote host using Ansible might end in an error message:


Execute a required reboot, with Ansible (CentOS/Red Hat)

A while ago I blogged about executing a reboot using Ansible on Debian-based operating systems. That is necessary after certain updates, as example after installing a new kernel. Turns out that things are very easy on Debian, compared to Red Hat based systems (Red Hat and CentOS in my case).

First of all, there is no clear indicator if a reboot is required. People work around this problem by creating overly complicated scripts. The needs-restarting tool in newer versions provides the -r option to indicate if a reboot is required. But the CentOS 7 I’ve just installed does not come with this version.


Ansible and LXC Containers

LXC is one of many available containerization solutions for Linux. Ansible has basic support for LXC integrated, which is fine if you do not intend to do much inside of the container (aka: fire & forget). My goal however is to start a full flavored container, and manage this container with Ansible as well. That’s where things get a bit tricky, and looking around I couldn’t find much documentation how to do this.

This posting describes my approach.


Execute a required reboot, with Ansible (Debian/Ubuntu)

After updating Linux packages, it sometimes is required to reboot the host. Debian and Ubuntu provide this information by the presence of a special file: /var/run/reboot-required. Ansible makes it easy to reboot a host, but there are a few aspects which need attention.


Configuring "locales" in Debian and Ubuntu, using Ansible

Missing locale settings will result in error messages like: