2017-08-28 15:31:54 +00:00
|
|
|
---
|
|
|
|
- name: Create Portainer Directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ portainer_data_directory }}"
|
|
|
|
|
|
|
|
- name: Portainer Docker Container
|
|
|
|
docker_container:
|
|
|
|
name: portainer
|
2020-09-07 18:23:06 +00:00
|
|
|
image: portainer/portainer-ce
|
2017-08-28 15:31:54 +00:00
|
|
|
pull: true
|
|
|
|
volumes:
|
|
|
|
- "{{ portainer_data_directory }}:/data:rw"
|
|
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
|
|
- "/etc/timezone:/etc/timezone:ro"
|
|
|
|
ports:
|
2020-01-05 21:47:40 +00:00
|
|
|
- "{{ portainer_port }}:9000"
|
2017-08-28 15:31:54 +00:00
|
|
|
restart_policy: unless-stopped
|
|
|
|
memory: 1g
|
2019-04-11 22:03:11 +00:00
|
|
|
labels:
|
|
|
|
traefik.enable: "{{ portainer_available_externally }}"
|
2021-01-19 17:18:12 +00:00
|
|
|
traefik.http.routers.portainer.rule: "Host(`{{ portainer_hostname }}.{{ ansible_nas_domain }}`)"
|
|
|
|
traefik.http.routers.portainer.tls.certresolver: "letsencrypt"
|
|
|
|
traefik.http.routers.portainer.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.portainer.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.services.portainer.loadbalancer.server.port: "9000"
|