kayobe/ansible/overcloud-service-config-save.yml
Mark Goddard 27d833f13f Fix kayobe overcloud service config save
If Kolla Ansible config files are not readable by the kayobe (stack)
user, the command will fail. This is fixed by using become.

Also improves the command output, by showing only the path of each file
rather than the full stat result.

Change-Id: I466e6a75822a1b2d2f91c9fadc9730c2cdb5bba0
TrivialFix
2018-08-17 13:15:25 +01:00

29 lines
882 B
YAML

---
- name: Save overcloud service configuration
hosts: overcloud
tags:
- service-config-save
vars:
# Override this to change the directory in which the configuration will be
# saved.
config_save_path: "{{ lookup('env', 'PWD') ~ '/overcloud-config' }}"
# Override this to change the directory on the remote hosts from which the
# kolla-ansible configuration will be saved.
node_config_directory: "/etc/kolla"
tasks:
- name: Find overcloud service configuration files
find:
paths: "{{ node_config_directory }}"
recurse: True
register: find_result
become: true
- name: Save overcloud service configuration
fetch:
src: "{{ item.path }}"
dest: "{{ config_save_path }}"
with_items: "{{ find_result.files }}"
become: true
loop_control:
label: "{{ item.path }}"