Skip to content

Commit dd873ab

Browse files
committed
base_image: add become privileges for custom image setup
Add become: true to tasks that require elevated privileges: - Directory creation in libvirt storage path - Writing to /etc/virt-builder/repos.d/ This fixes permission errors in CI environments where these operations need root privileges to access system directories. Resolves: PermissionError when creating custom image directories Generated-by: Claude AI Signed-off-by: Daniel Gomez <[email protected]>
1 parent 119812a commit dd873ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

playbooks/roles/base_image/tasks/custom-image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
custom_image_dir: "{{ kdevops_storage_pool_path }}/guestfs/custom_images/{{ base_image_os_version }}"
55

66
- name: Ensure the custom image directory exists
7+
become: true
78
ansible.builtin.file:
89
path: "{{ custom_image_dir }}"
910
state: directory
@@ -172,6 +173,7 @@
172173
register: custom_source_stat
173174

174175
- name: Build the custom source
176+
become: true
175177
ansible.builtin.template:
176178
src: "{{ role_path }}/templates/custom-source.j2"
177179
dest: "{{ custom_source }}"

0 commit comments

Comments
 (0)