Skip to content

Commit a3d4e43

Browse files
Consider that the zuul executor may be an IP
Exposed a variable to pass the API endpoint without computing it too.
1 parent 19910b3 commit a3d4e43

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ci/playbooks/multinode-autohold.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@
2020
block:
2121
- name: Fetch existing autoholds from zuul
2222
vars:
23+
_zuul_host: >-
24+
{{
25+
zuul.executor.hostname
26+
if (zuul.executor.hostname is ansible.utils.ip) else
27+
(zuul.executor.hostname | split('.'))[1:] | join('.')
28+
}}
2329
_zuul_api_url: >-
2430
{{
2531
[
26-
('https://'+ (zuul.executor.hostname | split('.'))[1:] | join('.')),
32+
('https://'+ _zuul_host,
2733
'zuul',
2834
'api',
2935
'tenant',
@@ -32,7 +38,7 @@
3238
] | join('/')
3339
}}
3440
ansible.builtin.uri:
35-
url: "{{ _zuul_api_url }}"
41+
url: "{{ zuul_autohold_endpoint | default(_zuul_api_url) }}"
3642
method: GET
3743
headers:
3844
Content-Type: "application/json"

0 commit comments

Comments
 (0)