Skip to content

Commit 48be961

Browse files
committed
ci: untrusted run phase, use patch workspace roles
Set ansible_roles_path at play level to prepend patch workspace roles directory. This enables testing role changes in PRs during deploy and test phases while keeping trusted pre-run phase secure. Assisted-By: Claude Code/claude-4.5-sonnet Signed-off-by: Harald Jensås <hjensas@redhat.com>
1 parent 407e483 commit 48be961

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

ci/playbooks/run-deploy.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
hosts: hotstack
44
vars:
55
hotstack_work_dir: "{{ ansible_user_dir }}/hotstack"
6+
# Prepend patch workspace roles to search path to test PR changes.
7+
# Parent job's roles: directive loads main branch for security.
8+
ansible_roles_path: >-
9+
{{ zuul.projects['github.com/openstack-k8s-operators/hotstack'].src_dir }}/roles:{{
10+
lookup('env', 'ANSIBLE_ROLES_PATH') |
11+
default('/etc/ansible/roles:/usr/share/ansible/roles', true)
12+
}}
613
tasks:
714

815
- name: Fetch bootstrap vars from remote to zuul executor

ci/playbooks/run-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
hosts: hotstack
44
vars:
55
hotstack_work_dir: "{{ ansible_user_dir }}/hotstack"
6+
# Prepend patch workspace roles to search path to test PR changes.
7+
# Parent job's roles: directive loads main branch for security.
8+
ansible_roles_path: >-
9+
{{ zuul.projects['github.com/openstack-k8s-operators/hotstack'].src_dir }}/roles:{{
10+
lookup('env', 'ANSIBLE_ROLES_PATH') |
11+
default('/etc/ansible/roles:/usr/share/ansible/roles', true)
12+
}}
613
tasks:
714

815
- name: Fetch bootstrap vars from remote to zuul executor

0 commit comments

Comments
 (0)