Luigi Toscano 3ffc00940f sync-devstack-data: new argument devstack_data_base_dir
When the role is used by grenade, the data directory is shared among
different devstack executions, and the base directory is different,
for example: /opt/stack/data vs /opt/stack/{old,new}.
The new devstack_data_base_dir parameter allows user to specify
a base directory for the data/ directory which is unrelated
to the devstack directory. The default value is devstack_base_dir,
so the default behavior is unchanged.

Change-Id: Ie69b7b51947cbf1a8b31d2701783de2fb56a2d33
2019-04-02 12:28:31 +02:00

49 lines
1.3 KiB
YAML

- name: Ensure the data folder exists
become: true
file:
path: "{{ devstack_data_base_dir }}/data"
state: directory
owner: stack
group: stack
mode: 0755
when: 'inventory_hostname in groups["subnode"]|default([])'
- name: Ensure the CA folder exists
become: true
file:
path: "{{ devstack_data_base_dir }}/data/CA"
state: directory
owner: stack
group: stack
mode: 0755
when: 'inventory_hostname in groups["subnode"]|default([])'
- name: Pull the CA certificate and folder
become: true
synchronize:
src: "{{ item }}"
dest: "{{ zuul.executor.work_root }}/{{ item | basename }}"
mode: pull
with_items:
- "{{ devstack_data_base_dir }}/data/ca-bundle.pem"
- "{{ devstack_data_base_dir }}/data/CA"
when: inventory_hostname == 'controller'
- name: Push the CA certificate
become: true
become_user: stack
synchronize:
src: "{{ zuul.executor.work_root }}/ca-bundle.pem"
dest: "{{ devstack_data_base_dir }}/data/ca-bundle.pem"
mode: push
when: 'inventory_hostname in groups["subnode"]|default([])'
- name: Push the CA folder
become: true
become_user: stack
synchronize:
src: "{{ zuul.executor.work_root }}/CA/"
dest: "{{ devstack_data_base_dir }}/data/"
mode: push
when: 'inventory_hostname in groups["subnode"]|default([])'