Skip to content
Snippets Groups Projects
Verified Commit 565408ff authored by Chris Croome's avatar Chris Croome
Browse files

Fix error caused by new Ansible versions

parent 7a2176a0
No related branches found
Tags 2.11.1
No related merge requests found
Pipeline #30525 passed
---
# https://yamllint.readthedocs.io/en/stable/integration.html
# https://github.com/adrienverge/yamllint/tags
repos:
# https://github.com/adrienverge/yamllint/tags
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.30.0
rev: v1.33.0
hooks:
- id: yamllint
name: YAML Lint
# https://github.com/ansible/ansible-lint/releases
- repo: https://github.com/ansible/ansible-lint.git
rev: v6.22.0
hooks:
- id: ansible-lint
name: Ansible Lint
language: python
additional_dependencies:
# https://github.com/kellyjonbrazil/jc/releases
- jc==1.23.6
# https://github.com/jmespath/jmespath.py/tags
- jmespath==1.0.1
# https://github.com/jackdewinter/pymarkdown/releases
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.14
hooks:
- id: pymarkdown
name: Markdown Lint
...
---
plugins:
md013:
enabled: false
...
......@@ -13,11 +13,33 @@
var: icinga_feature_enabled
verbosity: 1
- name: Check that there are no items in the icinga_feature_disabled and icinga_feature_enabled lists
ansible.builtin.assert:
that:
- icinga_feature_disabled | difference(icinga_feature_enabled) == icinga_feature_disabled
quiet: "{% if ansible_verbosity == 0 %}true{% else %}false{% endif %}"
- name: Run check in a block to catch errors
block:
- name: Check that there are no items in the icinga_feature_disabled and icinga_feature_enabled lists
ansible.builtin.assert:
that:
- not icinga_feature_disabled | difference(icinga_feature_enabled) == icinga_feature_disabled | bool
quiet: "{% if ansible_verbosity == 0 %}true{% else %}false{% endif %}"
rescue:
- name: Debug proposed disabled features
ansible.builtin.debug:
var: icinga_feature_disabled
- name: Debug proposed enabled features
ansible.builtin.debug:
var: icinga_feature_enabled
- name: Debug the check that caused the failure
ansible.builtin.debug:
msg:
- "Folowing are the results of: icinga_feature_disabled | difference(icinga_feature_enabled) == icinga_feature_disabled"
- "{{ icinga_feature_disabled | difference(icinga_feature_enabled) == icinga_feature_disabled }}"
- name: Fail as it appears there are some Icinga features that are set to be both enabled and disabled?
ansible.builtin.fail:
- name: Get a list of enabled and disabled features
ansible.builtin.command: /usr/sbin/icinga2 feature list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment