2022-03-11 16:53:17 +01:00
|
|
|
---
|
2023-05-25 13:48:38 +02:00
|
|
|
- name: deploy portainer-ce latest
|
|
|
|
hosts: "{{ hosts }}"
|
2022-03-11 16:53:17 +01:00
|
|
|
become: yes
|
|
|
|
become_user: "{{ lookup('env','USER') }}"
|
|
|
|
tasks:
|
2023-05-25 13:48:38 +02:00
|
|
|
- name: create new volume
|
2022-03-11 16:53:17 +01:00
|
|
|
community.docker.docker_volume:
|
|
|
|
name: portainer-data
|
2023-05-25 13:48:38 +02:00
|
|
|
- name: deploy portainer
|
2022-03-11 16:53:17 +01:00
|
|
|
community.docker.docker_container:
|
|
|
|
name: portainer
|
|
|
|
image: "docker.io/portainer/portainer-ce"
|
|
|
|
ports:
|
|
|
|
- "9443:9443"
|
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
- portainer-data:/data
|
2024-02-22 19:01:59 +01:00
|
|
|
restart_policy: unless-stopped
|