playbook os-glance-install.yml - "mount_var" is undefined

Bug #2032771 reported by Peter Struys
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Unassigned

Bug Description

When upgrading from yoga (25.3.3.dev3) to zed (26.1.3.dev6) with ./scripts/run_upgrade.sh in a test environment we are getting a fatal error in os-glance-install.yml : variable mount_var is undefined. Environment is Ubuntu 20.04 and OpenStack-Ansible.

Revision history for this message
Peter Struys (peterstruys) wrote :

full error

TASK [os_glance : Create glance directories] *******************************************************************************************************************************************************
fatal: [jommeke_glance_container-54815da2]: FAILED! => {"msg": "The conditional check '(item.dest | default(item.path)) not in glance_mount_points' failed. The error was: error while evaluating conditional ((item.dest | default(item.path)) not in glance_mount_points): {% set mps = [] %}\n{% for mp in glance_remote_client %}\n{% set _ = mps.append(mp.where | default(mount_var.local_path)) %}\n{% endfor %}\n{{ mps }}: 'mount_var' is undefined\n\nThe error appears to be in '/etc/ansible/roles/os_glance/tasks/glance_install.yml': line 67, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Create glance directories\n ^ here\n"}

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

Hi,

Can you kindly provide the value of glance_nfs_client variable you've defined in your overrides?

We've deprecated the variable glance_nfs_client and replaced it with `glance_remote_client` that has a different format:
https://opendev.org/openstack/openstack-ansible-os_glance/src/branch/master/defaults/main.yml#L236-L241

This has been mentioned in Yoga release notes: https://docs.openstack.org/releasenotes/openstack-ansible/yoga.html#relnotes-25-0-0-stable-yoga-deprecation-notes

While we've tried to keep compatibility with older format, it seems that there is indeed some bug in there. So my suggestion would be to ensure that variable format is updated until we're figuring out what is wrong with compatibility.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_glance (master)
Changed in openstack-ansible:
status: New → In Progress
Revision history for this message
Peter Struys (peterstruys) wrote : Re: [Bug 2032771] Re: playbook os-glance-install.yml - "mount_var" is undefined (solved)

Hi Dmitriy,

Thank you for directing my attention to this change variable. I missed it.

What I had in user_variables.yml :

    # glance_nfs_client:
    #   - server: "172.29.244.204"
    #     remote_path: "/openstack/glance/images"
    #     local_path: "/var/lib/glance/images"
    #     type: "nfs4"
    #     options: "_netdev,auto"

What I have now :

    glance_remote_client:
       - what: "172.29.244.204:/openstack/glance/images"
         where: "/var/lib/glance/images"
         type: "nfs4"
         options: "_netdev,auto"

Execution of playbook os-glance-install runs fine now.

    PLAY RECAP
    ****************************************************************************************************************************************************************************************
    ctrl01_glance_container-*** : ok=91   changed=27   unreachable=0
    failed=0 skipped=18   rescued=0    ignored=0
    ctrl02_glance_container-*** : ok=87   changed=27   unreachable=0
    failed=0 skipped=18   rescued=0    ignored=0
    ctrl03_glance_container-*** : ok=128  changed=34   unreachable=0
    failed=0 skipped=25   rescued=0    ignored=0

    EXIT NOTICE [Playbook execution success]
    **************************************

I will also change variable |"glance_nfs_local_directory" into
"||glance_images_local_directory". That old variable was also still there.
Maybe this change in variable names which is announced in the yoga
release notes could be repeated in the zed release notes ?

|Again, thank you for your prompt reply.
Have a nice day.

regards
Peter

Systemgroup
Dept.Computerscience, KU Leuven
Celestijnenlaan 200 A - bus 2402
3001 Leuven (Heverlee)
Belgium

On 8/23/23 12:12, Dmitriy Rabotyagov wrote:
> Hi,
>
> Can you kindly provide the value of glance_nfs_client variable you've
> defined in your overrides?
>
> We've deprecated the variable glance_nfs_client and replaced it with `glance_remote_client` that has a different format:
> https://opendev.org/openstack/openstack-ansible-os_glance/src/branch/master/defaults/main.yml#L236-L241
>
>
> This has been mentioned in Yoga release notes:https://docs.openstack.org/releasenotes/openstack-ansible/yoga.html#relnotes-25-0-0-stable-yoga-deprecation-notes
>
> While we've tried to keep compatibility with older format, it seems that
> there is indeed some bug in there. So my suggestion would be to ensure
> that variable format is updated until we're figuring out what is wrong
> with compatibility.
>

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

Intention was to add a note to release notes when we will delete old variables completely.

