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:
parent
e6b0169a02
commit
5a9872a9b9
@ -20,6 +20,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- export-devstack-journal
|
- export-devstack-journal
|
||||||
- apache-logs-conf
|
- apache-logs-conf
|
||||||
|
- devstack-project-conf
|
||||||
- role: stage-output
|
- role: stage-output
|
||||||
zuul_copy_output:
|
zuul_copy_output:
|
||||||
{ '{{ devstack_conf_dir }}/local.conf': 'logs',
|
{ '{{ devstack_conf_dir }}/local.conf': 'logs',
|
||||||
@ -32,6 +33,7 @@
|
|||||||
'{{ stage_dir }}/verify_tempest_conf.log': 'logs',
|
'{{ stage_dir }}/verify_tempest_conf.log': 'logs',
|
||||||
'{{ stage_dir }}/apache': 'logs',
|
'{{ stage_dir }}/apache': 'logs',
|
||||||
'{{ stage_dir }}/apache_config': 'logs',
|
'{{ stage_dir }}/apache_config': 'logs',
|
||||||
|
'{{ stage_dir }}/etc': 'logs',
|
||||||
'/var/log/rabbitmq': 'logs',
|
'/var/log/rabbitmq': 'logs',
|
||||||
'/var/log/postgresql': 'logs',
|
'/var/log/postgresql': 'logs',
|
||||||
'/var/log/mysql.err': 'logs',
|
'/var/log/mysql.err': 'logs',
|
||||||
|
11
roles/devstack-project-conf/README.rst
Normal file
11
roles/devstack-project-conf/README.rst
Normal 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.
|
1
roles/devstack-project-conf/defaults/main.yaml
Normal file
1
roles/devstack-project-conf/defaults/main.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
stage_dir: "{{ ansible_user_dir }}"
|
24
roles/devstack-project-conf/tasks/main.yaml
Normal file
24
roles/devstack-project-conf/tasks/main.yaml
Normal 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
|
Loading…
Reference in New Issue
Block a user