30 lines
979 B
YAML
30 lines
979 B
YAML
---
|
|
- name: Create directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- "{{ data_folder }}/portainer"
|
|
|
|
- name: Create Portainer Container
|
|
docker_container:
|
|
name: portainer
|
|
image: portainer/portainer-ce:2.21.1
|
|
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
|
|
|