fix ansible-lint errors
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -10,8 +10,8 @@ galaxy_info:
|
||||
|
||||
platforms:
|
||||
- name: "Ubuntu"
|
||||
versions: [ "focal", "jammy", "noble" ]
|
||||
versions: ["focal", "jammy", "noble"]
|
||||
|
||||
galaxy_tags: [ "docker" ]
|
||||
galaxy_tags: ["docker"]
|
||||
|
||||
dependencies: []
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }})"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"registry-mirrors": {{ du_registry_mirrors | to_json }}
|
||||
"registry-mirrors": {{ docker_ubuntu_registry_mirrors | to_json }}
|
||||
}
|
||||
|
||||
@@ -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 }}"
|
||||
|
||||
Reference in New Issue
Block a user