Rework create reproducing script

Move job variables to defaults
Make dlrn_hash optional

Change-Id: Iecb7a30d0b4d83da9b33f50ad3becf66189666be
This commit is contained in:
Sagi Shnaidman 2018-02-26 11:55:57 +02:00
parent c7cac53d86
commit 2cdc009510
3 changed files with 6 additions and 11 deletions

View File

@ -1,3 +1,7 @@
env_vars_to_source_file: env_vars_to_src.sh
reproducer_quickstart_script: reproducer-quickstart.sh.j2
reproducer_quickstart_readme_file: "{{ artcl_collect_dir }}/README-reproducer-quickstart.html"
zuul_changes: "{{ lookup('env', 'ZUUL_CHANGES') }}"
nodes_config: "{{ lookup('env', 'NODES_FILE') | regex_replace('^.*/tripleo-quickstart','') }}"
toci_jobtype: "{{ lookup('env', 'TOCI_JOBTYPE') }}"
stable_release: "{{ lookup('env', 'STABLE_RELEASE') }}"

View File

@ -1,13 +1,4 @@
---
- name: Set fact for environment variables
set_fact:
zuul_changes: "{{ lookup('env', 'ZUUL_CHANGES') }}"
nodes_config: "{{ lookup('env', 'NODES_FILE') | regex_replace('^.*/tripleo-quickstart','') }}"
toci_jobtype: "{{ lookup('env', 'TOCI_JOBTYPE') }}"
- name: Set fact for stable branch
set_fact:
stable_release: "{{ lookup('env', 'STABLE_RELEASE') }}"
- name: Create the reproducer file from template
template:

View File

@ -201,7 +201,7 @@ ansible-playbook -i $WORKSPACE/multinode_hosts $WORKSPACE/tripleo-quickstart-ext
export $(awk '/subnode-0/ {print $2}' multinode_hosts)
{% endif %}
{% if dlrn_hash_newest is defined %}
{% if dlrn_hash_newest is defined or ('undercloud' in hostvars and 'dlrn_hash_newest' in hostvars['undercloud']) %}
EXTRA_VARS="$EXTRA_VARS --extra-vars dlrn_hash_tag_newest={{ hostvars['undercloud'].dlrn_hash_newest }} "
{% endif %}
@ -210,8 +210,8 @@ cat >"{{ env_vars_to_source_file }}" <<EOF
export ZUUL_CHANGES="{{ zuul_changes }}"
export NODES_FILE="{{ nodes_config }}"
export TOCI_JOBTYPE="{{ toci_jobtype }}"
export EXTRA_VARS="\$EXTRA_VARS {% if dlrn_hash is defined or ('undercloud' in hostvars and 'dlrn_hash' in hostvars['undercloud']) %}--extra-vars dlrn_hash_tag={{ hostvars['undercloud'].dlrn_hash }}{% endif %} "
export REMAINING_TIME="$TIMEOUT"
export EXTRA_VARS="\$EXTRA_VARS --extra-vars dlrn_hash_tag={{ hostvars['undercloud'].dlrn_hash }} "
EOF
{% if stable_release != '' %}