commit 0ff91a0dd2f95ad3703479853d9702c020890161 Author: Sagi Shnaidman Date: Wed Oct 7 16:50:36 2020 +0300 Pass branchful variables in provider Add variables in branch inside the names. Upgrades job will use it for detection target and deploy IP addresses and DLRN hashes. Change-Id: I6aadd80a509135a0f860255c77e590818521f489 diff --git a/playbooks/tripleo-ci/run-provider.yml b/playbooks/tripleo-ci/run-provider.yml index 8b18884..55f2a69 100644 --- a/playbooks/tripleo-ci/run-provider.yml +++ b/playbooks/tripleo-ci/run-provider.yml @@ -1,11 +1,37 @@ - hosts: all tasks: + + - name: Discover a branch + block: + + - name: Set from regular Zuul branch + set_fact: + ci_branch: "{{ zuul.branch | regex_replace('(stable|cloudsig)/', '') }}" + when: zuul is defined + + - name: Set from branch_override variable + set_fact: + ci_branch: "{{ branch_override | regex_replace('(stable|cloudsig)/', '') }}" + when: branch_override is defined + + - name: Set from release variable (in periodic) + set_fact: + ci_branch: "{{ release }}" + when: release is defined + + - name: Set branch variables + set_fact: + provider_job_branch: "{{ ci_branch }}" + registry_ip_address_branch: "{'{{ ci_branch }}': '{{ hostvars[groups.all[0]].ansible_host }}'}" + provider_dlrn_hash_branch: "{'{{ ci_branch }}': '{{ dlrn_hash|default('') }}'}" + - name: Return Zuul data debug: msg: >- Running podman registry and repository on {{ hostvars[groups.all[0]].ansible_host | default('nowhere') }} + for branch {{ ci_branch }} - name: Set registry IP address zuul_return: @@ -15,5 +41,8 @@ registry_ip_address: "{{ hostvars[groups.all[0]].ansible_host }}" provider_dlrn_hash: "{{ dlrn_hash|default('') }}" provider_dlrn_hash_tag: "{{ dlrn_hash_tag|default('') }}" + provider_job_branch: "{{ provider_job_branch }}" + registry_ip_address_branch: "{{ registry_ip_address_branch }}" + provider_dlrn_hash_branch: "{{ provider_dlrn_hash_branch }}" tags: - skip_ansible_lint