/
run-v3.yaml
65 lines (54 loc) · 2.51 KB
/
run-v3.yaml
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
- hosts: all
name: TripleO image building job
roles:
- role: bindep
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}"
- role: tripleo-repos
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
tasks:
- name: Include common buildimage vars
include_vars:
file: "common.yaml"
- name: Install pip
package:
name: python-pip
state: present
- name: Install virtualenv
package:
name: python-virtualenv
state: present
- name: pip install tripleo items
become: true
pip:
name:
- "file://{{ openstack_git_root }}/diskimage-builder"
- "file://{{ openstack_git_root }}/python-tripleoclient"
- "file://{{ openstack_git_root }}/tripleo-common"
state: present
virtualenv: "{{ workspace }}/venv"
# NOTE(aschultz) :we dropped support for instack-undercloud in Stein so
# we use a directory existance check to determine if we should include it
- name: Run image build
args:
chdir: '{{ workspace }}'
shell: |
set -x
source {{ workspace }}/venv/bin/activate
TRIPLEO_COMMON_PATH="{{ openstack_git_root }}/tripleo-common"
ELEMENTS="{{ openstack_git_root }}/tripleo-puppet-elements/elements:"
ELEMENTS+="{{ openstack_git_root }}/tripleo-image-elements/elements:"
ELEMENTS+="{{ openstack_git_root }}/heat-agents"
if [ -d "{{ openstack_git_root }}/instack-undercloud/elements" ]; then
ELEMENTS="{{ openstack_git_root }}/instack-undercloud/elements:${ELEMENTS}"
fi
if [ "{{ tripleo_image_type }}" == "overcloud-hardened-full" ]; then
CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-hardened-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-hardened-images-{{ tripleo_image_os }}.yaml"
else
CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images-{{ tripleo_image_os }}.yaml"
fi
export ELEMENTS_PATH=$ELEMENTS
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES > {{ workspace }}/build.log 2> {{ workspace }}/build-err.log
RESULT=$?
mv *.log {{ workspace }}/logs/
exit $RESULT