Hi Alan,
thanks for the post.
On 2020-05-06 16:29, Alan Batie wrote:
>
>
>desc "test ensuring group absent";
>
>task "group_absent", sub {
>
> group "games", gid => 20, ensure => "absent";
>
>};
>
># rex group_absent
>
>[2020-05-06 16:25:49] INFO - Running task group_absent on <local>
>
>[2020-05-06 16:25:50] ERROR - Error executing task:
>
>[2020-05-06 16:25:50] ERROR - Error deleting group games at
>/usr/local/share/perl5/Rex/User/Linux.pm line 511, <> line 30.
>
>
>[2020-05-06 16:25:50] ERROR - 1 out of 1 task(s) failed:
>
>[2020-05-06 16:25:50] ERROR - group_absent failed on <local>
>
>[2020-05-06 16:25:50] ERROR - Error deleting group games at /usr
>/local/share/perl5/Rex/User/Linux.pm line 511, <> line 30.
>
>Why is this erroring?
The exact reason for the error should be visible in the debug output
(rex -d group_absent).
>The group doesn't exist, and that's what it's
>supposed to be making sure of, right?
If it tries and fails to remove a non-existing group, then it does
indeed sound like a bug.
>Still happening with 1.10.0...
Sounds like you already experienced it with an earlier version too.
Please check our GitHub issue tracker[1] if this has been already
reported, and if not, make sure to create a bug report.
I expect a fix for this could definitely land in the next release.
Until then, as a workaround, you may check if the group exists first,
and then only call the removal if the group is there.
[1]:
https://github.com/RexOps/Rex/issues
Cheers,
FErki