kolla-ansible reconfigure fails when fernet is used

Bug #1636047 reported by t.goto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Critical
t.goto
Newton
Fix Released
Critical
t.goto

Bug Description

Hello.
I'm using kolla master on CentOS and found Reconfigure does not work when fernet is used as token.

Here's the ansible log.
http://paste.openstack.org/show/586860/

I think culprit lies on "Add fernet related components to variable if fernet is enabled" task in keystone/tasks/reconfigure.yml.

You can't set a variable using newly created variable in same task.
I checked it in ansible 2.1.2.0 with following test playbook.

--------------------------------------------------------

- name: set one variable first
  set_fact:
    first_fact:
      - { name: keystone, group: keystone }

- name: set new varialbe and simultaneously set it to another variable
  set_fact:
    new_fact:
      - { name: keystone_fernet, group: keystone }
      - { name: keystone_ssh, group: keystone }
    another_fact: "{{ first_fact + new_fact }}"

- name: debug here
  debug: var=another_fact

--------------------------------------------------------

TASK [set_fact_test : set new varialbe and simultaneously set it to another variable] ***
fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'new_fact' is undefined\n\nThe error appears to have been in '/home/goto/test/roles/set_fact_test/tasks/main.yml': line 10, 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: set new varialbe and simultaneously set it to another variable\n ^ here\n"}

--------------------------------------------------------

So, we will need to separate this task.

t.goto (t.goto)
Changed in kolla:
assignee: nobody → Tomoya Goto (t.goto)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

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

Changed in kolla:
status: New → In Progress
Revision history for this message
t.goto (t.goto) wrote :

Hello,
Kolla-ansible reconfigure worked with above fix in my lab.

Problem is, I had to split one task into two. It is kind of tedious.
If you have any good Ansible way, please let me know. :)

Changed in kolla:
milestone: none → ocata-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.openstack.org/390178
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=8c8e296ecf7d6259cd29a5aaefb8d03ba5d8c05a
Submitter: Jenkins
Branch: master

commit 8c8e296ecf7d6259cd29a5aaefb8d03ba5d8c05a
Author: Tomoya Goto <email address hidden>
Date: Mon Oct 24 15:48:37 2016 +0900

    Fix fernet related components added to fact var properly.

    Previous version of keystone reconfigure fails at adding fernet
    components to fact variable "keystone_item".
    Ansible can not create fact variable using newly created variable
    in a same task.

    This patch set split this task into two tasks, first create variable
    containing fernet components, then merge it to "keystone_item".

    Change-Id: I15571ab20d6104d30350e8b922401b462336fca0
    Closes-Bug: #1636047

Changed in kolla:
status: In Progress → Fix Released
Revision history for this message
Steven Dake (sdake) wrote :

GROAN

Changed in kolla:
importance: Undecided → Critical
Revision history for this message
t.goto (t.goto) wrote :

Thanks for creating milestone for stable/newton. I'm checking this one.

Revision history for this message
Steven Dake (sdake) wrote :

Tomoya,

Please backport to newton asap. We need to cut a release this week for a different critical bug.

Revision history for this message
t.goto (t.goto) wrote :

Steven,
OK. I'll be testing this today.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (stable/newton)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla (stable/newton)

Change abandoned by t.goto (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/391920
Reason: I'll cherry-pick from original commit(master), and submit again.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (stable/newton)

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

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

Reviewed: https://review.openstack.org/392197
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=816b32fa88e385d478374f5e5559ce5a6cab86a5
Submitter: Jenkins
Branch: stable/newton

commit 816b32fa88e385d478374f5e5559ce5a6cab86a5
Author: Tomoya Goto <email address hidden>
Date: Mon Oct 24 15:48:37 2016 +0900

    Fix fernet related components added to fact var properly.

    Previous version of keystone reconfigure fails at adding fernet
    components to fact variable "keystone_item".
    Ansible can not create fact variable using newly created variable
    in a same task.

    This patch set split this task into two tasks, first create variable
    containing fernet components, then merge it to "keystone_item".

    Change-Id: I15571ab20d6104d30350e8b922401b462336fca0
    Closes-Bug: #1636047
    (cherry picked from commit 8c8e296ecf7d6259cd29a5aaefb8d03ba5d8c05a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 4.0.0.0b1

This issue was fixed in the openstack/kolla 4.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 3.0.2

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