Hello.

I can make it work with your guidance.

but we need add something like below in copy tasks:

for example

https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/nova/tasks/config.yml#L56
- "{{ node_custom_config }}/nova/{{ compute_group }}/nova.conf"

nano multinode
[compute-az1]
az1_comp01 ceph_cluster=cephaz1
[compute-az2]
az2_comp01 ceph_cluster=cephaz2
[deployment]
localhost ansible_connection=local
[compute:children]
compute-az1
compute-az2

nano group_vars/compute-az1.yml
compute_group: compute-az1

nano group_vars/compute-az2.yml
compute_group: compute-az2

I’ll continue testing, and I hope I can contribute to the project. It could be very useful for multi-AZ environments, especially where each AZ has its own Ceph backend or where host aggregators have different configurations.

Nguyen Huu Khoi


On Tue, Aug 22, 2023 at 5:23 AM Danny Webb <Danny.Webb@thehutgroup.com> wrote:
one of the other things you can do is use the groups key in the jinja template to add in config for specific host groups:

eg:

{% if ansible_fqdn in groups['compute_group_a'] %}
some_var  = "foo"
{% elif ansible_fqdn in groups['compute_group_b'] %}
other_var = "boo"
{% endif %}
not quite as clean as having a merge_configs keyed to the group but in my experience you aren't normally changing a tonne of values for a service anyways so it's pretty manageable.

From: Nguyễn Hữu Khôi <nguyenhuukhoinw@gmail.com>
Sent: 21 August 2023 11:57
To: Michal Arbet <michal.arbet@ultimum.io>
Cc: OpenStack Discuss <openstack-discuss@lists.openstack.org>
Subject: Re: [openstack][kolla-ansible]about group node config overwrite
 

CAUTION: This email originates from outside THG


Thanks much,
I will try if it is ok, I will submit it.
Nguyen Huu Khoi


On Mon, Aug 21, 2023 at 5:50 PM Michal Arbet <michal.arbet@ultimum.io> wrote:
Hi, 

It's configuration ..., feel free to submit a patch which modifies kolla-ansible docs...

On Sun, Aug 20, 2023, 02:48 Nguyễn Hữu Khôi <nguyenhuukhoinw@gmail.com> wrote:
Thank you very much. 
I will do it. I still hope that will be official feature.

On Sat, Aug 19, 2023, 11:11 PM Michal Arbet <michal.arbet@ultimum.io> wrote:
Hello, 

It's Ansible so create your special group, change inventory and place your group related variables to group_vars/yourgroup.yml and in config overrides you can use your group related values.

I think this should work

On Fri, Aug 18, 2023, 16:31 Nguyễn Hữu Khôi <nguyenhuukhoinw@gmail.com> wrote:
Hello Koller.

I want to ask if we can overwrite config for a group of nodes. For example,

compute01 >> compute10 will have the same nova configuration

compute11 >> compute20 will have the same nova configuration.

It will be very nice if we support this way.

Thank you. Regards

Nguyen Huu Khoi