Stage openstack config files

Stage config files from openstack and all projects used by the
devstack run.

Change-Id: I99f1bc71856b0da7fc5b438d13d4f508d2341e44
This commit is contained in:
Andrea Frittoli (andreaf) 2017-12-15 13:55:50 +00:00
parent e6b0169a02
commit 5a9872a9b9
4 changed files with 38 additions and 0 deletions

View File

@ -20,6 +20,7 @@
roles:
- export-devstack-journal
- apache-logs-conf
- devstack-project-conf
- role: stage-output
zuul_copy_output:
{ '{{ devstack_conf_dir }}/local.conf': 'logs',
@ -32,6 +33,7 @@
'{{ stage_dir }}/verify_tempest_conf.log': 'logs',
'{{ stage_dir }}/apache': 'logs',
'{{ stage_dir }}/apache_config': 'logs',
'{{ stage_dir }}/etc': 'logs',
'/var/log/rabbitmq': 'logs',
'/var/log/postgresql': 'logs',
'/var/log/mysql.err': 'logs',

View File

@ -0,0 +1,11 @@
Prepare OpenStack project configurations for staging
Prepare all relevant config files for staging.
This is helpful to avoid staging the entire /etc.
**Role Variables**
.. zuul:rolevar:: stage_dir
:default: {{ ansible_user_dir }}
The base stage directory.

View File

@ -0,0 +1 @@
stage_dir: "{{ ansible_user_dir }}"

View File

@ -0,0 +1,24 @@
- name: Ensure {{ stage_dir }}/etc exists
file:
path: "{{ stage_dir }}/etc"
state: directory
- name: Check which projects have a config folder
stat:
path: "/etc/{{ item.value.short_name }}"
with_dict: "{{ zuul.projects }}"
register: project_configs
- name: Copy configuration files
command: cp -pRL {{ item.stat.path }} {{ stage_dir }}/etc/{{ item.item.value.short_name }}
when: item.stat.exists
with_items: "{{ project_configs.results }}"
- name: Check if openstack has a config folder
stat:
path: "/etc/openstack"
register: openstack_configs
- name: Copy configuration files
command: cp -pRL /etc/openstack {{ stage_dir }}/etc/
when: openstack_configs.stat.exists