Skip to content

WIP: CI: Ansible lint #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/stackhpc-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,46 @@ jobs:
- name: Run Tox ${{ matrix.environment }} 🧪
run: tox -e ${{ matrix.environment }}

lint:
runs-on: ubuntu-22.04
permissions: {}
strategy:
fail-fast: false
matrix:
include:
# NOTE(upgrade): Keep these in sync with Kayobe's supported Ansible and Python versions (see release notes).
- ansible: "2.12"
# ansible-lint 6+ is not supported on Python 3.8.
ansible-lint: "5"
python: "3.8"
- ansible: "2.13"
ansible-lint: "6"
python: "3.10"
name: Ansible ${{ matrix.ansible }} lint with Python ${{ matrix.python }}
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
steps:
- name: GitHub Checkout 🛎
uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install dependencies 📦
run: |
python -m pip install --upgrade pip
pip install ansible-core==${{ matrix.ansible }}.* ansible-lint==${{ matrix.ansible-lint }}.* -r requirements.txt

- name: Install Ansible Galaxy collections and roles
run: |
ansible-galaxy collection install -r etc/kayobe/ansible/requirements.yml
ansible-galaxy role install -r etc/kayobe/ansible/requirements.yml

- name: Linting code 🧪
run: |
ansible-lint -v --force-color etc/kayobe/ansible/

# A skipped job is treated as success when used as a required status check.
# The registered required status checks refer to the name of the job in the
# called reusable workflow rather than the jobs in this file. The following
Expand Down
2 changes: 1 addition & 1 deletion etc/kayobe/ansible/deploy-github-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tasks:
- name: Deploy runners
ansible.builtin.include_role:
role: monolithprojects.github_actions_runner
name: monolithprojects.github_actions_runner
vars:
runner_name: "{{ ansible_facts.nodename }}-{{ runner.key }}"
runner_dir: "{{ base_runner_dir }}/{{ runner.key }}"
Expand Down
10 changes: 5 additions & 5 deletions etc/kayobe/ansible/wazuh-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# Certificates generation
- hosts: localhost
roles:
- role: "{{ playbook_dir }}/roles/wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-indexer"
- role: "wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-indexer"
perform_installation: false
become: no
tags:
Expand All @@ -45,10 +45,10 @@
become: yes
become_user: root
roles:
- role: "{{ playbook_dir }}/roles/wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-indexer"
- role: "{{ playbook_dir }}/roles/wazuh-ansible/wazuh-ansible/roles/wazuh/ansible-wazuh-manager"
- role: "{{ playbook_dir }}/roles/wazuh-ansible/wazuh-ansible/roles/wazuh/ansible-filebeat-oss"
- role: "{{ playbook_dir }}/roles/wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-dashboard"
- role: "wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-indexer"
- role: "wazuh-ansible/wazuh-ansible/roles/wazuh/ansible-wazuh-manager"
- role: "wazuh-ansible/wazuh-ansible/roles/wazuh/ansible-filebeat-oss"
- role: "wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-dashboard"
post_tasks:
- block:
- name: Check if custom SCA policies directory exists
Expand Down
Loading