Add Portainer

This commit is contained in:
Thomas Kleinendorst 2025-01-07 13:07:37 +01:00
parent b707ef2d6e
commit 48d5eb83d3
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,27 @@
---
- 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