Files
ansible-automations/roles/docker/tasks/check_version.yml
Noah Knegt 7f21037fac
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Remove the ignore errors flag
Signed-off-by: Noah Knegt <git@noahknegt.com>
2023-03-31 11:50:03 +02:00

29 lines
1.0 KiB
YAML

# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 31-03-2023
# @description : This will check if docker is installed as the latest version.
# ===================================================================================================
---
- name: Check docker version
shell: docker --version
register: docker_version
- name: Install jq
become: true
package:
name: jq
state: present
- name: Check if latest version is stable
shell: curl -s https://api.github.com/repos/docker/cli/tags | jq -r '.[0].name' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'
register: docker_latest_version_stable
- name: Compare versions
set_fact:
docker_update: true
when: docker_version.stdout is not defined or docker_version.stdout != docker_latest_version_stable.stdout