Don't overwrite custom kolla-ansible configuration files, merge them

Previously, if a user provided a custom neutron ML2 configuration file in
/home/stackhpc-mark/kayobe/src/kayobe-config/etc/kayobe/neutron/ml2_conf.ini, it would overwrite the options set by
kayobe. This change applies the 'ignore' rule when copying custom config files,
as well as when deleting them. This works because we read in the contents of
these files and append it to kayobe's own configuration.
This commit is contained in:
Mark Goddard 2017-11-02 16:39:24 +00:00
parent a868ba1c42
commit 5563c665c0
2 changed files with 6 additions and 3 deletions

View File

@ -78,7 +78,9 @@
- "{{ find_src_result.results }}" - "{{ find_src_result.results }}"
- files - files
- skip_missing: True - skip_missing: True
when: item.0.item.enabled | bool when:
- item.0.item.enabled | bool
- item.1.path | basename not in item.0.item.ignore | default([])
- name: Ensure unnecessary extra configuration files are absent - name: Ensure unnecessary extra configuration files are absent
file: file:

View File

@ -5,8 +5,9 @@
# dest: Path to directory in which generated files will be created. # dest: Path to directory in which generated files will be created.
# patterns: One or more file name patterns to match. # patterns: One or more file name patterns to match.
# enabled: Whether these files should be templated. # enabled: Whether these files should be templated.
# ignore: Optional list of files to leave in the destination, even if disabled # ignore: Optional list of files to ignore. These files will not be copied to
# or unexpected. # the destination, and will not be removed from the destination, even
# if disabled or unexpected.
kolla_openstack_custom_config: kolla_openstack_custom_config:
# Ceph. # Ceph.
- src: "{{ kolla_extra_config_path }}/ceph" - src: "{{ kolla_extra_config_path }}/ceph"