-
-
Notifications
You must be signed in to change notification settings - Fork 74
fix user and group fact #171
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
Conversation
While our script has no need to write to the file I do wonder why you are having this issue when no one else has. |
What does
say? |
Output of stat /etc/passwd : |
That looks fine, how are you running the Saltbox command? |
Like usual : sb install backup |
Is your sudo broken? |
The reason I ask is that sb normally auto elevates to running as root through sudo. |
I think not |
Well, root has write access and you cannot open it, that would make me worry about other issues here. |
When i sudo the script manually it works, I'm going to find my problem. |
Write to me on the discord if you are on it. I'll submit my own changes to the script through this PR so you at least get credit for getting me to rewrite the old stuff. |
I've added my own changes to the facts files but you should still find out what caused this as it isn't what is supposed to happen :) |
Description
After deploying the backup role, i see the Gathering Facts task on the warning.
TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************************************************** Monday 16 October 2023 23:01:51 +0200 (0:00:00.436) 0:00:00.436 ******** [WARNING]: Failure executing fact script (/srv/git/saltbox/ansible_facts.d/group.fact), rc: 1, err: Traceback (most recent call last): File "/srv/git/saltbox/ansible_facts.d/group.fact", line 6, in <module> file = open("/etc/group", "r+") PermissionError: [Errno 13] Permission denied: '/etc/group' [WARNING]: Failure executing fact script (/srv/git/saltbox/ansible_facts.d/user.fact), rc: 1, err: Traceback (most recent call last): File "/srv/git/saltbox/ansible_facts.d/user.fact", line 6, in <module> file = open("/etc/passwd", "r+") PermissionError: [Errno 13] Permission denied: '/etc/passwd'
After checking the script, I saw the open() function defined with "r+".
I set it to "r" and it works.
How Has This Been Tested?