From 1088c7c0e3ac554f8d6df46059650794794d62ba Mon Sep 17 00:00:00 2001 From: Michael Buluma Date: Sat, 13 Jul 2024 13:19:21 +0300 Subject: [PATCH] Update role --- .ansible-lint | 1 - .github/workflows/molecule.yml | 18 +++++++++-------- .yamllint | 36 ++++++++++++++++++++++------------ README.md | 6 +++--- handlers/main.yml | 2 +- meta/exception.yml | 14 ------------- meta/main.yml | 4 +++- meta/preferences.yml | 2 -- tasks/assert.yml | 2 +- tasks/main.yml | 4 ++-- vars/main.yml | 1 + 11 files changed, 44 insertions(+), 46 deletions(-) delete mode 100644 meta/exception.yml delete mode 100644 meta/preferences.yml diff --git a/.ansible-lint b/.ansible-lint index f179ac0..8115c55 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -3,7 +3,6 @@ # Ansible managed # exclude_paths: - - meta/preferences.yml - molecule/default/prepare.yml - molecule/default/converge.yml - molecule/default/verify.yml diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 8ec0050..a5cb22e 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -12,7 +12,6 @@ on: - main - testing - dependabot/** - # - renovate/** paths-ignore: - '**/README.md' - '**/CHANGELOG.md' @@ -21,8 +20,7 @@ on: pull_request: pull_request_target: schedule: - # - cron: '7 4 4 * *' - - cron: '7 4 * * *' + - cron: '7 4 4/4 * *' workflow_dispatch: @@ -36,10 +34,10 @@ jobs: lint: runs-on: ubuntu-20.04 steps: - - name: checkout + - name: Checkout Role uses: actions/checkout@v4 - - name: ansible-lint - uses: ansible-community/ansible-lint-action@main + - name: Run Ansible-lint + uses: ansible/ansible-lint@v24.7.0 test: needs: - lint @@ -50,20 +48,24 @@ jobs: config: - image: "docker-molecule-images" tag: "bullseye" - - image: "enterpriselinux" - tag: "8" - image: "enterpriselinux" tag: "latest" - image: "docker-molecule-images" tag: "fedora39" - image: "docker-molecule-images" tag: "fedora38" + - image: "docker-molecule-images" + tag: "fedora40" - image: "docker-molecule-images" tag: "jammy" - image: "docker-molecule-images" tag: "focal" - image: "docker-molecule-images" tag: "bionic" + - image: "docker-molecule-images" + tag: "noble" + - image: "docker-molecule-images" + tag: "lunar" steps: - name: Checkout Role uses: actions/checkout@v4 diff --git a/.yamllint b/.yamllint index 1460f2c..8818ebd 100644 --- a/.yamllint +++ b/.yamllint @@ -1,17 +1,27 @@ --- extends: default - +# https://ansible.readthedocs.io/projects/lint/rules/yaml/#octals rules: + comments: + # https://github.com/prettier/prettier/issues/6780 + min-spaces-from-content: 1 + # https://github.com/adrienverge/yamllint/issues/384 + comments-indentation: false + document-start: disable + # 160 chars was the default used by old E204 rule, but + # you can easily change it or disable in your .yamllint file. + line-length: + max: 200 + # We are adding an extra space inside braces as that's how prettier does it + # and we are trying not to fight other linters. braces: - max-spaces-inside: 1 - level: error - brackets: - max-spaces-inside: 1 - level: error - line-length: disable - truthy: - check-keys: false - -ignore: | - .tox/ - .cache/ + min-spaces-inside: 0 # yamllint defaults to 0 + max-spaces-inside: 1 # yamllint defaults to 0 + # key-duplicates: + # forbid-duplicated-merge-keys: true # not enabled by default + octal-values: + forbid-implicit-octal: true # yamllint defaults to false + forbid-explicit-octal: true # yamllint defaults to false + # quoted-strings: + # quote-type: double + # required: only-when-needed diff --git a/README.md b/README.md index 828b552..f2c6fb8 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,9 @@ This role has been tested on these [container images](https://hub.docker.com/u/b |container|tags| |---------|----| |[Debian](https://hub.docker.com/r/buluma/debian)|bullseye| -|[EL](https://hub.docker.com/r/buluma/enterpriselinux)|8, 9| -|[Fedora](https://hub.docker.com/r/buluma/fedora)|39, 38| -|[Ubuntu](https://hub.docker.com/r/buluma/ubuntu)|jammy, focal, bionic| +|[EL](https://hub.docker.com/r/buluma/enterpriselinux)|9| +|[Fedora](https://hub.docker.com/r/buluma/fedora)|39, 38, 40| +|[Ubuntu](https://hub.docker.com/r/buluma/ubuntu)|jammy, focal, bionic, noble, lunar| The minimum version of Ansible required is 2.12, tests have been done to: diff --git a/handlers/main.yml b/handlers/main.yml index 288f2ba..66f8ed2 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -8,4 +8,4 @@ - name: Apt update cache ansible.builtin.apt: - update_cache: yes + update_cache: true diff --git a/meta/exception.yml b/meta/exception.yml deleted file mode 100644 index c28b0fa..0000000 --- a/meta/exception.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -exceptions: - - variation: Alpine - reason: Not supported. - - variation: Archlinux - reason: Not supported. - - variation: Debian unstable - reason: Not supported. - - variation: CentOS 8 - reason: Not supported. - - variation: OpenSUSE Leap - reason: Not supported. - - variation: Ubuntu devel - reason: Not supported. diff --git a/meta/main.yml b/meta/main.yml index 7d8727b..094026c 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -13,17 +13,19 @@ galaxy_info: - bullseye - name: EL versions: - - "8" - "9" - name: Fedora versions: - "39" - "38" + - "40" - name: Ubuntu versions: - jammy - focal - bionic + - noble + - lunar galaxy_tags: - dockerce diff --git a/meta/preferences.yml b/meta/preferences.yml deleted file mode 100644 index e7fdebf..0000000 --- a/meta/preferences.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -tox_parallel: yes diff --git a/tasks/assert.yml b/tasks/assert.yml index b512c78..e3bc834 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -4,6 +4,6 @@ ansible.builtin.assert: that: - docker_ce_privileged_users is iterable - quiet: yes + quiet: true when: - docker_ce_privileged_users is defined diff --git a/tasks/main.yml b/tasks/main.yml index ac0a617..a2a3e20 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,7 +44,7 @@ ansible.builtin.user: name: "{{ user }}" groups: docker - append: yes + append: true loop: "{{ docker_ce_privileged_users }}" loop_control: loop_var: user @@ -55,6 +55,6 @@ ansible.builtin.service: name: "{{ docker_ce_service }}" state: started - enabled: yes + enabled: true when: - ansible_connection not in [ "container", "docker", "community.docker.docker" ] diff --git a/vars/main.yml b/vars/main.yml index 5139f8e..b2e2f63 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -25,6 +25,7 @@ _docker_ce_dist: default: "{{ ansible_distribution | lower }}" Rocky: centos RedHat: rhel + OracleLinux: centos docker_ce_dist: "{{ _docker_ce_dist[ansible_distribution] | default(_docker_ce_dist['default']) }}"