deploy fails if controller does not have tunnel_interface

Bug #1723124 reported by Vladislav Belogrudov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Expired
Undecided
Unassigned

Bug Description

similar to https://bugs.launchpad.net/kolla-ansible/+bug/1642521

if one uses in ml2_conf.ini.j2

% if inventory_hostname in groups["network"] or inventory_hostname in groups["compute"] %}
local_ip = {{ tunnel_interface_address }}
{% endif %}

Ansible objects with

Host: 10.196.244.201, Task: neutron : Copying over ml2_conf.ini, Status:
failed, Message: {{ hostvars[inventory_hostname]['ansible_' +
tunnel_interface]['ipv4']['address'] }}: 'dict object' has no attribute
'ipv4'

But if I put

% if inventory_hostname in groups["network"] or inventory_hostname in groups["compute"] %}
local_ip = {{ hostvars[inventory_hostname]['ansible_' +
tunnel_interface]['ipv4']['address'] }}
{% endif %}

it works great, controllers don't get local_ip, but computes/network nodes do.

My ansible version is 2.3.1.0

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

looks like all.yml variable evaluation happens before switch statement in template

description: updated
Revision history for this message
Eduardo Gonzalez (egonzalez90) wrote :

Is using different interfaces for nodes? If yes, is tunnel_interface variable commented in globals.yml and defined for each host in inventory file?

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

I use separate interfaces for network/api/tunnel/neutron_external. One of my controllers only has network/api. tunnel_interface is only defined in all.yml, I don't redefine it.

I also have different name of interface for the controller:

# cat ansible/host_vars/10.196.244.201
api_interface: "ens4"

if that matters.

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

one more way to reproduce it with ansible 2.1.1 is to set a dummy interface for controller of a choice, e.g. make tunnel_interface: "goesnowhere99"

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

sorry, 2.3.1 in previous post

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

ansible 2.4.0 does not deploy for the same reason -

fatal: [10.196.244.201]: FAILED! => {"failed": true, "msg": "{{ hostvars[inventory_hostname]['ansible_' + tunnel_interface]['ipv4']['address'] }}: 'dict object' has no attribute 'ipv4'"}

the host only belongs to [control]

Revision history for this message
Michal Nasiadka (mnasiadka) wrote :

Is this still a bug? If yes please update.

Changed in kolla-ansible:
status: New → Incomplete
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla-ansible (master)

Change abandoned by Mark Goddard (<email address hidden>) on branch: master
Review: https://review.openstack.org/511797
Reason: Very old

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for kolla-ansible because there has been no activity for 60 days.]

Changed in kolla-ansible:
status: Incomplete → Expired
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.