I'm trying to install a docker-ce specific version but after running the playbook it keeps instaling the latest.
Let me know what I'm doing wrong :)
---
- hosts: localhost
tasks:
- name: Install dep
apt:
name:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- python3-setuptools
state: latest
update_cache: true
- name: Install python dep
become: true
apt:
update_cache: yes
state: latest
name: python3-pip
- name: Install 'Docker SDK for Python'
pip:
name:
- docker
- docker-compose
- name: Install Docker Key
become: true
apt_key:
url: 'https://download.docker.com/linux/ubuntu/gpg'
state: present
- name: Add docker repo
become: true
apt_repository:
repo: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable'
state: present
filename: docker-ce
- name: Install docker-ce
become: true
apt:
name: docker-ce=5:24.0.2-1~ubuntu.20.04~focal
state: present
After checking the docker version I get 24.0.6 instead of 24.0.2