fix ansible-lint errors

This commit is contained in:
Sergey Malyuk
2025-12-18 15:26:34 +03:00
parent 2c0224566e
commit 236c4cf189
7 changed files with 18 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
---
du_docker_version: "27.3.1"
du_registry_mirrors:
docker_ubuntu_version: "27.3.1"
docker_ubuntu_registry_mirrors:
- https://docker.io
- https://mirror.gcr.io

View File

@@ -10,8 +10,8 @@ galaxy_info:
platforms:
- name: "Ubuntu"
versions: [ "focal", "jammy", "noble" ]
versions: ["focal", "jammy", "noble"]
galaxy_tags: [ "docker" ]
galaxy_tags: ["docker"]
dependencies: []

View File

@@ -2,8 +2,8 @@
- name: Converge
hosts: all
roles:
- role: genlab.docker_ubuntu
du_docker_version: "27.3.1"
du_registry_mirrors:
- role: genlab.common.docker_ubuntu
docker_ubuntu_version: "27.3.1"
docker_ubuntu_registry_mirrors:
- https://docker.io
- https://mirror.gcr.io

View File

@@ -9,7 +9,7 @@
- name: "Include default vars"
ansible.builtin.include_vars:
dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/defaults/"
extensions: [ 'yml' ]
extensions: ['yml']
- name: "Sanity check Docker by running a `hello-world` container" # noqa: no-changed-when
ansible.builtin.command:
@@ -19,13 +19,13 @@
ansible.builtin.command:
cmd: "docker compose version"
- name: "Check if Docker has the expected version" # noqa: no-changed-when
register: docker_version
- name: "Get docker version" # noqa: no-changed-when
register: docker_ubuntu_current_version
ansible.builtin.command:
cmd: "docker version --format '{{ '{{' }} .Server.Version {{ '}}' }}'"
- name: "Check if Docker has the expected version" # noqa: no-changed-when
ansible.builtin.assert:
that: "du_docker_version in docker_version.stdout"
success_msg: "Docker has the expected version ({{ docker_version.stdout }} )"
fail_msg: "Unexpected Docker version ({{ docker_version.stdout }})"
that: "docker_ubuntu_version in docker_ubuntu_current_version.stdout"
success_msg: "Docker has the expected version ({{ docker_ubuntu_current_version.stdout }} )"
fail_msg: "Unexpected Docker version ({{ docker_ubuntu_current_version.stdout }})"

View File

@@ -35,8 +35,8 @@
notify: "Sanity check"
ansible.builtin.apt:
pkg:
- docker-ce={{ du_docker_version_full }}
- docker-ce-cli={{ du_docker_version_full }}
- docker-ce={{ docker_ubuntu_version_full }}
- docker-ce-cli={{ docker_ubuntu_version_full }}
state: present
update_cache: true
@@ -48,7 +48,7 @@
- name: "Install Python tools for Docker"
ansible.builtin.pip:
name: [ docker ]
name: [docker]
break_system_packages: true
- name: "Configure Docker daemon"

View File

@@ -1,3 +1,3 @@
{
"registry-mirrors": {{ du_registry_mirrors | to_json }}
"registry-mirrors": {{ docker_ubuntu_registry_mirrors | to_json }}
}

View File

@@ -1,2 +1,2 @@
---
du_docker_version_full: "5:{{ du_docker_version }}-1~ubuntu.{{ ansible_lsb.release }}~{{ ansible_lsb.codename }}"
docker_ubuntu_version_full: "5:{{ docker_ubuntu_version }}-1~ubuntu.{{ ansible_lsb.release }}~{{ ansible_lsb.codename }}"