diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..f296246 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,7 @@ +warn_list: + - role_vars_start_with_role_name # All role parameters must be named ^_.* + - vars_in_vars_files_have_valid_names # Variable in vars files must have valid name + - vars_should_not_be_used # vars should not be used + - experimental # all rules tagged as experimental + - ignore-errors # Use failed_when and specify error conditions instead of using ignore_errors + - no-handler # Tasks that run when changed should likely be handlers diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a2de7e..5f866e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,12 @@ jobs: pip install yamllint 'molecule[docker]~=3.5.2' ansible-core flake8 ansible-lint voluptuous pip install -r ansible_collections/middleware_automation/keycloak/requirements.txt + - name: Install ansible-lint custom rules + uses: actions/checkout@v2 + with: + repository: ansible-middleware/ansible-lint-custom-rules + path: ansible_collections/rules/ + - name: Create default collection path run: | mkdir -p /home/runner/.ansible/collections/ansible_collections diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 68adf70..d74888b 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -4,6 +4,8 @@ dependency: command: ansible-galaxy collection install -r molecule/default/requirements.yml -p $HOME/.ansible/collections --force-with-deps driver: name: docker +lint: | + ansible-lint -R -r ../../rules/ roles/* platforms: - name: instance image: registry.access.redhat.com/ubi8/ubi-init:latest