adding portainer agent instead of exposing socket

authelia
chatton 2 years ago
parent f6274e8c06
commit f3c8366878

@ -2,7 +2,7 @@
vault_file: vault_vars/qnap-vault.yml
portainer_required_templates: []
#portainer_endpoint: 23
portainer_endpoint: 34
services: []
docker_compose_services:

@ -7,7 +7,7 @@ portainer_required_templates:
dest_directory: /etc/config/diun
handler: restart-diun
portainer_endpoint: 23
portainer_endpoint: 35
services:
- name: hasteypaste
- name: diun
@ -17,13 +17,6 @@ ansible_pull_path: /usr/local/bin/ansible-pull
backup_directories: []
cron_hour: "4"
# docker options
docker_daemon_options:
hosts:
- "tcp://0.0.0.0:2375"
- "unix:///var/run/docker.sock"
# Note: this must be inline with the host name,
# this is a work around as it is not possible to template
# the name of the volume in the portainer task.

@ -18,6 +18,10 @@ dell
[portainer]
qnap
[portainer_agent]
dell
snunmu
[docker]
qnap
snunmu

@ -42,8 +42,14 @@
roles:
- role: setup_portainer
tags: [services, portainer]
vars:
portainer_version: "2.18.3"
- name: Install Portainer agent on Portainer agent hosts.
gather_facts: false
hosts: portainer_agent
become: true
roles:
- role: setup_portainer_agent
tags: [services, portainer_agent]
- name: Setup and deploy compose services.
hosts: dell

@ -0,0 +1,2 @@
---
portainer_version: 2.18.3

@ -0,0 +1,2 @@
---
portainer_agent_version: 2.18.3

@ -0,0 +1,16 @@
---
- name: Portainer Agent
community.docker.docker_compose:
project_name: portainer_agent
definition:
version: '3.3'
services:
agent:
ports:
- '9001:9001'
container_name: portainer_agent
restart: always
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/var/lib/docker/volumes:/var/lib/docker/volumes'
image: 'portainer/agent:{{ portainer_agent_version }}'
Loading…
Cancel
Save