neuro_ansible/yaml_sub/install_docker.yaml

38 lines
1,017 B
YAML
Raw Normal View History

2024-03-29 20:39:51 +01:00
---
- name: remove other files
2024-04-04 13:54:30 +02:00
ansible.builtin.include_tasks: yaml_sub/myrepo_clean.yaml
2024-03-29 20:39:51 +01:00
- name: update file myrepo.repo
2024-04-04 13:54:30 +02:00
ansible.builtin.import_tasks: yaml_sub/myrepo_data.yaml
2024-03-29 20:39:51 +01:00
- name: install docker rpm
2024-04-04 13:54:30 +02:00
ansible.builtin.dnf:
2024-03-29 20:39:51 +01:00
name: "docker-ce,docker-ce-cli,docker-ce-rootless-extras,docker-buildx-plugin,docker-compose-plugin,python3,python3-pip,python3-requests"
state: latest
update_cache: true
skip_broken: true
nobest: false
allowerasing: true
enablerepo: "docker-ce-stable"
- name: make sure docker service unit is started
2024-04-04 13:54:30 +02:00
ansible.builtin.systemd_service:
2024-03-29 20:39:51 +01:00
state: started
name: docker
enabled: true
- name: Create portainer agent container
community.docker.docker_container:
name: portaineragent
image: portainer/agent:2.19.4
state: started
2024-04-12 17:41:51 +02:00
recreate: no
2024-03-29 20:39:51 +01:00
restart_policy: always
published_ports:
- "9001:9001/tcp"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes