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 vault_file: vault_vars/qnap-vault.yml
portainer_required_templates: [] portainer_required_templates: []
#portainer_endpoint: 23 portainer_endpoint: 34
services: [] services: []
docker_compose_services: docker_compose_services:

@ -7,7 +7,7 @@ portainer_required_templates:
dest_directory: /etc/config/diun dest_directory: /etc/config/diun
handler: restart-diun handler: restart-diun
portainer_endpoint: 23 portainer_endpoint: 35
services: services:
- name: hasteypaste - name: hasteypaste
- name: diun - name: diun
@ -17,13 +17,6 @@ ansible_pull_path: /usr/local/bin/ansible-pull
backup_directories: [] backup_directories: []
cron_hour: "4" 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, # Note: this must be inline with the host name,
# this is a work around as it is not possible to template # this is a work around as it is not possible to template
# the name of the volume in the portainer task. # the name of the volume in the portainer task.

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

@ -42,8 +42,14 @@
roles: roles:
- role: setup_portainer - role: setup_portainer
tags: [services, 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. - name: Setup and deploy compose services.
hosts: dell 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