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.


Upgrade from Ubuntu 16.10 (yakkety) to 17.10 (artful)

Sometimes old computers are not updated quickly enough, or just kept running …


Outdated and dispensable initrd images in /boot

Sometimes update-initramfs leaves old initrd images around in /boot, even when the kernel package is deinstalled. Deleting the file does not help, the next run of update-initramfs will recreate the file.

The solution is simple: all kernels which need to be rebuild are in /var/lib/initramfs-tools/ - just delete the old ones, and the images in /boot, and they will not be recreated.


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.


How to reset your KDE (without deleting everything else)

I’m a (more or less) happy KDE user, ever since the KDE 3 days. Before that, I used fvwm2 for a long time, but that is a different story. It also happens that I never really reinstalled my home directory - the oldest files I can find are from 1997, and that is pretty much when I switched from an old Slackware system with self-compiled updates, to something with a more modern distribution. That means, that all the time from 1997 to today, I carry the same /home/ads across my computers. The home directory grew from a few MB to 133 GB today (maybe I should clean it up, but then again it’s cheaper to buy a bigger harddisk).

It also means, that I never deleted my KDE config, even when upgrading to KDE 4 or Plasma.


Reduce Spotify cache size under Linux

The Spotify client for Linux, by default, will eat away a GB of your precious disk space. Since I mostly listen to random playlists, and rarely ever hear a song twice, there is no need to store all the songs on my hard disk.

Unfortunately the only option you can change in the settings menu (go to Advanced Settings) is the place of the storage folder, but you can’t change the size there.


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.