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" docker_ubuntu_version: "27.3.1"
du_registry_mirrors: docker_ubuntu_registry_mirrors:
- https://docker.io - https://docker.io
- https://mirror.gcr.io - https://mirror.gcr.io

View File

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

View File

@@ -19,13 +19,13 @@
ansible.builtin.command: ansible.builtin.command:
cmd: "docker compose version" cmd: "docker compose version"
- name: "Check if Docker has the expected version" # noqa: no-changed-when - name: "Get docker version" # noqa: no-changed-when
register: docker_version register: docker_ubuntu_current_version
ansible.builtin.command: ansible.builtin.command:
cmd: "docker version --format '{{ '{{' }} .Server.Version {{ '}}' }}'" cmd: "docker version --format '{{ '{{' }} .Server.Version {{ '}}' }}'"
- name: "Check if Docker has the expected version" # noqa: no-changed-when - name: "Check if Docker has the expected version" # noqa: no-changed-when
ansible.builtin.assert: ansible.builtin.assert:
that: "du_docker_version in docker_version.stdout" that: "docker_ubuntu_version in docker_ubuntu_current_version.stdout"
success_msg: "Docker has the expected version ({{ docker_version.stdout }} )" success_msg: "Docker has the expected version ({{ docker_ubuntu_current_version.stdout }} )"
fail_msg: "Unexpected Docker version ({{ docker_version.stdout }})" fail_msg: "Unexpected Docker version ({{ docker_ubuntu_current_version.stdout }})"

View File

@@ -35,8 +35,8 @@
notify: "Sanity check" notify: "Sanity check"
ansible.builtin.apt: ansible.builtin.apt:
pkg: pkg:
- docker-ce={{ du_docker_version_full }} - docker-ce={{ docker_ubuntu_version_full }}
- docker-ce-cli={{ du_docker_version_full }} - docker-ce-cli={{ docker_ubuntu_version_full }}
state: present state: present
update_cache: true update_cache: true

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 }}"