yamllint error: "invalid config: ignore should contain file patterns"

Setting up a new repository for YAML linting today I was running in a bit of an issue with yamllint. I was using a YAML list to specify ingores, as mentioned in the documentation: ignore: - "*.dont-lint-me.yaml" - "/bin/" - "!/bin/*.lint-me-anyway.yaml" This however did not work with the above mentioned error message. After a lot of debugging I found that they released a new version recently which introduced this feature. [Read More]

Replace Line In YAML While Keeping Indentation Using Ansible

In theory Ansible should be declarative and have full control over the systems we touch with it. In practice, this is unfortunately not always the case. With this nifty task we can replace the value of a key (given as yaml_key) to a new value (given as new_value) while preserving it’s indentation. - name: Replace values in YAML file while keeping their indentation lineinfile: backup: true backrefs: true state: present path: foo. [Read More]