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 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 ...


TIL there’s a limit on Gitlabs job output

And it is (at least for my instance) 4194304 bytes. That is 4,19 mb. You can easily achieve this by running some Ansible playbooks in diff-mode that unpack many files. :)

Job's log exceeded limit of 4194304 bytes.

Job execution will continue but no more output will be collected.
more ...