Skip to content

Commit 8a5f57e

Browse files
committed
run hooks in fat image build
1 parent 2aae21b commit 8a5f57e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
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

0 commit comments

Comments
 (0)