Skip to content

Commit 8fd625e

Browse files
committed
Set APPLIANCES_ENVIRONMENT_ROOT
This allows the running of hook playbooks during image build.
1 parent b30ab7f commit 8fd625e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

roles/image_build/defaults/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ image_build_metadata: {}
1414
# The directory that contains the openstack.pkr.hcl to build the Slurm image
1515
image_build_packer_root_path: "{{ playbook_dir }}/vendor/stackhpc/ansible-slurm-appliance/packer"
1616

17+
# The appliances_environment_root directory. This may contain a hooks directory
18+
# optionally containing pre.yml, post-bootstrap.yml and post.yml playbooks, to
19+
# run during the image-build process
20+
image_build_appliances_environment_root: "{{ playbook_dir }}/image-build"
21+
1722
# Vars to apply to the builder group
1823
image_build_builder_group_vars:
1924
update_log_path: /tmp/update_log

roles/image_build/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
packer build -only openstack.openhpc -var-file={{ pkrvars_hcl_file.path }} openstack.pkr.hcl
7171
chdir: "{{ image_build_packer_root_path }}"
7272
environment:
73+
APPLIANCES_ENVIRONMENT_ROOT: "{{ image_build_appliances_environment_root }}"
7374
ANSIBLE_CONFIG: "{{ ansible_cfg_file.path }}"
7475
PACKER_LOG: "1"
7576
PACKER_LOG_PATH: "{{ lookup('ansible.builtin.env', 'PACKER_LOG_PATH', default='/tmp/packer-build.log') }}"

0 commit comments

Comments
 (0)