Skip to content

Commit 52c1faa

Browse files
committed
Switch away from lookup()
Since we want to run some validations against `architecture` repository, we end calling the role against a remote node instead of localhost. The usage of `lookup()` breaks the loop, especially on Zuul: the `lookup()` is launched onto the zuul-executor node, where we don't manage anything, and may lead to multiple issues such as: - collection not present (it seems to be present, but still) - kubectl being missing from the path (seems to be present for now) - old kubectl not knowing about `kustomize` option Calling plain `shell` ensures we're running the build onto an environment we 100% manage and know.
1 parent 8958f87 commit 52c1faa

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

roles/kustomize_deploy/tasks/execute_step.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,17 @@
192192
path_join | realpath
193193
}}
194194
block:
195+
# We have to use plain `kubectl kustomize`: lookup would
196+
# be executed locally, on the ansible-controller. In CI,
197+
# that would be the zuul-executor, and we don't manage them,
198+
# leading to a risk to either NOT have kubectl, or an old,
199+
# deprecated version.
195200
- name: "Build kustomized content for {{ stage.path }}"
196-
ansible.builtin.copy:
197-
dest: "{{ _output }}"
198-
mode: "0644"
199-
content: >-
200-
{{
201-
lookup(
202-
'kubernetes.core.kustomize',
203-
dir=_chdir
204-
)
205-
}}
201+
ansible.builtin.shell:
202+
chdir: "{{ _chdir }}"
203+
cmd: |-
204+
set -o pipefail
205+
kubectl kustomize > {{ _output }}
206206
207207
- name: "Store kustomized content in artifacts for {{ stage.path }}"
208208
ansible.builtin.copy:

0 commit comments

Comments
 (0)