I'm glad that it works for you know. I've also pushed a patch to fix variables compatibility that will be backported back to Yoga.

Revision history for this message
Peter Struys (peterstruys) wrote : Re: [Bug 2032771] Re: playbook os-glance-install.yml - "mount_var" is undefined

Ok, I understand. So, if I would implement your code fix the old
variable would still work, correct ?

On 8/23/23 13:49, Dmitriy Rabotyagov wrote:
> Intention was to add a note to release notes when we will delete old
> variables completely.
>
> I'm glad that it works for you know. I've also pushed a patch to fix
> variables compatibility that will be backported back to Yoga.
>

--
mvg
Peter Struys

Systeemgroep
Dept.Computerwetenschappen, KU Leuven
Celestijnenlaan 200 A - bus 2402
3001 Leuven (Heverlee)
Belgium
tel. +32 16 321456

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

Yes, the idea is that it should.
Though we encourage to stop using old and deprecated variables as old ones along with compatibility path will be removed in upcoming releases.

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

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/892489
Committed: https://opendev.org/openstack/openstack-ansible-os_glance/commit/289ce991c420d7114b3a71a95602404e8ad7b0a0
Submitter: "Zuul (22348)"
Branch: master

commit 289ce991c420d7114b3a71a95602404e8ad7b0a0
Author: Dmitriy Rabotyagov <email address hidden>
Date: Wed Aug 23 12:16:29 2023 +0200

    Use correct default for glance_mount_points

    Back in Yoga we've refactored way of mounting remote filesystems
    for glance while keeping backwards compatibiltiy [1]

    However, there was a copy/paste error made while defining
    glance_mount_points with old format of glance_nfs_client.

    [1] https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/837550

    Change-Id: I755822089bf406f532a718db5b84df553cbc2084
    Closes-Bug: #2032771

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_glance (stable/2023.1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_glance (stable/zed)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_glance (stable/yoga)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_glance (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/900477
Committed: https://opendev.org/openstack/openstack-ansible-os_glance/commit/f0b9c42a246928325ca7bce9c82c8c3735c8f37b
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit f0b9c42a246928325ca7bce9c82c8c3735c8f37b
Author: Dmitriy Rabotyagov <email address hidden>
Date: Wed Aug 23 12:16:29 2023 +0200

    Use correct default for glance_mount_points

    Back in Yoga we've refactored way of mounting remote filesystems
    for glance while keeping backwards compatibiltiy [1]

    However, there was a copy/paste error made while defining
    glance_mount_points with old format of glance_nfs_client.

    [1] https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/837550

    Change-Id: I755822089bf406f532a718db5b84df553cbc2084
    Closes-Bug: #2032771
    (cherry picked from commit 289ce991c420d7114b3a71a95602404e8ad7b0a0)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_glance (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/900478
Committed: https://opendev.org/openstack/openstack-ansible-os_glance/commit/d6e25e9e457e767fea063ec80145cc4922370282
Submitter: "Zuul (22348)"
Branch: stable/zed

commit d6e25e9e457e767fea063ec80145cc4922370282
Author: Dmitriy Rabotyagov <email address hidden>
Date: Wed Aug 23 12:16:29 2023 +0200

    Use correct default for glance_mount_points

    Back in Yoga we've refactored way of mounting remote filesystems
    for glance while keeping backwards compatibiltiy [1]

    However, there was a copy/paste error made while defining
    glance_mount_points with old format of glance_nfs_client.

    [1] https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/837550

    Change-Id: I755822089bf406f532a718db5b84df553cbc2084
    Closes-Bug: #2032771
    (cherry picked from commit 289ce991c420d7114b3a71a95602404e8ad7b0a0)

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

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/900479
Committed: https://opendev.org/openstack/openstack-ansible-os_glance/commit/9cf3a69c751fe458a9ec1be08adc6a8090c9f32d
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 9cf3a69c751fe458a9ec1be08adc6a8090c9f32d
Author: Dmitriy Rabotyagov <email address hidden>
Date: Wed Aug 23 12:16:29 2023 +0200

    Use correct default for glance_mount_points

    Back in Yoga we've refactored way of mounting remote filesystems
    for glance while keeping backwards compatibiltiy [1]

    However, there was a copy/paste error made while defining
    glance_mount_points with old format of glance_nfs_client.

    [1] https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/837550

    Change-Id: I755822089bf406f532a718db5b84df553cbc2084
    Closes-Bug: #2032771
    (cherry picked from commit 289ce991c420d7114b3a71a95602404e8ad7b0a0)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_glance yoga-eom

This issue was fixed in the openstack/openstack-ansible-os_glance yoga-eom 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.