I don't know why when I run my ansible-playbook to install packages on ec2-instances using apt-get this appears.[WARNING]: Updating cache and auto-installing missing dependency: python3-apt fatal: [localhost]: FAILED! => {"changed": false, "cmd": "apt-get update", "msg": "[Errno 2] No such file or directory: b'apt-get'", "rc": 2}
.
Here is what my ansible code does to install packages on ubuntu.
- name: Install packages for jenkins-docker-worker
hosts:
- localhost
gather_facts: no
tasks:
- name: Install docker
apt:
name: docker
state: latest
- name: start docker
service:
name: docker
state: started
- name: Ensure group "docker" exists
group:
name: docker
state: present
0 Answers