<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hey Markus,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm wondering which possibilities I have to do group/host specific<br>
config file overrides. After reading [1], I'm still a little clueless.<br>
To be specific, I have this setup (expressed as Ansible inventory file):<br>
<br>
[z_compute_nodes]<br>
compute1<br>
# more nodes<br>
[x_compute_nodes]<br>
compute2<br>
# more nodes<br>
[computes:children]<br>
z_compute_nodes<br>
x_compute_nodes<br>
<br>
As an example, I want to set Nova's config option<br>
`reserved_host_memory_mb` of the `DEFAULT` config file section:<br>
<br>
### nova.conf<br>
[DEFAULT]<br>
reserved_host_memory_mb=$VALUE<br>
<br>
My goal is this:<br>
<br>
| reserved_host_memory_mb<br>
------------------------------<wbr>----<br>
compute1 | 256<br>
compute2 | 512<br>
<br>
I know there are overrides like `nova_nova_conf_overrides`.<br>
So I tried to set a default override in `user_variables.yml`:<br>
<br>
### /etc/openstack_deploy/user_<wbr>variables.yml --------<br>
<br>
nova_nova_conf_overrides:<br>
DEFAULT:<br>
reserved_host_memory_mb: 512<br>
<br>
But I wanted to override this depending on the host in<br>
`openstack_user_config.yml`:<br>
<br>
### /etc/openstack_deploy/<wbr>openstack_user_config.yml --------<br>
# [...]<br>
# nova hypervisors<br>
compute_hosts:<br>
compute1:<br>
ip: 192.168.100.12<br>
host_vars:<br>
nova_nova_conf_overrides:<br>
DEFAULT:<br>
reserved_host_memory_mb: 256<br>
compute2:<br>
ip: 192.168.100.10<br></blockquote><div><br></div><div>Try change "host_vars" to "container_vars".</div><div>If that doesn't work let me know, I'll spin up a test to recreate the actual problem, but at a glance that looks correct otherwise.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
After testing this locally, it turned out that *both* hosts will<br>
have 512 for $VALUE. which was not my intended configuration.<br>
<br>
Please note that I only used 2 hosts here as an example but I'm looking<br>
for a solution which scales with much more hosts. I'm also applying<br>
those settings in a templated way like this:<br>
<br>
### /etc/openstack_deploy/<wbr>openstack_user_config.yml --------<br>
# [...]<br>
# nova hypervisors<br>
compute_hosts:<br>
{% for host in groups['computes'] %}<br>
{{ hostvars[host]['inventory_<wbr>hostname'] }}:<br>
ip: {{ hostvars[host]['ansible_host'] }}<br>
{% endfor %}<br>
<br>
The reason is, that I use the same steps for different environments<br>
(dev, test, prod) with a different amount of nodes.<br>
<br>
Any tips how to do this properly?<br><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Andy</div></div></div></div>