-
Notifications
You must be signed in to change notification settings - Fork 7
/
weirdo-periodic.yaml
63 lines (53 loc) · 2.38 KB
/
weirdo-periodic.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
- hosts: all
tasks:
- name: Run common weirdo tasks
ansible.builtin.include_tasks:
file: "../weirdo/common.yaml"
- name: Run weirdo for the desired project and scenario
shell:
cmd: |
set -e -x
source '{{ ansible_user_dir }}/rdopkg-venv/bin/activate'
MASTER="$(rdopkg info | grep -e "in development phase" | awk '{print $1}')"
RELEASE="{{ rdoinfo_release }}"
DIST_VER="{{ centos_releasever }}"
# Find out if it is puppet or packstack and scenario
if [[ "{{ zuul.job }}" == *"puppet"* ]]; then
project="puppet-openstack"
else
project="packstack"
fi
scenario="{{ scenario }}"
# Set version related variables
if [ $RELEASE = $MASTER ]; then
VERSION="master"
O_RELEASE="master"
else
VERSION="$(rdopkg release -r "$RELEASE" | grep upstream_branch | awk '{print $2}')"
O_RELEASE="$RELEASE"
fi
if [[ "{{ job_type | default('periodic') }}" == "promotion" ]]; then
enable_puppet_modules_rpm=false
dlrn_repo="puppet-ci-testing"
else
enable_puppet_modules_rpm=true
dlrn_repo="puppet-passed-ci"
fi
# Prepare Ansible inventory to use localhost
pushd {{ ansible_user_dir }}/{{ zuul.projects['review.rdoproject.org/rdo-infra/weirdo'].src_dir }}
cat <<EOF >hosts
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python{{ '2' if centos_release == "centos7" else '3' }}
[openstack_nodes]
localhost log_destination=/var/log/weirdo
EOF
REPOS_URL="http://trunk.rdoproject.org/centos${DIST_VER}-${O_RELEASE}/${dlrn_repo}/delorean.repo,https://trunk.rdoproject.org/centos${DIST_VER}-${O_RELEASE}/delorean-deps.repo" # noqa 204
tox -e ansible-playbook -- -vv -b -i hosts playbooks/$project-$scenario.yml \
-e version=$VERSION \
-e openstack_release=$O_RELEASE \
-e selinux_enforcing="{{ selinux_enforcing | default('true') }}" \
-e tempest_from_source=false \
-e enable_puppet_modules_rpm=${enable_puppet_modules_rpm} \
-e trunk_repositories=$REPOS_URL \
changed_when: true
environment:
LANG: 'en_US.UTF-8'