TIL how to get a plaintext list of Ansible hosts

There was a need to iterate over the hosts in an Ansible inventory-file (don’t ask). After fiddling around with grep and sed, I found an easier method:

ansible-inventory --list all | jq " ._meta.hostvars| keys[]"

ansible-inventory --list all lists all hosts including their variables in a nice big json response …

more ...

TIL that Docker plugins need exec perms on the filesystem

For one of our customers we needed to install the Docker-plugin for loki. To install it, you run:

docker plugin install loki

However this failed with the following error message:

Error response from daemon: dial unix /run/docker/plugins/d442cff8568254659f9aa7d2dd5a30526b69d1ac62593c628b65da8b9e933c6a/loki.sock: connect: no such file or directory

Running strace …

more ...

TIL how to alter gitlab-ci include-directives

We have a set of common pipeline jobs that are shared among different projects in Gitlab. We include them like this:

include:
  - project: 'shared/gitlab/linting'
    ref: master
    file:
      - markdown.yml
      - ansible.yml

When you do this, these included jobs get executed with the runner that is defined in the …

more ...