Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1547727 - Glusterfs installation fails when glusterfs_registry is undefined. Keyword: ansible_managed
Glusterfs installation fails when glusterfs_registry is undefined. Keyword: a...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer (Show other bugs)
3.9.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.9.0
Assigned To: Jose A. Rivera
Wenkai Shi
aos-scalability-39
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-21 14:58 EST by jmencak
Modified: 2018-03-28 10:29 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-03-28 10:29:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Ansible inventory and log file. (141.34 KB, application/x-gzip)
2018-02-21 14:58 EST, jmencak
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 None None None 2018-03-28 10:29 EDT

  None (edit)
Description jmencak 2018-02-21 14:58:05 EST
Created attachment 1398983 [details]
Ansible inventory and log file.

Description of problem:
With recent openshift-ansible, glusterfs installation fails unless "glusterfs_registry" group is also defined.

Version-Release number of the following components:

ansible 2.4.2.0
  config file = /root/.ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

openshift-ansible-3.9.0-0.47.0-5-g9d319b8

How reproducible:
Always

Steps to Reproduce:
1. Install glusterfs without [glusterfs_registry] group

Actual results:
Failure summary:


  1. Hosts:    b1.lan, b2.lan, b3.lan, b8.lan
     Play:     Load kernel modules for nodes
     Task:     Ensure device mapper modules loaded
     Message:  AnsibleUndefinedVariable: Unable to look up a name or access an attribute in template string (#{{ ansible_managed }}
               dm_thin_pool
               dm_multipath
               target_core_user
               {% if inventory_hostname in groups.glusterfs or inventory_hostname in groups.glusterfs_registry %}
               dm_snapshot
               dm_mirror
               {% endif %}
               ).
               Make sure your variable name does not contain invalid characters like '-': argument of type 'StrictUndefined' is not iterable

Expected results:
Glusterfs installation works even without [glusterfs_registry] group defined.

Additional info:
Ansible run in the attachment.
Workaround: use empty [glusterfs_registry] group in the inventory.
Proposed fix (credits Matt Bruzek): 
--- glusterfs.conf.j2      2018-02-21 16:08:56.194000000 +0100
+++ glusterfs.conf.j2.fixed      2018-02-21 19:40:01.251000000 +0100
@@ -2,7 +2,7 @@
 dm_thin_pool
 dm_multipath
 target_core_user
-{% if inventory_hostname in groups.glusterfs or inventory_hostname in groups.glusterfs_registry %}
+{% if ('glusterfs' in groups and inventory_hostname in groups['glusterfs']) or ('glusterfs_registry' in groups and inventory_hostname in groups['glusterfs_registry']) %}
 dm_snapshot
 dm_mirror
 {% endif %}

With openshift-ansible-3.9.0-0.42.0-48-gdea7e61 I was able to install without any workarounds.
Comment 1 Russell Teague 2018-02-21 16:26:39 EST
Bug introduced with https://github.com/openshift/openshift-ansible/pull/7028

Jose, could you take a look at this?
Comment 2 Jose A. Rivera 2018-02-21 16:36:53 EST
PR already submitted: https://github.com/openshift/openshift-ansible/pull/7237
Comment 4 Wenkai Shi 2018-03-04 22:04:52 EST
Verified with version openshift-ansible-3.9.0-0.53.0.git.0.f8f01ef.el7. Installation works well without [glusterfs_registry] group set(set [glusterfs] group only).

Remove NeedsTestCase Keyword since existing test case can cover it.
Comment 7 errata-xmlrpc 2018-03-28 10:29:21 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0489

Note You need to log in before you can comment on or make changes to this bug.