From f4322b526de4fb9d8cf9c2e40d2b98116b69a0aa Mon Sep 17 00:00:00 2001 From: Matthieu Huin Date: Wed, 15 Nov 2023 10:53:05 +0100 Subject: [PATCH] Ensure ansible-lint validates roles as well Change-Id: Id8ef04567f585b274cddc582e28c9eb9604f2a49 --- playbooks/ansible-dependencies.yaml | 7 +++++++ zuul.d/jobs.yaml | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 playbooks/ansible-dependencies.yaml diff --git a/playbooks/ansible-dependencies.yaml b/playbooks/ansible-dependencies.yaml new file mode 100644 index 00000000..92ed2698 --- /dev/null +++ b/playbooks/ansible-dependencies.yaml @@ -0,0 +1,7 @@ +--- +- hosts: "{{ hostname | default('controller') }}" + tasks: + - name: Ensure ansible-lint is installed + shell: type ansible-galaxy || pip install --user ansible-core + - name: install required collections + shell: ansible-galaxy collection install community.general community.crypto ansible.posix kubernetes.core \ No newline at end of file diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 5befed67..b339429a 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -111,11 +111,13 @@ name: sf-operator-ansible-lint description: Lint Ansible playbooks located in playbooks directory timeout: 900 + pre-run: playbooks/ansible-dependencies.yaml parent: ansible-lint vars: # NOTE(dpawlik): We don't need to add roles dir, due there is a symlink # done in playbooks that is related to roles dir. ansible_lint_playbooks_dir: playbooks + ansible_lint_roles_dir: roles ansible_lint_check_all: false nodeset: nodes: