Comment 1 for bug 2066357

Revision history for this message
Martin Ananda Boeker (mboeker) wrote :

More details from that error:

    Make sure your variable name does not contain invalid characters like '-': the JSON object must be str, bytes or bytearray, not AnsibleUndefined. the JSON object must be str, bytes or bytearray, not AnsibleUndefined

    The error appears to be in '/home/ubuntu/venvs/kolla-ansible/share/kolla-ansible/ansible/roles/nova-cell/tasks/wait_discover_computes.yml': line 47, column 7, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

        # that failed to register.
        - name: Fail if nova-compute service failed to register
          ^ here

This is the task at line 47:

    # NOTE(mgoddard): Use a separate fail task to ensure we fail only those hosts
    # that failed to register.
    - name: Fail if nova-compute service failed to register
      vars:
        # 'Host' field of all registered compute services.
        nova_compute_service_hosts: >-
          {{ hostvars[all_computes_in_batch[0]].nova_compute_services.stdout |
             from_json |
             map(attribute='Host') |
             list }}
        # 'Host' field of failed compute services.
        failed_compute_service_hosts: >-
          {{ expected_compute_service_hosts | difference(nova_compute_service_hosts) | list }}
        # Whether any compute services failed on this host.
        any_failed_services: >-
          {{ ansible_facts.nodename in failed_compute_service_hosts or
             (ansible_facts.hostname ~ "-ironic") in failed_compute_service_hosts }}
      fail:
        msg: >-
          The Nova compute service failed to register itself on the following
          hosts: {{ failed_compute_service_hosts | join(',') }}
      when: >-
        any_failed_services or
        (nova_compute_registration_fatal | bool and
         failed_compute_service_hosts | length > 0)