Refactor playbooks/publish/openstack-afs.yaml
Rework the playbook so that it takes an additional parameter and we can
use it in more places (see followup change). Set the current value
as default
Note that we really need to allow a value of "{{ afs.path }}" for the
variable without trailing "/" so that publishing of openstack-manuals
works which publishes to the root folder.
Change-Id: I15b77fc002a6b099ff23e0c07972b49ad743a2c9
This commit is contained in:
@@ -1,9 +1,23 @@
|
|||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
|
pre_tasks:
|
||||||
|
|
||||||
|
# Note that "{{ afs.path }}" is a valid afs_target and thus
|
||||||
|
# afs_subpath can be empty, we need this for openstack-manuals
|
||||||
|
# publishing.
|
||||||
|
- name: Set default afs_subpath
|
||||||
|
set_fact:
|
||||||
|
our_afs_subpath: "/{{ zuul.project.short_name }}"
|
||||||
|
when: afs_subpath is not defined
|
||||||
|
- name: Use defined afs_subpath
|
||||||
|
set_fact:
|
||||||
|
our_afs_subpath: "{{ afs_subpath }}"
|
||||||
|
when: afs_subpath is defined
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: create-afs-token
|
- role: create-afs-token
|
||||||
when: zuul_success | bool
|
when: zuul_success | bool
|
||||||
- role: upload-afs
|
- role: upload-afs
|
||||||
afs_target: "{{ afs.path }}/{{ zuul.project.short_name }}"
|
afs_target: "{{ afs.path }}{{ our_afs_subpath }}"
|
||||||
when: zuul_success | bool
|
when: zuul_success | bool
|
||||||
- role: destroy-afs-token
|
- role: destroy-afs-token
|
||||||
when: zuul_success | bool
|
when: zuul_success | bool
|
||||||
|
|||||||
Reference in New Issue
Block a user