From 5042bccaca166bf91768711f65baae22a87f1460 Mon Sep 17 00:00:00 2001 From: micafer Date: Thu, 11 Jan 2024 13:37:01 +0100 Subject: [PATCH 1/5] Improve tests --- .github/workflows/main.yaml | 9 ++++----- molecule/default/converge.yml | 8 ++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2219850..446a4a4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,9 +18,9 @@ jobs: matrix: distro: - centos8 - - centos7 + - rockylinux9 - ubuntu2004 - - ubuntu1804 + - ubuntu2204 steps: - name: Check out the codebase. @@ -49,10 +49,9 @@ jobs: matrix: distro: - centos8 - - centos7 - - ubuntu2204 + - rockylinux9 - ubuntu2004 - - ubuntu1804 + - ubuntu2204 steps: - name: Check out the codebase. diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index c7de34c..23ca864 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -65,3 +65,11 @@ that: - "'containerd.runtimes.nvidia' in slurpfile['content'] | b64decode" when: ansible_os_family == "Debian" and lookup('env','CONTAINERD') == "1" + + - command: docker-compose -v + changed_when: false + register: docker_compose_v + + - assert: + that: + - "docker_compose_version in docker_compose_v.stdout" From 3b499e66ad695a2a05a49244fca2dd071908b029 Mon Sep 17 00:00:00 2001 From: micafer Date: Thu, 11 Jan 2024 13:49:56 +0100 Subject: [PATCH 2/5] Fix docker py version --- tasks/docker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/docker.yml b/tasks/docker.yml index 6a62973..cbe0836 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -144,7 +144,11 @@ creates: /usr/bin/pip - name: Install dependencies for docker management pip3 - pip: name=docker,docker-compose executable=pip3 + pip: + name: + - docker<7.0.0 # Fix version to avoid errors in ansible docker_compose module + - docker-compose + executable: pip3 when: ansible_python.version.major > 2 - name: Remove docker-compose v1 bin From 861169c0970f83b5780e6329f1af4c95d9e33504 Mon Sep 17 00:00:00 2001 From: micafer Date: Thu, 11 Jan 2024 14:02:01 +0100 Subject: [PATCH 3/5] Improve tests --- molecule/default/converge.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 23ca864..0adc160 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -5,6 +5,7 @@ vars: ansible_python_interpreter: /usr/bin/python nvidia_driver_skip_reboot: yes + docker_compose_version: 2.23.2 tasks: - name: Link python raw: ls /usr/bin/python || { ls /usr/bin/python2 && ln -s /usr/bin/python2 /usr/bin/python; } || { ls /usr/bin/python3 && ln -s /usr/bin/python3 /usr/bin/python; } From 35e3f17a681417851593fdb16a630d4595f19116 Mon Sep 17 00:00:00 2001 From: micafer Date: Thu, 11 Jan 2024 15:29:05 +0100 Subject: [PATCH 4/5] Improve tests --- molecule/default/converge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 0adc160..01fede7 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -5,7 +5,7 @@ vars: ansible_python_interpreter: /usr/bin/python nvidia_driver_skip_reboot: yes - docker_compose_version: 2.23.2 + docker_compose_version: v2.23.2 tasks: - name: Link python raw: ls /usr/bin/python || { ls /usr/bin/python2 && ln -s /usr/bin/python2 /usr/bin/python; } || { ls /usr/bin/python3 && ln -s /usr/bin/python3 /usr/bin/python; } @@ -73,4 +73,4 @@ - assert: that: - - "docker_compose_version in docker_compose_v.stdout" + - "docker_compose_version[1:] in docker_compose_v.stdout" From 1ef471030311c2efbcca1737d37343e6fbedea10 Mon Sep 17 00:00:00 2001 From: micafer Date: Thu, 11 Jan 2024 15:36:13 +0100 Subject: [PATCH 5/5] Improve tests --- molecule/default/converge.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 01fede7..e8d713f 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -70,7 +70,9 @@ - command: docker-compose -v changed_when: false register: docker_compose_v + when: lookup('env','CONTAINERD') == "0" - assert: that: - "docker_compose_version[1:] in docker_compose_v.stdout" + when: lookup('env','CONTAINERD') == "0"