Skip to content

Commit f925f93

Browse files
authored
Merge pull request #255 from stackhpc/fix/fatimage
Use environment hooks when building "fat" image
2 parents 416b440 + a38fe44 commit f925f93

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

ansible/fatimage.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
# Builder version of site.yml just installing binaries
22

3+
- name: Run pre.yml hook
4+
vars:
5+
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
6+
hook_path: "{{ appliances_environment_root }}/hooks/pre.yml"
7+
import_playbook: "{{ hook_path if hook_path | exists else 'noop.yml' }}"
8+
when: hook_path | exists
9+
310
- import_playbook: bootstrap.yml
411

12+
- name: Run post-bootstrap.yml hook
13+
vars:
14+
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
15+
hook_path: "{{ appliances_environment_root }}/hooks/post-bootstrap.yml"
16+
import_playbook: "{{ hook_path if hook_path | exists else 'noop.yml' }}"
17+
when: hook_path | exists
18+
519
- hosts: builder
620
become: yes
721
gather_facts: no
@@ -118,6 +132,17 @@
118132

119133
# - import_playbook: iam.yml - nothing to do
120134

135+
- name: Run post.yml hook
136+
vars:
137+
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
138+
hook_path: "{{ appliances_environment_root }}/hooks/post.yml"
139+
import_playbook: "{{ hook_path if hook_path | exists else 'noop.yml' }}"
140+
when: hook_path | exists
141+
142+
- hosts: builder
143+
become: yes
144+
gather_facts: no
145+
tasks:
121146
- name: Cleanup image
122147
import_tasks: cleanup.yml
123148

environments/.stackhpc/hooks/pre.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- hosts: control
1+
- hosts: control:!builder
22
become: yes
33
gather_facts: false
44
tasks:

packer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Building an environment-specific compute node image will[^1] require a cluster t
3939
- Build images using the variable definition file:
4040

4141
cd packer
42-
PACKER_LOG=1 /usr/bin/packer build -except openstack.fatimage --on-error=ask -var-file=$PKR_VAR_environment_root/builder.pkrvars.hcl openstack.pkr.hcl
42+
PACKER_LOG=1 /usr/bin/packer build -except openstack.openhpc --on-error=ask -var-file=$PKR_VAR_environment_root/builder.pkrvars.hcl openstack.pkr.hcl
4343

4444
Note the builder VMs are added to the `builder` group to differentiate them from "real" nodes - see developer notes below.
4545

0 commit comments

Comments
 (0)