Raspberry-Pi-IaC/roles/portainer/tasks/main.yml
Thomas Kleinendorst 48d5eb83d3 Add Portainer
2025-01-07 13:07:46 +01:00

27 lines
918 B
YAML

---
- name: Create portainer volume
become: true
community.docker.docker_volume:
volume_name: portainer_data
- name: Install the container
become: true
community.docker.docker_container:
name: portainer
image: "portainer/portainer-ce:{{ versions.portainer }}"
ports:
# - "127.0.0.1:9443:9443/tcp" # TCP port, not used
# But the opened http port is only opened for "legacy reasons", see: https://docs.portainer.io/start/install-ce/server/docker/linux
- "127.0.0.1:9000:9000/tcp"
mounts:
- source: portainer_data
target: /data
- source: /var/run/docker.sock
target: /var/run/docker.sock
type: bind
restart_policy: always
- name: Include simple-reverse-proxy role
ansible.builtin.include_role:
name: simple-reverse-proxy
vars:
simple_reverse_proxy_internal_port: 9000
simple_reverse_proxy_internal_subdomain: portainer