Swift: merge_config strategy of swift.conf

Bug #1849265 reported by Alexis Deberg
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Mark Goddard
Train
Fix Released
Medium
Mark Goddard

Bug Description

I believe the merge_config call for swift.conf should not blindly call all other files, and especially not the proxy-server configurations as some directives do not work there.

Having the following in a proxy-server merged snippet:

[DEFAULT]
log_statsd_port = 1234

Will produce:

ERROR: Invalid Storage Policy Configuration in /etc/swift/swift.conf (Invalid option 'log_statsd_port' in storage-policy section, for index '0')

This is due to the "proxy-server" item being present in the "Copying over swift.conf" step of config.yml: https://opendev.org/openstack/kolla-ansible/src/branch/master/ansible/roles/swift/tasks/config.yml#L87

Revision history for this message
Mark Goddard (mgoddard) wrote :

Please use service-specific configs where necessary, e.g.:

/etc/kolla/config/swift/account.conf
/etc/kolla/config/swift/account-server.conf

Changed in kolla-ansible:
status: New → Invalid
Revision history for this message
Alexis Deberg (adeberg) wrote :

I wish I could.

If I define /etc/kolla/config/swift/proxy-server.conf
It will be merged into the deployed swift.conf

If I use a configuration directive that is not compatible with swift.conf into my proxy-server.conf it will end in the situation I described earlier.

Right now I got:

config/prod/swift/proxy-server.conf
config/prod/swift.conf

and in my proxy-server.conf I got statsd configuration that prevents swift to start correctly

Removing the proxy-server from the with_items list I linked makes it work again

But please let me know if I should change how i do things somehow as I'm not sure to understand your comment.

Revision history for this message
Mark Goddard (mgoddard) wrote :

I see the problem, that same file gets merged into both swift.conf and proxy-server.conf.

I can't think of a workaround, but the following should work:

diff --git a/ansible/roles/swift/tasks/config.yml b/ansible/roles/swift/tasks/config.yml
index 1fd6981..40c757a 100644
--- a/ansible/roles/swift/tasks/config.yml
+++ b/ansible/roles/swift/tasks/config.yml
@@ -62,8 +62,8 @@
       - "{{ role_path }}/templates/swift.conf.j2"
       - "{{ node_custom_config }}/global.conf"
       - "{{ node_custom_config }}/swift.conf"
- - "{{ node_custom_config }}/swift/{{ item }}.conf"
- - "{{ node_custom_config }}/swift/{{ inventory_hostname }}/{{ item }}.conf"
+ - "{{ node_custom_config }}/swift/{{ item }}/swift.conf"
+ - "{{ node_custom_config }}/swift/{{ inventory_hostname }}/{{ item }}/swift.conf"
     dest: "{{ node_config_directory }}/swift-{{ item }}/swift.conf"
     mode: "0660"
   become: true

Then only /etc/kolla/config/swift/proxy-server/swift.conf would get merged into swift.conf.

Changed in kolla-ansible:
status: Invalid → Triaged
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/690881

Changed in kolla-ansible:
assignee: nobody → Mark Goddard (mgoddard)
status: Triaged → In Progress
Revision history for this message
Alexis Deberg (adeberg) wrote :

Indeed my initial fix was very wrong :)
Thanks for the workaround patch

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/690881
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=86ccefc6233c52a083ccdbec23011d528a999964
Submitter: Zuul
Branch: master

commit 86ccefc6233c52a083ccdbec23011d528a999964
Author: Mark Goddard <email address hidden>
Date: Thu Oct 24 09:31:17 2019 +0100

    Fix swift.conf custom configuration path collision

    Both swift.conf and proxy-server.conf are affected be
    /etc/kolla/config/swift/proxy-server.conf. However, some options in
    proxy-server.conf are not valid in swift.conf.

    This change keeps this path for proxy-server.conf, but modifies the path
    for swift.conf to /etc/kolla/config/swift/proxy-server/swift.conf. The
    same applies for other services, object-*, account-*, container-*.

    Change-Id: I600891a15244ce705861f6ec93eec1d5ba83c1b8
    Closes-Bug: #1849265

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/693020

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/693021

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 9.0.0.0rc1

This issue was fixed in the openstack/kolla-ansible 9.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/stein)

Reviewed: https://review.opendev.org/693020
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=2ee470bbe31c43022053045b295e0a32951146e5
Submitter: Zuul
Branch: stable/stein

commit 2ee470bbe31c43022053045b295e0a32951146e5
Author: Mark Goddard <email address hidden>
Date: Thu Oct 24 09:31:17 2019 +0100

    Fix swift.conf custom configuration path collision

    Both swift.conf and proxy-server.conf are affected be
    /etc/kolla/config/swift/proxy-server.conf. However, some options in
    proxy-server.conf are not valid in swift.conf.

    This change keeps this path for proxy-server.conf, but modifies the path
    for swift.conf to /etc/kolla/config/swift/proxy-server/swift.conf. The
    same applies for other services, object-*, account-*, container-*.

    Change-Id: I600891a15244ce705861f6ec93eec1d5ba83c1b8
    Closes-Bug: #1849265
    (cherry picked from commit 86ccefc6233c52a083ccdbec23011d528a999964)

tags: added: in-stable-stein
tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/rocky)

Reviewed: https://review.opendev.org/693021
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=cc12f502a5ddcfb52a9fc1a981d1cf04a94fd579
Submitter: Zuul
Branch: stable/rocky

commit cc12f502a5ddcfb52a9fc1a981d1cf04a94fd579
Author: Mark Goddard <email address hidden>
Date: Thu Oct 24 09:31:17 2019 +0100

    Fix swift.conf custom configuration path collision

    Both swift.conf and proxy-server.conf are affected be
    /etc/kolla/config/swift/proxy-server.conf. However, some options in
    proxy-server.conf are not valid in swift.conf.

    This change keeps this path for proxy-server.conf, but modifies the path
    for swift.conf to /etc/kolla/config/swift/proxy-server/swift.conf. The
    same applies for other services, object-*, account-*, container-*.

    Change-Id: I600891a15244ce705861f6ec93eec1d5ba83c1b8
    Closes-Bug: #1849265
    (cherry picked from commit 86ccefc6233c52a083ccdbec23011d528a999964)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 7.2.0

This issue was fixed in the openstack/kolla-ansible 7.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 8.1.0

This issue was fixed in the openstack/kolla-ansible 8.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.