From d834a55b2b6b61320321223e7d8aef9614f6e1cf Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 19 Aug 2024 16:06:18 +0200 Subject: [PATCH] refctor: rework ci to ue ansible-lint and fix molecule --- .later.yml | 15 --------------- .woodpecker/docs.yaml | 10 +++++----- .woodpecker/lint.yaml | 6 +++--- .yamllint | 20 ++++++++++++++++++++ meta/main.yml | 2 -- tasks/debian.yml | 2 +- tasks/main.yml | 3 ++- tasks/redhat.yml | 2 +- 8 files changed, 32 insertions(+), 28 deletions(-) delete mode 100644 .later.yml create mode 100644 .yamllint diff --git a/.later.yml b/.later.yml deleted file mode 100644 index 2703cb9..0000000 --- a/.later.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -ansible: - custom_modules: - - iptables_raw - - openssl_pkcs12 - - proxmox_kvm - - ucr - - corenetworks_dns - - corenetworks_token - -rules: - exclude_files: - - "LICENSE*" - - "**/*.md" - - "**/*.ini" diff --git a/.woodpecker/docs.yaml b/.woodpecker/docs.yaml index 9a20b42..ec71c9b 100644 --- a/.woodpecker/docs.yaml +++ b/.woodpecker/docs.yaml @@ -9,11 +9,11 @@ steps: - name: generate image: quay.io/thegeeklab/ansible-doctor environment: - ANSIBLE_DOCTOR_EXCLUDE_FILES: molecule/ - ANSIBLE_DOCTOR_FORCE_OVERWRITE: "true" - ANSIBLE_DOCTOR_LOG_LEVEL: INFO - ANSIBLE_DOCTOR_ROLE_NAME: ${CI_REPO_NAME} - ANSIBLE_DOCTOR_TEMPLATE: readme + ANSIBLE_DOCTOR_EXCLUDE_FILES: "['molecule/']" + ANSIBLE_DOCTOR_RENDERER__FORCE_OVERWRITE: "true" + ANSIBLE_DOCTOR_LOGGING__LEVEL: info + ANSIBLE_DOCTOR_ROLE__NAME: ${CI_REPO_NAME} + ANSIBLE_DOCTOR_TEMPLATE__NAME: readme - name: format image: quay.io/thegeeklab/alpine-tools diff --git a/.woodpecker/lint.yaml b/.woodpecker/lint.yaml index 36b1ec8..c48a8e4 100644 --- a/.woodpecker/lint.yaml +++ b/.woodpecker/lint.yaml @@ -6,10 +6,10 @@ when: - ${CI_REPO_DEFAULT_BRANCH} steps: - - name: ansible-later - image: quay.io/thegeeklab/ansible-later:4 + - name: ansible-lint + image: quay.io/thegeeklab/ansible-dev-tools:1 commands: - - ansible-later + - ansible-lint environment: FORCE_COLOR: "1" diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..df1d39e --- /dev/null +++ b/.yamllint @@ -0,0 +1,20 @@ +--- +extends: default + +rules: + truthy: + allowed-values: ["True", "False"] + comments: + min-spaces-from-content: 1 + comments-indentation: False + line-length: disable + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + indentation: enable + octal-values: + forbid-implicit-octal: True + forbid-explicit-octal: True diff --git a/meta/main.yml b/meta/main.yml index 441a051..97deb47 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -21,5 +21,3 @@ galaxy_info: - system - upgrade dependencies: [] -collections: - - community.general diff --git a/tasks/debian.yml b/tasks/debian.yml index 2a541db..d0ecb6e 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -7,7 +7,7 @@ - name: Upgrade packages ansible.builtin.apt: - update_cache: yes + update_cache: True upgrade: dist - name: Remove package lock diff --git a/tasks/main.yml b/tasks/main.yml index bb684e8..c17d0e5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,6 @@ --- -- ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" +- name: Manage packages + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: params: files: diff --git a/tasks/redhat.yml b/tasks/redhat.yml index 878aef2..76036b8 100644 --- a/tasks/redhat.yml +++ b/tasks/redhat.yml @@ -2,7 +2,7 @@ - name: Upgrade packages ansible.builtin.package: name: "*" - state: latest + state: latest # noqa package-latest exclude: "{{ update_packages_exclude }}" tags: - skip_ansible_later