From 6c891d34b51a9306475d77d7bad275963a2b4212 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
Date: Thu, 13 Jun 2024 19:42:47 +0000
Subject: [PATCH] Support both IPv4/IPv6 proxy universally in CVMFS setup

---
 cesnet-central/playbooks/cvmfs.yaml | 4 ++--
 requirements.yml                    | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cesnet-central/playbooks/cvmfs.yaml b/cesnet-central/playbooks/cvmfs.yaml
index fceb710..26eb1a8 100644
--- a/cesnet-central/playbooks/cvmfs.yaml
+++ b/cesnet-central/playbooks/cvmfs.yaml
@@ -28,7 +28,7 @@
         mode: 0644
         content: |
           Acquire::http::Proxy {
-              cvmrepo.web.cern.ch "http://[{{ groups['ingress'][0] }}]:3128";
+              cvmrepo.web.cern.ch "http://{{ groups['ingress'][0] | ansible.utils.ipwrap }}:3128";
           };
     - name: Install and setup cvmfs apt repository
       vars:
@@ -55,7 +55,7 @@
         dest: /etc/cvmfs/default.local
         mode: 0644
         content: |
-          CVMFS_HTTP_PROXY=http://[{{ groups['ingress'][0] }}]:3128
+          CVMFS_HTTP_PROXY=http://{{ groups['ingress'][0] | ansible.utils.ipwrap }}:3128
     - name: Setup and mount cvmfs repository {{ item }}
       ansible.posix.mount:
         path: /cvmfs/{{ item }}
diff --git a/requirements.yml b/requirements.yml
index 67d45d3..afe4528 100644
--- a/requirements.yml
+++ b/requirements.yml
@@ -1,6 +1,7 @@
 ---
 collections:
   - ansible.posix
+  - ansible.utils
   - community.general
   - community.hashi_vault
 roles:
-- 
GitLab