Ansible-redhat-openstack and Vagrant: allow using an IP not from eth0?

the templates in ansible-redhat-openstack use ansible_default_ipv4.address in multiple places, and this seems to default to what’s on eth0. Unfortunately Vagrant configures eth0 for NAT with 10.0.2.15 which is no good for us, and there is no easy way to change that.

Could we define a variable(s) in group_vars/all that the templates could reference instead? Then to use a different NIC would mean changing just one file. That would make a fully automated install with Vagrant possible and doing pull requests easier. I know Vagrant is not essential, but think of the quality gain from testing pull requests on fresh nodes before submitting…

$ grep -l -r ansible_default_ipv4 aro/
aro/roles/compute/templates/nova.conf.j2
aro/roles/compute/templates/ovs_quantum_plugin.ini.j2
aro/roles/controller/templates/l3_agent.ini.j2
aro/roles/controller/templates/keystone_data.sh.j2
aro/roles/controller/templates/nova.conf.j2
aro/roles/controller/templates/dhcp_agent.ini.j2
aro/roles/controller/templates/quantum.conf.j2
aro/roles/controller/templates/ovs_quantum_plugin.ini.j2
aro/roles/common/templates/hosts.j2

Thanks.

Hi Darragh

we could do this by defining a varible in groupvars like iface: ‘eth0’ and in templates referencing it by {{ hostvars[host][‘ansible_’ + iface].ipv4.address }}

i will do that and test shortly, unless somebody else does it before me.

  • Benno

Hi Benno,

cool - i can help testing before merge, if you want.

Darragh.

Hi Benno,

I did a pull request for that. And the vagrant script to create the two boxes is here.

Darragh.