Closed ipruteanu-sie closed 4 months ago
As one may notice below, value for the shells have no leading spaces, therefore the below conditional
"/usr/sbin/nologin" != " /bin/false"
will be evaluated as True
, forcing the conditionals to not work as intended.
changed: [192.168.126.152] => (item=root) => {
"ansible_loop_var": "item",
"changed": true,
"cmd": "chage --warndays \"7\" \"root\"",
"delta": "0:00:00.091259",
"end": "2024-03-11 10:47:30.783333",
"invocation": {
"module_args": {
"_raw_params": "chage --warndays \"7\" \"root\"",
"_uses_shell": true,
"argv": null,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"stdin_add_newline": true,
"strip_empty_ends": true,
"warn": false
}
},
"item": {
"dir": "/root",
"gecos": "root",
"gid": 0,
"id": "root",
"password": "x",
"shell": "/bin/bash",
"uid": 0
},
"msg": "",
"rc": 0,
"start": "2024-03-11 10:47:30.692074",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
skipping: [192.168.126.152] => (item=bin) => {
"ansible_loop_var": "item",
"changed": false,
"item": {
"dir": "/bin",
"gecos": "bin",
"gid": 1,
"id": "bin",
"password": "x",
"shell": "/usr/sbin/nologin",
"uid": 1
},
"skip_reason": "Conditional result was False"
}
skipping: [192.168.126.152] => (item=daemon) => {
"ansible_loop_var": "item",
"changed": false,
"item": {
"dir": "/sbin",
"gecos": "daemon",
"gid": 2,
"id": "daemon",
"password": "x",
"shell": "/usr/sbin/nologin",
"uid": 2
},
"skip_reason": "Conditional result was False"
}
...
}
hi @ipruteanu-sie
Thank you as always for the PR and feedback, i'm trying to undertsnad how you have so many commits when so many are already in place. We seem to be adding files and changes that are already committed back in meaning that we are checking thing through multiple times.
Is there any chance you could pull the latest and just make the changes you need? That should hopefully mean we are only looking at the files you are trying to change.
Many thanks as always
uk-bolly
Hi @uk-bolly: #196 was created instead of current one.
5.6.1.{1-3} rules - chage impl
Overall Review of Changes: Adding
chage
settings for usersIssue Fixes:
189
Enhancements: Completing rules 5.6.1-3
How has this been tested?: Tested on VM