diff --git a/README.md b/README.md index 3c6f1e6..6b24bb5 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ docker_swarm_cluster_portainer_install: True docker_swarm_portainer_hostname: 'portainer-swarm.example.com' docker_swarm_portainer_additional_constraints: [] # - 'node.hostname != docker01' +docker_swarm_portainer_nfs_volume: false +docker_swarm_portainer_nfs_type: 'nfs4' +docker_swarm_portainer_nfs_o: 'nfsvers=4,addr=127.0.0.1,rw,nolock,soft' +docker_swarm_portainer_nfs_device: ':/tmp' docker_swarm_portainer_network: 'agent_network' docker_swarm_portainer_http_port: '9000' diff --git a/defaults/main.yml b/defaults/main.yml index dd2efb6..b090f7d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,28 +1,31 @@ --- -docker_swarm_cluster_haproxy_install: True +docker_swarm_cluster_haproxy_install: true # mesh, keepalive, global docker_swarm_haproxy_installation_type: 'global' # I did not find any way to make it dependant on docker_swarm_haproxy_installation_type -docker_swarm_haproxy_keepalive_installation: False +docker_swarm_haproxy_keepalive_installation: false docker_swarm_haproxy_swarm_port: '{{ docker_api_port }}' -docker_swarm_haproxy_plain_http_api: True +docker_swarm_haproxy_plain_http_api: true # -docker_swarm_expose_api_via_haproxy: True +docker_swarm_expose_api_via_haproxy: true docker_swarm_expose_api_hostname: 'swarm.example.com' docker_swarm_api_backend: 'dockersocket /var/run/docker.sock' -docker_swarm_api_accept_proxy: False -docker_swarm_api_check_availability: False +docker_swarm_api_accept_proxy: false +docker_swarm_api_check_availability: false docker_swarm_api_networks_acl: - '127.0.0.1/8' docker_swarm_api_haproxy_mode: http # Portainer -docker_swarm_cluster_portainer_install: True +docker_swarm_cluster_portainer_install: true docker_swarm_portainer_hostname: 'portainer-swarm.example.com' docker_swarm_portainer_additional_constraints: [] # - 'node.hostname != docker01' - +docker_swarm_portainer_nfs_volume: false +docker_swarm_portainer_nfs_type: 'nfs4' +docker_swarm_portainer_nfs_o: 'nfsvers=4,addr=127.0.0.1,rw,nolock,soft' +docker_swarm_portainer_nfs_device: ':/tmp' # This is ugly -docker_swarm_haproxy_shinyproxy_metrics: False +docker_swarm_haproxy_shinyproxy_metrics: false docker_swarm_portainer_network: 'agent_network' docker_swarm_portainer_http_port: '9000' @@ -32,5 +35,5 @@ docker_swarm_keepalived_vrouter_id: 205 docker_swarm_keepalived_floating_ip: '127.0.0.1/8' docker_swarm_keepalived_instance_name: 'VI_HAPROXY_1' docker_swarm_haproxy_loglevel: '{{ haproxy_loglevel }}' -docker_swarm_haproxy_http2_enabled: True -docker_swarm_haproxy_backends_redirect_to_https: True +docker_swarm_haproxy_http2_enabled: true +docker_swarm_haproxy_backends_redirect_to_https: true diff --git a/templates/portainer-agent-stack.yml.j2 b/templates/portainer-agent-stack.yml.j2 index 4b46a79..56a12c0 100644 --- a/templates/portainer-agent-stack.yml.j2 +++ b/templates/portainer-agent-stack.yml.j2 @@ -2,7 +2,15 @@ version: '3.2' volumes: portainer_data: - + {% if docker_swarm_portainer_nfs_volume %} + driver: local + driver_opts: + type: {{ docker_swarm_portainer_nfs_type }} + # o: "nfsvers=4,addr=146.48.123.250,rw,nolock,soft" + o: "{{ docker_swarm_portainer_nfs_o }}" + device: "{{ docker_swarm_portainer_nfs_device }}" + {% endif %} + networks: {{ haproxy_docker_overlay_network }}: external: true @@ -28,9 +36,6 @@ services: portainer: image: portainer/portainer-ce command: -H tcp://tasks.agent:9001 --tlsskipverify - #ports: - # - "{{ docker_swarm_portainer_http_port }}:9000" - # - "{{ docker_swarm_portainer_service_port }}:8000" volumes: - portainer_data:/data networks: