christianlempa-boilerplates/ansible/deployment/portainer/deploy-portainer.yaml
Christoph Schug 38e065c218 fix: replace /var/run by /run
The use of `/var/run` was deprecated by FHS 3.0 nine years ago, so it's
time to finally get rid of it where possible. The canonical directory
for run-time variable data is `/run` nowadaya,s with `/var/run` just
being a symbolic link for backward compatibilty and to ease transition.
2024-06-04 11:55:20 +02:00

22 lines
562 B
YAML

---
- name: Deploy portainer-ce latest
hosts: "{{ my_hosts | d([]) }}"
become: true
become_user: "{{ lookup('env','USER') }}"
tasks:
- name: Create new volume
community.docker.docker_volume:
name: portainer-data
- name: Deploy portainer
community.docker.docker_container:
name: portainer
image: "docker.io/portainer/portainer-ce"
ports:
- "9443:9443"
volumes:
- /run/docker.sock:/var/run/docker.sock
- portainer-data:/data
restart_policy: unless-stopped