2024-09-09 22:37:51 +10:00
|
|
|
---
|
|
|
|
- name: Create directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ data_folder }}/portainer"
|
|
|
|
|
|
|
|
- name: Create Portainer Container
|
|
|
|
docker_container:
|
|
|
|
name: portainer
|
2024-09-10 08:00:56 +10:00
|
|
|
image: portainer/portainer-ce:2.21.1
|
2024-09-09 22:37:51 +10:00
|
|
|
command: --admin-password "{{PORTAINER_ADMIN_PASSWORD}}"
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
volumes:
|
|
|
|
- "{{ data_folder }}/portainer/data:/data"
|
|
|
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
|
|
networks:
|
|
|
|
- name: proxy
|
|
|
|
labels:
|
|
|
|
traefik.enable: "true"
|
|
|
|
traefik.http.routers.portainer-secure.rule: "Host(`{{portainer_host}}`)"
|
|
|
|
traefik.http.routers.portainer-secure.entrypoints: "https"
|
|
|
|
traefik.http.routers.portainer-secure.tls: "true"
|
|
|
|
traefik.http.routers.portainer-secure.service: "portainer"
|
|
|
|
traefik.http.services.portainer.loadbalancer.server.port: "9443"
|
|
|
|
traefik.http.services.portainer.loadbalancer.server.scheme: "https"
|
|
|
|
register: container_portainer
|
|
|
|
|