[kolla-ansible] Inventory group vars
Hi all, I am trying to define a couple of variables in the inventory file for a specific group and I do something like the following in the inventory: (...) [compute] comp[1:5] [compute:vars] neutron_external_interface=bond0.100, bond0.101 neutron_bridge_name=br-ex,br-ex2 (...) This is a valid ansible setup, however with kolla-ansible these variables are totally ignored. Any suggestion ? a.
Hi Alexandros, In the [compute] area, it's correct. But for define what physical interface should be use for each nodes, you should set like below: [compute] comp[1:5] neutron_external_interface=bond0.100,bond.101 And I'm not sure if "neutron_bridge_name" can be set behind hostname. For me I usually put into globals.yml. Alexandros Soumplis <soumplis@admin.grnet.gr> 於 2021年3月27日 週六 上午1:49寫道:
Hi all,
I am trying to define a couple of variables in the inventory file for a specific group and I do something like the following in the inventory:
(...) [compute] comp[1:5]
[compute:vars] neutron_external_interface=bond0.100, bond0.101 neutron_bridge_name=br-ex,br-ex2
(...)
This is a valid ansible setup, however with kolla-ansible these variables are totally ignored. Any suggestion ?
a.
Hi Eddie, If I define them in the hostname it works perfectly fine. I cannot use the globals.yml because there are different bridges per group (ex. control plane servers do not the provide network bridges). The problem with the host approach is that it makes the inventory file very difficult to parse with external scripts. If the typical ansible :vars section worked as expected it would make any parsing much easier with crudini :) a. On 27/3/21 1:11 π.μ., Eddie Yen wrote:
Hi Alexandros,
In the [compute] area, it's correct. But for define what physical interface should be use for each nodes, you should set like below:
[compute] comp[1:5] neutron_external_interface=bond0.100,bond.101
And I'm not sure if "neutron_bridge_name" can be set behind hostname. For me I usually put into globals.yml.
Alexandros Soumplis <soumplis@admin.grnet.gr <mailto:soumplis@admin.grnet.gr>> 於 2021年3月27日 週六 上午1:49寫道:
Hi all,
I am trying to define a couple of variables in the inventory file for a specific group and I do something like the following in the inventory:
(...) [compute] comp[1:5]
[compute:vars] neutron_external_interface=bond0.100, bond0.101 neutron_bridge_name=br-ex,br-ex2
(...)
This is a valid ansible setup, however with kolla-ansible these variables are totally ignored. Any suggestion ?
a.
I see. Perhaps it will be better if you can provide an error msg shared on pastebin? Alexandros Soumplis <soumplis@admin.grnet.gr> 於 2021年3月27日 週六 下午2:56寫道:
Hi Eddie,
If I define them in the hostname it works perfectly fine. I cannot use the globals.yml because there are different bridges per group (ex. control plane servers do not the provide network bridges).
The problem with the host approach is that it makes the inventory file very difficult to parse with external scripts. If the typical ansible :vars section worked as expected it would make any parsing much easier with crudini :)
a.
On 27/3/21 1:11 π.μ., Eddie Yen wrote:
Hi Alexandros,
In the [compute] area, it's correct. But for define what physical interface should be use for each nodes, you should set like below:
[compute] comp[1:5] neutron_external_interface=bond0.100,bond.101
And I'm not sure if "neutron_bridge_name" can be set behind hostname. For me I usually put into globals.yml.
Alexandros Soumplis <soumplis@admin.grnet.gr> 於 2021年3月27日 週六 上午1:49寫道:
Hi all,
I am trying to define a couple of variables in the inventory file for a specific group and I do something like the following in the inventory:
(...) [compute] comp[1:5]
[compute:vars] neutron_external_interface=bond0.100, bond0.101 neutron_bridge_name=br-ex,br-ex2
(...)
This is a valid ansible setup, however with kolla-ansible these variables are totally ignored. Any suggestion ?
a.
On Sat, 27 Mar 2021 at 06:50, Alexandros Soumplis <soumplis@admin.grnet.gr> wrote:
Hi Eddie,
If I define them in the hostname it works perfectly fine. I cannot use the globals.yml because there are different bridges per group (ex. control plane servers do not the provide network bridges).
The problem with the host approach is that it makes the inventory file very difficult to parse with external scripts. If the typical ansible :vars section worked as expected it would make any parsing much easier with crudini :)
Hi Alexandros, There's some kolla-specific info here: https://docs.openstack.org/kolla-ansible/latest/user/multinode.html#host-and... Essentially, the problem is that we define various default values in a group_vars/all.yml file next to our playbooks, and this has a higher precedence than an inventory file: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#.... Try using a group_vars/compute file, next to your inventory file. Mark
a.
On 27/3/21 1:11 π.μ., Eddie Yen wrote:
Hi Alexandros,
In the [compute] area, it's correct. But for define what physical interface should be use for each nodes, you should set like below:
[compute] comp[1:5] neutron_external_interface=bond0.100,bond.101
And I'm not sure if "neutron_bridge_name" can be set behind hostname. For me I usually put into globals.yml.
Alexandros Soumplis <soumplis@admin.grnet.gr> 於 2021年3月27日 週六 上午1:49寫道:
Hi all,
I am trying to define a couple of variables in the inventory file for a specific group and I do something like the following in the inventory:
(...) [compute] comp[1:5]
[compute:vars] neutron_external_interface=bond0.100, bond0.101 neutron_bridge_name=br-ex,br-ex2
(...)
This is a valid ansible setup, however with kolla-ansible these variables are totally ignored. Any suggestion ?
a.
I really don't know how I have missed that part in the documentation, I've read through it numerous times :) In any case, it works as expected with the group_vars/compute file. Thank you all, for you help! a. On 27/3/21 7:37 μ.μ., Mark Goddard wrote:
On Sat, 27 Mar 2021 at 06:50, Alexandros Soumplis <soumplis@admin.grnet.gr> wrote:
Hi Eddie,
If I define them in the hostname it works perfectly fine. I cannot use the globals.yml because there are different bridges per group (ex. control plane servers do not the provide network bridges).
The problem with the host approach is that it makes the inventory file very difficult to parse with external scripts. If the typical ansible :vars section worked as expected it would make any parsing much easier with crudini :) Hi Alexandros,
There's some kolla-specific info here: https://docs.openstack.org/kolla-ansible/latest/user/multinode.html#host-and...
Essentially, the problem is that we define various default values in a group_vars/all.yml file next to our playbooks, and this has a higher precedence than an inventory file: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#....
Try using a group_vars/compute file, next to your inventory file.
Mark
a.
On 27/3/21 1:11 π.μ., Eddie Yen wrote:
Hi Alexandros,
In the [compute] area, it's correct. But for define what physical interface should be use for each nodes, you should set like below:
[compute] comp[1:5] neutron_external_interface=bond0.100,bond.101
And I'm not sure if "neutron_bridge_name" can be set behind hostname. For me I usually put into globals.yml.
Alexandros Soumplis <soumplis@admin.grnet.gr> 於 2021年3月27日 週六 上午1:49寫道:
Hi all,
I am trying to define a couple of variables in the inventory file for a specific group and I do something like the following in the inventory:
(...) [compute] comp[1:5]
[compute:vars] neutron_external_interface=bond0.100, bond0.101 neutron_bridge_name=br-ex,br-ex2
(...)
This is a valid ansible setup, however with kolla-ansible these variables are totally ignored. Any suggestion ?
a.
On Fri, Mar 26, 2021 at 6:43 PM Alexandros Soumplis <soumplis@admin.grnet.gr> wrote:
Hi all,
Hi Alexandros,
I am trying to define a couple of variables in the inventory file for a specific group and I do something like the following in the inventory:
(...) [compute] comp[1:5]
[compute:vars] neutron_external_interface=bond0.100, bond0.101 neutron_bridge_name=br-ex,br-ex2
(...)
This is a valid ansible setup, however with kolla-ansible these variables are totally ignored. Any suggestion ?
That's interesting. Kolla Ansible does not do any magic at this level so it's basically up to Ansible. Perhaps there is a slight quirk somewhere. Maybe you have compute:vars more than once? And override yourself? Group vars work for me. It's good practice to use them. You might also be interested in [1] where it shows how to organise the vars in yaml files per group. [1] https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#orga... -yoctozepto
participants (4)
-
Alexandros Soumplis
-
Eddie Yen
-
Mark Goddard
-
Radosław Piliszek