use of static group_vars creates a precedence problem

Bug #1460516 reported by Kevin Carter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Medium
Kevin Carter
Kilo
Fix Released
Medium
Kevin Carter
Trunk
Fix Released
Medium
Kevin Carter

Bug Description

The current use of group_vars creates a precedence problem as they become immutable at run time. This means that even if a user were to set a new default for a role variable using a variable file and the variable was specified in the group_vars/all.yml the item in the group_vars/all.yml would always win. To fix this it is recommended that the use of group_vars be minimized in-favor of moving the basic config vars into userspace. In this case I would recommend that we create a new variable file that contains all of the group_vars/all.yml which would provide the same functionality as we have today while also providing the user the ability to arbitrarily set / reset config as they deem fit. This change would also have the added benifit of allowing the user the ability to encrypt the contents of basic config using Ansible value.

Tags: in-kilo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-ansible-deployment (master)

Fix proposed to branch: master
Review: https://review.openstack.org/187102

Changed in openstack-ansible:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-ansible-deployment (master)

Reviewed: https://review.openstack.org/187102
Committed: https://git.openstack.org/cgit/stackforge/os-ansible-deployment/commit/?id=eb95036a7ea0e98fc931dd19f416015c66f3620c
Submitter: Jenkins
Branch: master

commit eb95036a7ea0e98fc931dd19f416015c66f3620c
Author: kevin <email address hidden>
Date: Mon Jun 1 00:10:43 2015 -0500

    Moved all of group_vars into a variable file

    Moved all of the group_vars/all.yml file into its own variable file
    This change was done to allow a user to override basic options
    without having to modify the default group variable files. While
    the group_vars/all.yml file is still present it is only holding the
    revision information that is used for release data and the minimal
    required kernel that allows the system to function using VXLAN.

    The upgrade script was modified to support the new "default"
    user_group_vars.yml file.

    tempest_swift_enabled was set to true in group_vars, so this has
    now been set as a default in the role instead.

    Commit 1bd2bc052a36c7f8c28e473d0a37fd29827198b0 implemented the
    package URL update for rabbitmq, but not the corresponding sha256
    update. This was not noticed due to group_vars overriding the URL
    to a previous version, resulting in the above-mentioned commit
    taking no effect. This patch therefore also corrects the sha256.

    Closes-Bug: #1460516
    Closes-Bug: #1460992
    Change-Id: I8e42bb124827bb276134d662c9a171db8e4c017e

Changed in openstack-ansible:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-ansible-deployment (kilo)

Fix proposed to branch: kilo
Review: https://review.openstack.org/188074

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-ansible-deployment (kilo)

Reviewed: https://review.openstack.org/188074
Committed: https://git.openstack.org/cgit/stackforge/os-ansible-deployment/commit/?id=3e524bfa10f52dc85275042b30d2936990a998ca
Submitter: Jenkins
Branch: kilo

commit 3e524bfa10f52dc85275042b30d2936990a998ca
Author: kevin <email address hidden>
Date: Mon Jun 1 00:10:43 2015 -0500

    Moved all of group_vars into a variable file

    Moved all of the group_vars/all.yml file into its own variable file
    This change was done to allow a user to override basic options
    without having to modify the default group variable files. While
    the group_vars/all.yml file is still present it is only holding the
    revision information that is used for release data and the minimal
    required kernel that allows the system to function using VXLAN.

    The upgrade script was modified to support the new "default"
    user_group_vars.yml file.

    tempest_swift_enabled was set to true in group_vars, so this has
    now been set as a default in the role instead.

    Commit 1bd2bc052a36c7f8c28e473d0a37fd29827198b0 implemented the
    package URL update for rabbitmq, but not the corresponding sha256
    update. This was not noticed due to group_vars overriding the URL
    to a previous version, resulting in the above-mentioned commit
    taking no effect. This patch therefore also corrects the sha256.

    Conflicts:
            playbooks/inventory/group_vars/all.yml

    Closes-Bug: #1460516
    Closes-Bug: #1460992
    Change-Id: I8e42bb124827bb276134d662c9a171db8e4c017e
    (cherry picked from commit eb95036a7ea0e98fc931dd19f416015c66f3620c)

Changed in openstack-ansible:
status: Fix Committed → Fix Released
Revision history for this message
Kevin Carter (kevin-carter) wrote :

Work on this issue needs to be revised. While the movement of the group_vars into user space fixes the problem it creates an upgrade nightmare as we can no longer add / remove items from the assumed groupvars without having users interact with the contents of the file. This issue is very apparent in the case of adding a service to an existing deployment, such as adding ceilometer to a stack that already had a kilo install. To that end we should move the user_group_vars.yml file into the playbooks default directory as "main.yml" which will keep the flexability of the userspace variables while also allowing us to maintain the base playbook variables in a more orderly fashion.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to os-ansible-deployment (master)

Reviewed: https://review.openstack.org/199216
Committed: https://git.openstack.org/cgit/stackforge/os-ansible-deployment/commit/?id=30f9443c5d2f3a3bbb51bf75ad5743ef46c9b0ef
Submitter: Jenkins
Branch: master

commit 30f9443c5d2f3a3bbb51bf75ad5743ef46c9b0ef
Author: kevin <email address hidden>
Date: Tue Jul 7 13:36:25 2015 -0500

    Moved user_group_vars to defaults

    The change moves the user_group_vars.yml from openstack_deploy/ to
    a standard default file. This will allow a deployer to override items
    in the file while also allowing development to make changes to the file
    that may impact its contents. When the file was moved out it was short
    sighted to move it into 100% userspace and should have simply become the
    main default file.

    Change-Id: Icfc3efea0a43d55b5a23bca2f64d4d6d73542d10
    Related-Bug: #1460516

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to os-ansible-deployment (kilo)

Related fix proposed to branch: kilo
Review: https://review.openstack.org/204320

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to os-ansible-deployment (kilo)

Reviewed: https://review.openstack.org/204320
Committed: https://git.openstack.org/cgit/stackforge/os-ansible-deployment/commit/?id=003f3318bc7cf332382ee54d73ca7e351f994a0f
Submitter: Jenkins
Branch: kilo

commit 003f3318bc7cf332382ee54d73ca7e351f994a0f
Author: kevin <email address hidden>
Date: Tue Jul 7 13:36:25 2015 -0500

    Moved user_group_vars to defaults

    The change moves the user_group_vars.yml from openstack_deploy/ to
    a standard default file. This will allow a deployer to override items
    in the file while also allowing development to make changes to the file
    that may impact its contents. When the file was moved out it was short
    sighted to move it into 100% userspace and should have simply become the
    main default file.

    Change-Id: Icfc3efea0a43d55b5a23bca2f64d4d6d73542d10
    Related-Bug: #1460516
    (cherry picked from commit 30f9443c5d2f3a3bbb51bf75ad5743ef46c9b0ef)

tags: added: in-kilo
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/openstack-ansible 11.2.11

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

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 11.2.12

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

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/openstack-ansible 11.2.14

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