31 lines
719 B
YAML
Executable File
31 lines
719 B
YAML
Executable File
---
|
|
- name: Install plugins-core to manage DNF repos
|
|
ansible.builtin.dnf:
|
|
name:
|
|
- dnf-plugins-core
|
|
|
|
- name: Add Docker repo
|
|
ansible.builtin.command: dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
|
|
|
- name: Install Docker Engine
|
|
ansible.builtin.dnf:
|
|
name:
|
|
- install
|
|
- docker-ce
|
|
- docker-ce-cli
|
|
- containerd.io
|
|
- docker-buildx-plugin
|
|
- docker-compose-plugin
|
|
|
|
- name: Enable and start Docker Engine
|
|
ansible.builtin.systemd_service:
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Verify with Hello World
|
|
ansible.builtin.command: docker run hello-world
|
|
register: docker_out
|
|
|
|
- ansible.builtin.debug:
|
|
var: docker_out
|