During N->O upgrade, conditional check bombs when inventory hostname not in nova service name

Bug #1667193 reported by James Denton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Amy Marrich

Bug Description

OS: Ubuntu 16.04

During N->O upgrade, the following task failed:

TASK [os_nova : Wait for the nova-compute service to initialize] ***************
Wednesday 22 February 2017 16:54:02 -0500 (0:00:00.549) 0:06:38.832 ****
skipping: [infra01-cluster2_nova_console_container-1bb18b02]
skipping: [infra02-cluster2_nova_console_container-dccb2ccc]
skipping: [infra01-cluster2_nova_scheduler_container-4e7804bf]
skipping: [infra02-cluster2_nova_scheduler_container-8c25eaa2]
skipping: [infra03-cluster2_nova_scheduler_container-038fc9cd]
skipping: [infra01-cluster2_nova_api_metadata_container-3a6d052a]
skipping: [infra02-cluster2_nova_api_metadata_container-d19a6d1b]
skipping: [infra03-cluster2_nova_console_container-141b324f]
skipping: [infra01-cluster2_nova_cert_container-6adf9c1d]
skipping: [infra02-cluster2_nova_cert_container-fda52512]
skipping: [infra03-cluster2_nova_cert_container-87ea7931]
skipping: [infra01-cluster2_nova_api_os_compute_container-bd6b4287]
skipping: [infra02-cluster2_nova_api_os_compute_container-51eda994]
skipping: [infra03-cluster2_nova_api_os_compute_container-8766a2c9]
skipping: [infra01-cluster2_nova_conductor_container-9b3f7b3d]
skipping: [infra02-cluster2_nova_conductor_container-bf976eb2]
skipping: [infra03-cluster2_nova_conductor_container-a12a7931]
skipping: [infra03-cluster2_nova_api_metadata_container-f0764300]
skipping: [infra01-cluster2_nova_api_placement_container-4a96f3f2]
fatal: [compute01-cluster2]: FAILED! => {"failed": true, "msg": "The conditional check '{{ ansible_hostname in (nova_service_list.stdout | from_json | selectattr('Binary', 'equalto', 'nova-compute') | map(attribute='Host') | list) }}' failed. The error was: No JSON object could be decoded"}
skipping: [infra02-cluster2_nova_api_placement_container-5cb3ca28]
skipping: [infra03-cluster2_nova_api_placement_container-e17e5acb]
fatal: [compute02-cluster2]: FAILED! => {"failed": true, "msg": "The conditional check '{{ ansible_hostname in (nova_service_list.stdout | from_json | selectattr('Binary', 'equalto', 'nova-compute') | map(attribute='Host') | list) }}' failed. The error was: No JSON object could be decoded"}

The inventory hostnames were:

compute01-cluster2
compute02-cluster2

While the hostname on the server (and in nova service-list were):

i812847.NewtonTest.com
i812846.NewtonTest.com

While it may not be best practice to have the hostnames in inventory not match the actual hostnames on the server, I could not find anywhere in the documentation that calls out making sure the hostnames either match or can match the conditional check presented here. To work around this, I had to munge my inventory file but the conditional now passes. It may be helpful to update the docs to reflect best practices around naming consistency.

Changed in openstack-ansible:
assignee: nobody → Andy McCrae (andrew-mccrae)
status: New → In Progress
assignee: Andy McCrae (andrew-mccrae) → Amy Marrich (amy-marrich)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_nova (master)

Reviewed: https://review.openstack.org/439658
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_nova/commit/?id=5950d99f46388f6e4bb5800fe19719654d7080f8
Submitter: Jenkins
Branch: master

commit 5950d99f46388f6e4bb5800fe19719654d7080f8
Author: Andy McCrae <email address hidden>
Date: Wed Mar 1 15:34:09 2017 +0000

    Adjust ansible_hostname to ansible_nodename

    ansible vars are as follows:
    self.facts['hostname'] = platform.node().split('.')[0]
    self.facts['nodename'] = platform.node()

    We should use the "nodename" var instead of the hostname variable.

    Closes-Bug: #1667193
    Change-Id: Id98016cfffd30d2adaec058c861771f9aefe27b3

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

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/440565

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

Reviewed: https://review.openstack.org/440565
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_nova/commit/?id=657d10c99cfe4276e8db73dff32fc7182ec6010b
Submitter: Jenkins
Branch: stable/ocata

commit 657d10c99cfe4276e8db73dff32fc7182ec6010b
Author: Andy McCrae <email address hidden>
Date: Wed Mar 1 15:34:09 2017 +0000

    Adjust ansible_hostname to ansible_nodename

    ansible vars are as follows:
    self.facts['hostname'] = platform.node().split('.')[0]
    self.facts['nodename'] = platform.node()

    We should use the "nodename" var instead of the hostname variable.

    Closes-Bug: #1667193
    Change-Id: Id98016cfffd30d2adaec058c861771f9aefe27b3
    (cherry picked from commit 5950d99f46388f6e4bb5800fe19719654d7080f8)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_nova 15.0.0.0rc2

This issue was fixed in the openstack/openstack-ansible-os_nova 15.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_nova 16.0.0.0b1

This issue was fixed in the openstack/openstack-ansible-os_nova 16.0.0.0b1 development milestone.

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.