Running os_keystone stand-alone requires variables set by dynamic inventory

Bug #1631158 reported by Lance Bragstad
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Jimmy McCrory

Bug Description

I currently use the os_keystone role to setup a performance host [0] for measuring response times of keystone. My initial use case was to only define the variable required to deploy keystone inside a container as a bare metal host. This means I'm not using dynamic inventory.

When investigating a failed setup run of the OSIC Performance Bot, I noticed one of the setup playbooks [1] was failing [2]. The part that through me off was that I assumed hostvars were set when the facts were gathered from the system [3]. It turns out this is actually a variable that is set by the dynamic inventory.

I was able to work around the issue (with palendea and Apsu) by overriding the physical_host and ansible_host variables in my variable definitions [4].

For folks looking to run only specific stand-alone playbooks, would it make sense to document cases like this in an example?

[0] https://github.com/lbragstad/keystone-performance
[1] https://github.com/lbragstad/keystone-performance/blob/master/setup_database.yml
[2] http://cdn.pasteraw.com/s39bn1hok4c6zkl90lh4g241096edyl
[3] https://github.com/openstack/openstack-ansible-galera_server/blob/73595132cb5a9ef5ea7809ed1caefa940d325346/tasks/galera_pre_install.yml#L16
[4] http://cdn.pasteraw.com/462h1xpv6cp2yinmsozj5b5uqvcpkpb

Changed in openstack-ansible:
assignee: nobody → Jimmy McCrory (jimmy-mccrory)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-galera_server (master)

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

Changed in openstack-ansible:
status: New → In Progress
Revision history for this message
Jimmy McCrory (jimmy-mccrory) wrote :

ansible_ssh_host was deprecated and replaced with ansible_host in Ansible 2.
http://docs.ansible.com/ansible/intro_inventory.html#hosts-and-groups

OSA's dynamic inventory sets both to maintain compatibility between 1.9 and 2. There might be a case to maintain that support better within the stable/newton branch of roles, but probably not in master.

It looks like you're requiring ansible<2 in your repo, so ansible_host would still need to be defined either in your playbook vars or inventory.

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

Reviewed: https://review.openstack.org/384133
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-galera_server/commit/?id=1b0d2d3aa22564e21b7933d8ff21852c8f251ab4
Submitter: Jenkins
Branch: master

commit 1b0d2d3aa22564e21b7933d8ff21852c8f251ab4
Author: Jimmy McCrory <email address hidden>
Date: Sat Oct 8 09:48:40 2016 -0700

    Set default for physical_host if it's undefined

    physical_host is a host variable created by openstack-ansible's dynamic
    inventory. When using this role outside of an integrated OSA deployment
    it wouldn't be expected to be set. Fallback on using inventory_hostname
    when physical_host is undefined.

    Closes-Bug: 1631158
    Change-Id: I3364aac2e707d10ac9b4020dfcc0de7d4d158ff9

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

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/384325

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

Reviewed: https://review.openstack.org/384325
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-galera_server/commit/?id=3cc340c0f5ea8aaf920d334d039de1d900380b64
Submitter: Jenkins
Branch: stable/newton

commit 3cc340c0f5ea8aaf920d334d039de1d900380b64
Author: Jimmy McCrory <email address hidden>
Date: Sat Oct 8 09:48:40 2016 -0700

    Set default for physical_host if it's undefined

    physical_host is a host variable created by openstack-ansible's dynamic
    inventory. When using this role outside of an integrated OSA deployment
    it wouldn't be expected to be set. Fallback on using inventory_hostname
    when physical_host is undefined.

    Closes-Bug: 1631158
    Change-Id: I3364aac2e707d10ac9b4020dfcc0de7d4d158ff9
    (cherry picked from commit 1b0d2d3aa22564e21b7933d8ff21852c8f251ab4)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to openstack-ansible (stable/newton)

Reviewed: https://review.openstack.org/385370
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=0d824ce48db89e872caca5e579152caf3a79f005
Submitter: Jenkins
Branch: stable/newton

commit 0d824ce48db89e872caca5e579152caf3a79f005
Author: Jesse Pretorius <email address hidden>
Date: Wed Oct 12 10:46:05 2016 +0100

    Update role SHAs for 14.0.0 2016-10-12

    Related-Bug: #1627174
    Related-Bug: #1631158
    Related-Bug: #1630950
    Related-Bug: #1630953
    Related-Bug: #1631362
    Closes-Bug: #1631922
    Closes-Bug: #1631924
    Closes-Bug: #1631927

    Change-Id: I3657bf31136b5d00931bedc8c7cd7109a31c5c5f

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-galera_server 14.0.0.0rc3

This issue was fixed in the openstack/openstack-ansible-galera_server 14.0.0.0rc3 release candidate.

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

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