From a8e4d547b358942b1d0aec7a38ce66360bc96d4d Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 26 May 2023 16:27:39 +0200 Subject: [PATCH] Run portainer without haproxy. --- .vscode/settings.json | 3 +++ meta/main.yml | 16 ++++++---------- templates/portainer-agent-stack.yml.j2 | 13 +++++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..2de2499 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "ansible.python.interpreterPath": "/opt/local/bin/python3.10" +} \ No newline at end of file diff --git a/meta/main.yml b/meta/main.yml index f8fff78..1dcd976 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,21 +1,17 @@ galaxy_info: + role_name: docker_swarm + namespace: adellam author: Andrea Dell'Amico - description: Systems Architect + description: Role that configures a Docker Swarm cluster company: ISTI-CNR - - issue_tracker_url: https://redmine-s2i2s.isti.cnr.it/projects/provisioning - license: EUPL 1.2+ - - min_ansible_version: 2.8 - - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # + min_ansible_version: "2.9" platforms: - name: Ubuntu versions: - bionic + - focal + - jammy galaxy_tags: - docker diff --git a/templates/portainer-agent-stack.yml.j2 b/templates/portainer-agent-stack.yml.j2 index 2a67cb5..07fae5f 100644 --- a/templates/portainer-agent-stack.yml.j2 +++ b/templates/portainer-agent-stack.yml.j2 @@ -13,8 +13,11 @@ volumes: {% endif %} networks: +{% if docker_swarm_cluster_haproxy_install %} + {{ haproxy_docker_overlay_network }}: external: true +{% endif %} {{ docker_swarm_portainer_network }}: services: @@ -37,11 +40,21 @@ services: portainer: image: portainer/portainer-ce command: -H tcp://tasks.agent:9001 --tlsskipverify +{% if docker_swarm_cluster_haproxy_install %} + + ports: + - "9443:9443" + - "9000:9000" + - "8000:8000" +{% endif %} volumes: - portainer_server_data:/data networks: - {{ docker_swarm_portainer_network }} +{% if docker_swarm_cluster_haproxy_install %} + - {{ haproxy_docker_overlay_network }} +{% endif %} deploy: mode: replicated replicas: 1