Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option system=yes not honored for module group. #2836

Closed
LucianoCavalheiro opened this issue May 3, 2013 · 3 comments
Closed

Option system=yes not honored for module group. #2836

LucianoCavalheiro opened this issue May 3, 2013 · 3 comments

Comments

@LucianoCavalheiro
Copy link
Contributor

I was trying to create a new system group (gid<1000), however the system was always selecting a non-system gid for the new group. After debugging a bit a was able to track down the problem as mistaken comparison between a boolean (True) and string "yes"). The changes bellow would fix the issue:

--- ansible/system/group.old    2013-05-03 18:59:27.581198321 -0300
+++ ansible/system/group.new    2013-05-03 19:00:34.900774851 -0300
@@ -103,7 +103,7 @@
             if key == 'gid' and kwargs[key] is not None:
                 cmd.append('-g')
                 cmd.append(kwargs[key])
-            elif key == 'system' and kwargs[key] == 'yes':
+            elif key == 'system' and kwargs[key] == True:
                 cmd.append('-r')
         cmd.append(self.name)

@@ -192,7 +192,7 @@
         for key in kwargs:
             if key == 'gid' and kwargs[key] is not None:
                 cmd.append('id='+kwargs[key])
-            elif key == 'system' and kwargs[key] == 'yes':
+            elif key == 'system' and kwargs[key] == True:
                 cmd.append('-a')
         cmd.append(self.name)
         return self.execute_command(cmd)

Best regards,

Luciano

@mpdehaan
Copy link
Contributor

mpdehaan commented May 4, 2013

Thanks! Please submit this as a pull request.

@LucianoCavalheiro
Copy link
Contributor Author

Done. As it was my first pull request on github, please let me know if I made any mistakes.

mpdehaan added a commit that referenced this issue May 5, 2013
Fix #2836. Ensure proper handling of option "system=yes" in module "grou...
@mpdehaan
Copy link
Contributor

mpdehaan commented May 5, 2013

merged in, thanks!

jimi-c pushed a commit that referenced this issue Dec 6, 2016
* Add oVirt module to manage VMs

This patch add oVirt module to manage Virtual Machines

* Add oVirt module to manage authentication

This patch add oVirt module to manage authentication

* Add oVirt module to manage disks

* Added VM state management and fixups
robinro pushed a commit to robinro/ansible that referenced this issue Dec 9, 2016
* Add oVirt module to manage VMs

This patch add oVirt module to manage Virtual Machines

* Add oVirt module to manage authentication

This patch add oVirt module to manage authentication

* Add oVirt module to manage disks

* Added VM state management and fixups
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants