Bug 1638939

Summary: [ansible e2e] Ansible playbook for end-to-end deployment needs improvement
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: SATHEESARAN <sasundar>
Component: rhhiAssignee: Gobinda Das <godas>
Status: CLOSED ERRATA QA Contact: SATHEESARAN <sasundar>
Severity: high Docs Contact:
Priority: medium    
Version: rhhiv-1.5CC: godas, musoni, rhs-bugs, sabose
Target Milestone: ---Keywords: Improvement
Target Release: RHHI-V 1.8   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-04 14:50:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1779975    
Attachments:
Description Flags
Modified gluster_inventory file none

Description SATHEESARAN 2018-10-13 05:33:37 UTC
Description of problem:
-----------------------
The ansible playbook meant for end-to-end deployment works good. But there are few aspects of the playbooks that needs improvement.

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
RHHI 2.0

How reproducible:
------------------
Always

Steps to Reproduce:
-------------------
1. Edit the ansible playbook to suit your requirement
2. Run the playbook for deployment

Expected results:
-----------------
Improved playbook easy to read, edit and run

Comment 1 SATHEESARAN 2018-10-13 06:51:09 UTC
Here are the themes:

1. Make it easy to read
------------------------
a. It would be hard time figuring what are all the values that needs to changed and what not to. To help them, the values to be edited can be mentioned in angular braces. There is already a separate bug raised by Mugdha for the same.
Example:
lvsize=200G
should be there as: lvsize=<200G>

b. More comments for clarification.
For example: No clear statements provided for lvcache setup

c. Use the same variable names for vdo, VG, thinpool, lvcache,etc used in gdeploy configuration
use: 
vdo_sdb, vdo_sdc
gluster_vg_sdb, gluster_vg_sdc
gluster_thinpool_sdb, gluster_thinpool_sdc
lvcache, lvcachemeta

d. Do not use partitions in example, /dev/sdb1, vdo_sdb1, as do not really support that in RHHI deployment.

e. Example uses sdb, sdc while creating VDO, but while creating thinpool, only shows creation of thinpool on device sdb only. Keep the example consistent


2. The hash symbol that represent the comments could be organized
For example:
# With Dedupe & Compression
      #gluster_infra_volume_groups:
        #- vgname: vg_sdb1
          #pvname: /dev/mapper/vdo_sdb1
        #- vgname: vg_sdb2
          #pvname: /dev/mapper/vdo_sdb2

Expected:
# With Dedupe & Compression
      #gluster_infra_volume_groups:
      #  - vgname: vg_sdb1
      #    pvname: /dev/mapper/vdo_sdb1
      #  - vgname: vg_sdb2
      #    pvname: /dev/mapper/vdo_sdb2

2. Remove redundant definitions
--------------------------------
For each host 'gluster_infra_mount_devices' is defined twice. One would suffice, tested and it works.

Example:
Following definitions under the same host
<snip>
     gluster_infra_mount_devices:
        - path: /gluster_bricks/engine
          lvname: gluster_lv_engine
          vgname: vg_sdb1
        - path: /gluster_bricks/data
          lvname: gluster_lv_data
          vgname: vg_sdb2

# Mount the devices
      gluster_infra_mount_devices:
         - { path: '/gluster_bricks/data', vgname: vg_sdb2, lvname: gluster_lv_data }
         - { path: '/gluster_bricks/vmstore', vgname: vg_sdb2, lvname: gluster_lv_vmstore }
         - { path: '/gluster_bricks/engine', vgname: vg_sdb1, lvname: gluster_lv_engine }

</snip>

3. Remove using 'include' playbook
-----------------------------------
hc-ansible-deployment/he-deployment.yml uses 
'- include: add_hosts_storage_domains.yml'

It should be replaced by import_playbook, as 'include' is getting deprecated by ansible-2.8

Comment 2 SATHEESARAN 2018-10-13 06:51:49 UTC
I am attaching the playbook with above said ( comment1 ) changes.

Comment 3 SATHEESARAN 2018-10-13 06:52:38 UTC
Created attachment 1493464 [details]
Modified gluster_inventory file

Comment 4 Sahina Bose 2018-10-30 09:15:03 UTC
Gobinda, can you take a look?

Comment 5 Sahina Bose 2018-11-20 09:52:57 UTC
*** Bug 1634642 has been marked as a duplicate of this bug. ***

Comment 6 Sahina Bose 2018-12-18 07:26:51 UTC
Please create a bug in gluster-ansible roles if required.

Comment 7 SATHEESARAN 2019-02-22 10:05:04 UTC
Now with RHVH 4.2.8 cockpit uses gluster-ansible roles, still we need this fix.
The reason behind this is that the user/customer may prefer to automate the deployment,
and prefer to use ansible-playbook without invoking gluster-ansible.

So in this cases, the fix is required and its needs to shipped through gluster-ansible-roles

Comment 8 Yaniv Kaul 2019-09-12 09:13:12 UTC
(In reply to SATHEESARAN from comment #2)
> I am attaching the playbook with above said ( comment1 ) changes.

Why not contribute it upstream?

Comment 9 SATHEESARAN 2019-10-11 10:49:31 UTC
(In reply to Yaniv Kaul from comment #8)
> (In reply to SATHEESARAN from comment #2)
> > I am attaching the playbook with above said ( comment1 ) changes.
> 
> Why not contribute it upstream?

Thanks Yaniv. Yes, I have done the changes upstream and also its merged
https://github.com/gluster/gluster-ansible/pull/80

Comment 10 SATHEESARAN 2020-05-07 01:23:10 UTC
Verified with gluster-ansible-roles-1.0.5-10.el8rhgs

The template inventory file is available in the following location:
/etc/ansible/roles/gluster.ansible/playbooks/hc-ansible-deployment/gluster_inventory.yml

And this file has all the required updates and can be consumed for automated gluster deployment

Comment 13 errata-xmlrpc 2020-08-04 14:50:55 UTC
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 (RHHI for Virtualization 1.8 bug fix and enhancement update), 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/RHEA-2020:3314