Zum Inhalt

Portainer role

Deploy Portainer CE (Community Edition) as a Docker container management UI with automatic Traefik reverse proxy integration.

Usage

Configure the deployment in your inventory:

1
2
3
4
# host_vars/docker01.yml
portainer_hostname: portainer
portainer_enabled: true
portainer_uninstall: true

Include the role in your playbook:

1
2
3
4
# playbooks/proxmox/deploy_docker_base.yml
- hosts: docker_base
  roles:
    - role: portainer

The role provides these tags: - portainer-install - Deploy Portainer stack - portainer-uninstall - Remove Portainer stack

Docs

Deploy Portainer to your Docker host:

1
ansible-playbook -i inventory/hosts.yml playbooks/proxmox/deploy_docker_base.yml --tags portainer-install

Remove Portainer installation:

1
ansible-playbook -i inventory/hosts.yml playbooks/proxmox/deploy_docker_base.yml --tags portainer-uninstall

Configuration Details

The role deploys Portainer with: - Traefik Integration: Automatic HTTP to HTTPS redirect via Traefik labels - Docker Socket Access: Direct access to Docker daemon via /var/run/docker.sock - Persistent Storage: Data volume for Portainer configuration and state - Custom Image: Uses internal Gitea registry (gitea.rwcloud.ch/official-docker-images/portainer/portainer-ce:latest) - Network: Connects to external proxy network for Traefik routing

Accessing Portainer

After deployment, Portainer is available at: - URL: https://portainer.rwcloud.ch (configured via Traefik labels) - Port: Internal port 9000 (not exposed publicly, only via Traefik)

On first access, you'll need to create an admin account.