From 64288dda6cbcc729b74ca33ab7a000b1fc7609ea Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 5 Feb 2024 22:30:10 +0100 Subject: [PATCH 1/5] chore: upgrade flake lock file --- flake.lock | 92 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 37 deletions(-) diff --git a/flake.lock b/flake.lock index 526cd37..28755a1 100644 --- a/flake.lock +++ b/flake.lock @@ -2,15 +2,15 @@ "nodes": { "devshell": { "inputs": { - "nixpkgs": "nixpkgs", - "systems": "systems" + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1692793255, - "narHash": "sha256-yVyj0AE280JkccDHuG1XO9oGxN6bW8ksr/xttXcXzK0=", + "lastModified": 1705332421, + "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", "owner": "numtide", "repo": "devshell", - "rev": "2aa26972b951bc05c3632d4e5ae683cb6771a7c6", + "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", "type": "github" }, "original": { @@ -22,11 +22,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -40,11 +40,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1690933134, - "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -53,15 +53,33 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems_2" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -78,11 +96,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", "type": "github" }, "original": { @@ -93,11 +111,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1677383253, - "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", + "lastModified": 1704161960, + "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", + "rev": "63143ac2c9186be6d9da6035fa22620018c85932", "type": "github" }, "original": { @@ -110,11 +128,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1690881714, - "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e1960bc196baf6881340d53dccb203a951745a2", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -127,27 +145,27 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1693377291, - "narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=", + "lastModified": 1706913249, + "narHash": "sha256-x3M7iV++CsvRXI1fpyFPduGELUckZEhSv0XWnUopAG8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e7f38be3775bab9659575f192ece011c033655f0", + "rev": "e92b6015881907e698782c77641aa49298330223", "type": "github" }, "original": { @@ -159,11 +177,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1689261696, - "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", + "lastModified": 1704842529, + "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", "type": "github" }, "original": { @@ -176,17 +194,17 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "gitignore": "gitignore", "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1692274144, - "narHash": "sha256-BxTQuRUANQ81u8DJznQyPmRsg63t4Yc+0kcyq6OLz8s=", + "lastModified": 1706424699, + "narHash": "sha256-Q3RBuOpZNH2eFA1e+IHgZLAOqDD9SKhJ/sszrL8bQD4=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "7e3517c03d46159fdbf8c0e5c97f82d5d4b0c8fa", + "rev": "7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf", "type": "github" }, "original": { From c5f6a569bcaba329fb9960778810d174c1707aad Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 5 Feb 2024 22:50:50 +0100 Subject: [PATCH 2/5] ci: enable closing documents for ansible-later --- .later.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.later.yml b/.later.yml index 07e8dc4..1d2a51d 100644 --- a/.later.yml +++ b/.later.yml @@ -4,4 +4,8 @@ rules: - molecule/ubuntu/tests - README.md +yamllint: + document-end: + present: True + ... From 363904f52c7fd9ad09225f8b5f8b32ea5910b2c6 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 5 Feb 2024 22:57:03 +0100 Subject: [PATCH 3/5] ci: remove deprecated ansible-later standards version --- defaults/main.yml | 1 - handlers/main.yml | 1 - meta/main.yml | 1 - molecule/default/converge.yml | 1 - molecule/default/molecule.yml | 1 - molecule/default/prepare.yml | 1 - molecule/requirements.yml | 1 - tasks/main.yml | 1 - 8 files changed, 8 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b406cd5..e183a2f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- # @var docker_registries_general:description: List of general docker registries to auto login # @var docker_registries_general:example: > diff --git a/handlers/main.yml b/handlers/main.yml index 2b317a4..2c805a8 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- - name: Restart docker systemd: diff --git a/meta/main.yml b/meta/main.yml index e1769be..f29ebfd 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- # @meta author:value: [Thomas Boerger](https://github.com/tboerger) # @meta description: > diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 66a6007..118a7c0 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- - name: Converge hosts: all diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index f619586..15b4b73 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- dependency: name: galaxy diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index b62373a..113c1b0 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- - name: Prepare hosts: all diff --git a/molecule/requirements.yml b/molecule/requirements.yml index 89d85f0..586fd81 100644 --- a/molecule/requirements.yml +++ b/molecule/requirements.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- collections: [] roles: [] diff --git a/tasks/main.yml b/tasks/main.yml index 25729e8..b50416a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,3 @@ -# Standards: 1.2 --- - name: Create required dirs loop: From e52293ee4bcb199030de9adbb4dfbc64959b0265 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Tue, 6 Feb 2024 09:18:45 +0100 Subject: [PATCH 4/5] major: used full qualified collection names --- .github/workflows/general.yml | 2 +- handlers/main.yml | 2 +- meta/requirements.yml | 7 ++++++ molecule/default/prepare.yml | 43 ++++++++++++++++++++++++++++++----- molecule/requirements.yml | 4 +++- tasks/main.yml | 24 +++++++++---------- 6 files changed, 61 insertions(+), 21 deletions(-) create mode 100644 meta/requirements.yml diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml index 15a2fbc..1860b14 100644 --- a/.github/workflows/general.yml +++ b/.github/workflows/general.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v4 - name: Role linting - uses: actionhippie/ansible-later@v2 + uses: actionhippie/ansible-later@v3 testing: runs-on: ubuntu-latest diff --git a/handlers/main.yml b/handlers/main.yml index 2c805a8..81fe759 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Restart docker - systemd: + ansible.builtin.systemd: name: docker state: restarted daemon_reload: True diff --git a/meta/requirements.yml b/meta/requirements.yml new file mode 100644 index 0000000..6986038 --- /dev/null +++ b/meta/requirements.yml @@ -0,0 +1,7 @@ +--- +collections: + - community.docker + +roles: [] + +... diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 113c1b0..28c7e4e 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -4,21 +4,52 @@ gather_facts: False tasks: + - name: Stat apt dir + register: aptdir + ansible.builtin.stat: + path: /var/lib/apt + - name: Wait for aptlock - shell: while fuser /var/lib/apt/lists/lock >/dev/null 2>&1; do echo 'Waiting for apt list lock.' && sleep 10; done + when: aptdir.stat.exists changed_when: False + ansible.builtin.shell: + cmd: while fuser /var/lib/apt/lists/lock >/dev/null 2>&1; do echo 'Waiting for apt list lock.' && sleep 10; done - name: Update package cache - apt: + when: aptdir.stat.exists + ansible.builtin.apt: update_cache: True - - name: Install gpg dependency - apt: - name: python3-gpg + - name: Install test dependencies + when: aptdir.stat.exists + loop: + - python3-gpg + - curl + ansible.builtin.apt: + name: "{{ item }}" state: present + - name: Create man dirs + changed_when: False + loop: + - /usr/share/man/man1 + - /usr/share/man/man2 + - /usr/share/man/man3 + - /usr/share/man/man4 + - /usr/share/man/man5 + - /usr/share/man/man6 + - /usr/share/man/man7 + - /usr/share/man/man8 + - /usr/share/man/man9 + ansible.builtin.file: + path: "{{ item }}" + owner: root + group: root + mode: u=rwx,g=rx,o=rx + state: directory + - name: Install curl dependency - apt: + ansible.builtin.apt: name: curl state: present diff --git a/molecule/requirements.yml b/molecule/requirements.yml index 586fd81..6986038 100644 --- a/molecule/requirements.yml +++ b/molecule/requirements.yml @@ -1,5 +1,7 @@ --- -collections: [] +collections: + - community.docker + roles: [] ... diff --git a/tasks/main.yml b/tasks/main.yml index b50416a..7f1f71a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,7 +3,7 @@ loop: - /etc/systemd/system/docker.service.d - /etc/docker - file: + ansible.builtin.file: path: "{{ item }}" state: directory owner: root @@ -13,7 +13,7 @@ - docker - name: Remove legacy repo - apt_repository: + ansible.builtin.apt_repository: repo: "deb [arch={{ docker_arch }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable" filename: docker update_cache: False @@ -25,7 +25,7 @@ loop: - /etc/apt/keyrings/docker.asc - /etc/apt/keyrings/docker.gpg - file: + ansible.builtin.file: path: "{{ item }}" state: absent tags: @@ -33,7 +33,7 @@ - name: Download repo key when: docker_upstream_version - shell: + ansible.builtin.shell: cmd: "curl -sSL 'https://download.docker.com/linux/ubuntu/gpg' | gpg --dearmor --output {{ docker_keyring }}" creates: "{{ docker_keyring }}" tags: @@ -41,7 +41,7 @@ - name: Add apt repository when: docker_upstream_version - apt_repository: + ansible.builtin.apt_repository: repo: "deb [arch={{ docker_arch }} signed-by={{ docker_keyring }}] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable" filename: docker update_cache: True @@ -54,7 +54,7 @@ - "{{ 'docker-ce' if docker_upstream_version else 'docker.io' }}" - python3-docker - python3-distutils - package: + ansible.builtin.package: name: "{{ item }}" state: present tags: @@ -64,7 +64,7 @@ when: docker_daemon_override notify: - Restart docker - template: + ansible.builtin.template: src: override.j2 dest: /etc/systemd/system/docker.service.d/override.conf owner: root @@ -76,7 +76,7 @@ - name: Write daemon config notify: - Restart docker - copy: + ansible.builtin.copy: content: "{{ docker_daemon_config | to_nice_json }}" dest: /etc/docker/daemon.json owner: root @@ -86,7 +86,7 @@ - docker - name: Start docker service - systemd: + ansible.builtin.systemd: name: docker state: started daemon_reload: True @@ -99,7 +99,7 @@ loop: "{{ docker_networks_general + docker_networks_extra }}" loop_control: label: "{{ item.name }}" - docker_network: + community.docker.docker_network: name: "{{ item.name }}" enable_ipv6: "{{ item.enable_ipv6 | default(False) }}" ipam_config: "{{ item.ipam_config | default([]) }}" @@ -116,7 +116,7 @@ register: docker_login_command changed_when: False failed_when: docker_login_command.rc != 0 - command: + ansible.builtin.command: cmd: "docker login --username {{ item.username | quote }} --password-stdin {{ item.url | default('') }}" stdin: "{{ item.password }}" tags: @@ -127,7 +127,7 @@ loop_control: label: "{{ item.url | default('hub.docker.com') }}" when: item.state | default('present') == 'absent' - docker_login: + community.docker.docker_login: registry: "{{ item.url | default(omit) }}" state: absent tags: From 4c3b5441fe0447bc3384f7d8384fa1da6a228e09 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Tue, 6 Feb 2024 09:30:45 +0100 Subject: [PATCH 5/5] major: drop support for ubuntu 18.04 --- meta/main.yml | 1 - molecule/default/molecule.yml | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index f29ebfd..63db3aa 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -27,7 +27,6 @@ galaxy_info: platforms: - name: Ubuntu versions: - - bionic - focal - jammy galaxy_tags: diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 15b4b73..cfd72f6 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -40,21 +40,6 @@ platforms: - /sys/fs/cgroup:/sys/fs/cgroup:rw environment: container: docker - - name: docker-ubuntu-18 - image: docker.io/geerlingguy/docker-ubuntu1804-ansible:latest - hostname: ubuntu - privileged: True - pre_build_image: True - override_command: False - cgroupns_mode: host - tmpfs: - - /tmp - - /run - - /run/lock - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - environment: - container: docker provisioner: name: ansible