undercloud minion job fails on tripleo-ssh-known-hosts when there are no networks defined

Bug #1855149 reported by Alex Schultz
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Alex Schultz

Bug Description

The minion doesn't have networks so the tripleo-ssh-known-hosts role fails with:

2019-12-04 16:26:13.536 19175 ERROR tripleoclient.v1.tripleo_deploy.Deploy [ ] [
 [
  "Set ssh_known_hosts fact",
  {
   "msg": "Unexpected templating type error occurred on ({%- for host in groups['overcloud'] | intersect(play_hosts) %}\n[{{ ctlplane_ip }}]*,[{{ host }}.{{ cloud_domain }}]*,[{{ host }}]*\n{%- if enabled_networks | length > 0 and hostvars[host]['role_networks'] is defined and hostvars[host]['role_networks'] | length > 0 %},\n{%- for network in enabled_networks %}\n{%- if network in hostvars[host]['role_networks'] %}\n[{{ hostvars[host][networks[network]['name'] ~ '_ip'] }}]*,[{{ host }}.{{ network.lower() }}]*,{% if 1 %}{% endif %}\n[{{ host }}.{{ network.lower() }}.{{ cloud_domain }}]*{% if not loop.last %},{% endif %}\n{%- endif -%}\n{%- endfor -%}\n{%- endif -%}\n{{ ' ssh-rsa ' ~ hostvars[host]['ansible_ssh_host_key_rsa_public'] }}\n{% endfor %}): object of type 'NoneType' has no len()",
   "_ansible_no_log": false
  }
 ]

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/697321

Changed in tripleo:
assignee: nobody → Alex Schultz (alex-schultz)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (master)

Reviewed: https://review.opendev.org/697321
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=f5c93fa2f12fe2eba08eac7326d348f25c0e7187
Submitter: Zuul
Branch: master

commit f5c93fa2f12fe2eba08eac7326d348f25c0e7187
Author: Alex Schultz <email address hidden>
Date: Wed Dec 4 09:56:09 2019 -0700

    Networks may be none

    If the network vars are defined but not lists, the filters and loops
    fail in ansible. We need to check that vars exist and that they aren't
    none prior to using them.

    Change-Id: I648caf97b532c65a0b1e12e8b27be9997a69780d
    Closes-Bug: #1855149

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ansible (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/697725

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (stable/train)

Reviewed: https://review.opendev.org/697725
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=3b092215df292062e900efce58a30048a767c0c3
Submitter: Zuul
Branch: stable/train

commit 3b092215df292062e900efce58a30048a767c0c3
Author: Alex Schultz <email address hidden>
Date: Wed Dec 4 09:56:09 2019 -0700

    Networks may be none

    If the network vars are defined but not lists, the filters and loops
    fail in ansible. We need to check that vars exist and that they aren't
    none prior to using them.

    Change-Id: I648caf97b532c65a0b1e12e8b27be9997a69780d
    Closes-Bug: #1855149
    (cherry picked from commit f5c93fa2f12fe2eba08eac7326d348f25c0e7187)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-ansible (master)

Reviewed: https://review.opendev.org/699502
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=0a87cadd277bf116013f573fd4f82edf220ec597
Submitter: Zuul
Branch: master

commit 0a87cadd277bf116013f573fd4f82edf220ec597
Author: Kevin Carter <email address hidden>
Date: Tue Dec 17 15:05:22 2019 -0600

    Programatically generate ssh hosts lines

    This change will ensure that the ssh hosts lines we create are
    programatically generated. This will ensure we're not running
    into errors caused by missing or bad facts or generating lines
    that do not make sense caused by bad string slicing or one off
    jinja errors.

    Related-Bug: #1837644
    Related-Bug: #1855149
    Closes-Bug: #1856893
    Change-Id: I3696238b26d8567bc3145a22b2b9ec944cb14d13
    Signed-off-by: Kevin Carter <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ansible 0.4.1

This issue was fixed in the openstack/tripleo-ansible 0.4.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ansible 1.1.0

This issue was fixed in the openstack/tripleo-ansible 1.1.0 release.

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.