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
In Progress
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.

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.