christianlempa-boilerplates/ansible/deployment/portainer/deploy-portainer.yaml

20 lines
526 B
YAML
Raw Normal View History

---
2023-05-25 13:48:38 +02:00
- name: deploy portainer-ce latest
hosts: "{{ hosts }}"
become: yes
become_user: "{{ lookup('env','USER') }}"
tasks:
2023-05-25 13:48:38 +02:00
- name: create new volume
community.docker.docker_volume:
name: portainer-data
2023-05-25 13:48:38 +02:00
- name: deploy portainer
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
restart_policy: unless-stopped