/
dib_build.yml
71 lines (62 loc) · 2.41 KB
/
dib_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
# workarounds to not include a bunch of DIB elements with a single line of bash
- name: Template script with workarounds for overcloud-full image
template:
src: "{{ artib_dib_workaround_script }}"
dest: "{{ artib_working_dir }}/dib-workaround.sh"
- name: DIB workarounds
shell: >
virt-customize {{ artib_vc_args }} -a overcloud-base.qcow2
--run dib-workaround.sh > dib-workaround.sh.log 2>&1
environment:
LIBGUESTFS_BACKEND: direct
when: artib_dib_workarounds
args:
chdir: "{{ artib_working_dir }}"
- name: script to prepare for image building with DIB
template:
src: "{{ artib_dib_prepare_script }}"
dest: "{{ artib_working_dir }}/dib-prepare-script.sh"
mode: 0744
- name: Run DIB prep script
shell: ./dib-prepare-script.sh > buildhost.dib-prepare-script.sh.log 2>&1
become: true
args:
chdir: "{{ artib_working_dir }}"
- name: ensure we can sudo without requiring tty for async tasks
lineinfile:
dest: /etc/sudoers
line: '#Defaults requiretty'
regexp: '^Defaults\s+requiretty'
backup: yes
become: true
# default is templates/dib-manifest-default.yaml.j2
- name: Create yaml manifest for DIB invocation (tripleo-common)
template:
src: "{{ artib_image_yaml_template }}"
dest: "{{ artib_working_dir }}/dib-manifest.yml"
# default / legacy mechanism for ARTIB, which calls tripleo-common python class
- name: Build the images using ansible library module (tripleo-build-images via python)
tripleo_build_images:
config_files:
- "{{ artib_working_dir }}/dib-manifest.yml"
output_directory: "{{ artib_working_dir }}"
when: artib_overcloud_build_mode == "python_module_tripleo_build_images"
# official mechanism for OSP 9/10 for overcloud image build. This is only valid for mitaka/newton
- name: Build the images using TBI
shell: |
tripleo-build-images --image-config-file dib-manifest.yml > tbi.log 2>&1
when:
- artib_overcloud_build_mode=="tripleo_build_images"
- artib_release in ["newton", "mitaka"]
args:
chdir: "{{ artib_working_dir }}"
# supported upstream tripleo method for overcloud image build. This is only valid for ocata+
- name: Build the images using OOIB
shell: |
openstack overcloud image build --config-file dib-manifest.yml > ooib.log 2>&1
when:
- artib_overcloud_build_mode=="openstack_overcloud_image_build"
- artib_release not in ["newton", "mitaka"]
args:
chdir: "{{ artib_working_dir }}"