gluster / gluster-ansible-infra

Ansible role to enable and deploy the backend of a Gluster cluster.
GNU General Public License v3.0
28 stars 36 forks source link

vg_create is not idempotent #132

Open hunter86bg opened 2 years ago

hunter86bg commented 2 years ago

For some reason vg_create is using a command that fails if you need to rerun the setup: https://github.com/gluster/gluster-ansible-infra/blob/6ce78857a1dc992364c8a5b564ca9b09c89bad9e/roles/backend_setup/tasks/vg_create.yml#L65

We need to use idempotent modules where possible

sac commented 2 years ago

It was idempotent earlier, but the commit https://github.com/gluster/gluster-ansible-infra/commit/0c1f454d98 changed that. But I do not see in the commit message why it was changed.

hunter86bg commented 2 years ago

@sac , I was wondering if that was on purpose or not. I can open a PR, but most probavly we need a way to setup Molecule for the roles in this repo.

Currently, a lot of oVirt users report issues with this one (for example something failed later and when rerunning it complains the VG exists).

hunter86bg commented 2 years ago

Also, I don't see peer review on that commit . How is that possible?

sac commented 2 years ago

I don't think you should spend time on the PR. The committer should revert his changes unless he has a good reason. We can ask the maintainers to take a look.

@rchikatw @gobindadas can you please take a look at this issue? Also, why did a non-idempotent CLI replace the module?

rchikatw commented 2 years ago

@sac @hunter86bg Hello, ansible-core 2.12 introduced from RHV 4.4 SP1 release and ansible-core no longer uses the gluster.gluster and community.general ansible collection. Because of this change, I have posted the patches to remove these gluster modules to CLI.

rchikatw commented 2 years ago

Because ansible-core 2.12 is no longer used these packages (gluster.gluster and community.general ansible collection) that means they have been removed from RHV packages

hunter86bg commented 2 years ago

@rchikatw we can't provide the modules with a separate rpm ? This role is used not only by RHV but also by other users I think it makes sense to include a task file for RHV separately while we keep the current task file with the modules for the rest of the world.

gobindadas commented 2 years ago

This is not the issue only for RHV, it's also issue for centos stream which has ansible-core. So it's a problem for both upstream and downstream.

hunter86bg commented 2 years ago

So, the modules need to be updated for ansible-core ?

gobindadas commented 2 years ago

So basically there are two ways to deal with it. 1- Change all the modules to command/shell 2- Convert all the modules into ansile collection and use those (Which need lot of effort and process) So we decided to go with command line approach for quicker fix.

hunter86bg commented 2 years ago

@gobindadas , I have never done an Ansible collection before but at least I can take a look if it's in my capabilities to do it.