|
6 | 6 | tags: always |
7 | 7 | tags: always |
8 | 8 |
|
| 9 | +- name: Prepare directories variables |
| 10 | + set_fact: |
| 11 | + configs_dir: "{{ playbook_dir }}/tmp/configs/{{ inventory_hostname }}" |
| 12 | + dl_dir: "{{ playbook_dir }}/tmp/dl" |
| 13 | + build_dir: "{{ playbook_dir }}/tmp/build/{{ inventory_hostname }}" |
| 14 | + images_dir: "{{ playbook_dir }}/tmp/images" |
| 15 | + wikiupdater_dir: "{{ playbook_dir }}/tmp/wikiupdater" |
| 16 | + tags: always |
| 17 | + |
| 18 | +- name: Create directories |
| 19 | + file: |
| 20 | + path: "{{ item }}" |
| 21 | + state: directory |
| 22 | + mode: "755" |
| 23 | + loop: |
| 24 | + - "{{ configs_dir }}" |
| 25 | + - "{{ dl_dir }}" |
| 26 | + - "{{ build_dir }}" |
| 27 | + - "{{ images_dir }}" |
| 28 | + - "{{ wikiupdater_dir }}" |
| 29 | + tags: always |
| 30 | + |
9 | 31 | - name: Include tasks for conditional packages |
10 | 32 | include_tasks: |
11 | 33 | file: conditional_packages.yml |
12 | 34 | apply: |
13 | 35 | tags: always |
14 | 36 | tags: always |
15 | 37 |
|
16 | | -- name: Prepare some variables (1) |
17 | | - set_fact: |
18 | | - basedir: "{{ playbook_dir }}/tmp" |
19 | | - tags: always |
20 | | - |
21 | | -- name: Prepare some variables |
22 | | - set_fact: |
23 | | - configs_dir: "{{ basedir }}/configs/{{ inventory_hostname }}" |
24 | | - dl_dir: "{{ basedir }}/dl/" |
25 | | - build_dir: "{{ basedir }}/build/{{ inventory_hostname }}" |
26 | | - images_dir: "{{ basedir }}/images/" |
27 | | - wikiupdater_dir: "{{ basedir }}/wikiupdater/" |
| 38 | +- name: Debug hostvars |
| 39 | + copy: |
| 40 | + dest: "{{ images_dir }}/{{ inventory_hostname }}.json" |
| 41 | + content: "{{ hostvars[inventory_hostname] | to_json(indent=2) }}" |
28 | 42 | tags: always |
29 | 43 |
|
30 | 44 | - name: Create directory |
|
80 | 94 | tags: always |
81 | 95 | tags: always |
82 | 96 |
|
| 97 | +- name: Generate Imagebuilder command |
| 98 | + set_fact: |
| 99 | + make_command: > |
| 100 | + make image |
| 101 | + PROFILE='{{ override_target | default(model) }}' |
| 102 | + PACKAGES='{{ packages | join(" ") }}' |
| 103 | + DISABLED_SERVICES='{{ disabled_services | join(" ") }}' |
| 104 | + FILES='{{ configs_dir }}' 1>&2 |
| 105 | + tags: always |
| 106 | + |
| 107 | +- name: Debug Imagebuilder command |
| 108 | + debug: |
| 109 | + var: make_command |
| 110 | + tags: always |
| 111 | + |
83 | 112 | - name: Include image generation |
84 | 113 | include_tasks: |
85 | 114 | file: imagebuilder.yml |
|
0 commit comments