os-octavia-install play fails with conf template errors

Bug #2064903 reported by zrsolis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
New
Undecided
Unassigned

Bug Description

When attempting to install Octavia in stable/bobcat release, I receive the following error:

fatal: [infra-01]: FAILED! => {
    "msg": "{% for host in groups[octavia_hm_group] %}{{ hostvars[host]['container_address'] }}{% if not loop.last %},{% endif %}{% endfor %}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'container_address'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'container_address'. {% for host in groups[octavia_hm_group] %}{{ hostvars[host]['container_address'] }}{% if not loop.last %},{% endif %}{% endfor %}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'container_address'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'container_address'"
}

Infra hosts used by Octavia indeed do not have a value of "container_address" in their inventory:
            "infra-01": {
                "ansible_host": "10.0.32.4",
                "component": "utility",
                "container_name": "infra-01",
                "container_networks": {},
                "container_tech": "lxc",
                "container_types": "infra-01-host_containers",
                "is_metal": true,
                "management_address": "10.0.32.4",
                "physical_host": "infra-01",
                "physical_host_group": "shared-infra_hosts",
                "properties": {
                    "is_metal": true
                }
            },
            "infra-02": {
                "ansible_host": "10.0.32.5",
                "component": "utility",
                "container_name": "infra-02",
                "container_networks": {},
                "container_tech": "lxc",
                "container_types": "infra-02-host_containers",
                "is_metal": true,
                "management_address": "10.0.32.5",
                "physical_host": "infra-02",
                "physical_host_group": "shared-infra_hosts",
                "properties": {
                    "is_metal": true
                }
            },
            "infra-03": {
                "ansible_host": "10.0.32.6",
                "component": "utility",
                "container_name": "infra-03",
                "container_networks": {},
                "container_tech": "lxc",
                "container_types": "infra-03-host_containers",
                "is_metal": true,
                "management_address": "10.0.32.6",
                "physical_host": "infra-03",
                "physical_host_group": "shared-infra_hosts",
                "properties": {
                    "is_metal": true
                }

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote (last edit ):

Hi,

Can you kindly check if you have somewhere in your user_variables or group_vars following:

octavia_provider_network_name: container
or something like that?

As container_address was eventually renamed to management_address to better reflect purpose of the variable and reduce confusion for bare metal installations.

Revision history for this message
zrsolis (zrsolis) wrote :

I realized I had a custom octavia_hm_hosts entry, which I have now commented out, but am now receiving the following error:

*
fatal: [infra-01]: FAILED! => {"msg": "{% for host in groups[octavia_hm_group] %}{{ hostvars[host]['container_networks'][octavia_container_network_name]['address'] }}{%\n if not loop.last %},{% endif %}{% endfor %}: {{ octavia_provider_network['ip_from_q'] }}_address: {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty.. {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty.. {{ octavia_provider_network['ip_from_q'] }}_address: {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty.. {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty.. {% for host in groups[octavia_hm_group] %}{{ hostvars[host]['container_networks'][octavia_container_network_name]['address'] }}{%\n if not loop.last %},{% endif %}{% endfor %}: {{ octavia_provider_network['ip_from_q'] }}_address: {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty.. {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty.. {{ octavia_provider_network['ip_from_q'] }}_address: {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty.. {{ provider_networks | map(attribute='network') | selectattr('net_name', 'defined') | selectattr(\n 'net_name', 'equalto', octavia_provider_inventory_net_name) | list | first\n}}: No first item, sequence was empty.. No first item, sequence was empty."}

My octavia_provider_network_name value is:
octavia_provider_network_name: "lbaas"

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Um, ok, so what was your `octavia_hm_hosts` defined to? Maybe it's easier to adjust it?

Revision history for this message
zrsolis (zrsolis) wrote :

octavia_hm_hosts: "{% for host in groups[octavia_hm_group] %}{{ hostvars[host]['container_address'] }}{% if not loop.last %},{% endif %}{% endfor %}"

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Yeah, so pretty much as I wrote in my first answer - we've replaced container_address with management_address variable.

So I would try that instead:
octavia_hm_hosts: "{% for host in groups[octavia_hm_group] %}{{ hostvars[host]['management_address'] }}{% if not loop.last %},{% endif %}{% endfor %}"

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.