-
Notifications
You must be signed in to change notification settings - Fork 741
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
Invalid Conditionals in user_accounts.yml #255
Comments
Hey @ljkimmel, thanks your taking time to look at this! it seems you're right. I just tested it with a non-existing login.defs file:
I guess the Ansible-logic changed here since writing this code.
Yes, that's the conclusion of the above bug. :( We'll have to fix this. Do you want to try yourself at this? |
I'll take a look at it. |
- Added logic to pull uid_min from login.defs when it returns an integer value greater than 0. - Add logic so that Debian systems use inherit uid_max=999 when a uid_max was not found in login.defs. - Add logic so that all other systems inherit uid_max=499 only when the value was not already found in login.defs or set for Debian systems.
- Added logic to pull uid_min from login.defs when it returns an integer value greater than 0. - Add logic so that Debian systems use inherit uid_max=999 when a uid_max was not found in login.defs. - Add logic so that all other systems inherit uid_max=499 only when the value was not already found in login.defs or set for Debian systems. Signed-off-by: Lesley Kimmel <[email protected]>
- Added logic to pull uid_min from login.defs when it returns an integer value greater than 0. - Add logic so that Debian systems use inherit uid_max=999 when a uid_max was not found in login.defs. - Add logic so that all other systems inherit uid_max=499 only when the value was not already found in login.defs or set for Debian systems. Signed-off-by: Lesley Kimmel <[email protected]>
- Added logic to pull uid_min from login.defs when it returns an integer value greater than 0. - Add logic so that Debian systems use inherit uid_max=999 when a uid_max was not found in login.defs. - Add logic so that all other systems inherit uid_max=499 only when the value was not already found in login.defs or set for Debian systems. Signed-off-by: Lesley Kimmel <[email protected]>
I'm a bit new to Ansible but experienced with coding and CM tools in general so I could be wrong here...
It appears that the check for the UID_MIN value in login.defs assigns a data object (JSON) to the 'uid_min' variable regardless of whether the file exists or not. Therefore, the test for 'when: uid_min is defined' ALWAYS passes.
The other tests for 'when: not uid_min' NEVER pass since the variable always has some value.
Also, even if the two tasks to set 'uid_max' were able to run, they would likely always set the value for ANY system to 499. Even though Debian systems have more specific logic that task comes first so the value may get set to 999 but the very next task will still set it to 499 when login.defs does not exist.
The text was updated successfully, but these errors were encountered: