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

unixPB: adds become: true to all kernel config related tasks #3754

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mahdipub
Copy link

@mahdipub mahdipub commented Sep 30, 2024

in macos, touching /etc/sysctl.conf, puting content in it or rebooting system is what needs scallated priviledge because most of the time ansible user does not have enought authority to do system changes and need to use sudo. Adding become: true guarantee that ansible will not fail due to priviledge issue.

Sigend-off-by: [email protected]

Checklist
  • commit message has one of the standard prefixes
  • faq.md updated if appropriate
  • other documentation is changed or added (if applicable)
  • playbook changes run through VPC or QPC (if you have access)
  • VPC/QPC not applicable for this PR
  • for inventory.yml changes, bastillion/nagios/jenkins updated accordingly

Copy link
Contributor

@karianna karianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment why

in macos, touching `/etc/sysctl.conf`, puting content in it or rebooting system is what needs scallated priviledge because most of the time ansible user does not have enought authority to do system changes and need to use sudo. Adding `become: true` guarantee that ansible will not fail due to priviledge issue.

Sigend-off-by: [email protected]
@mahdipub
Copy link
Author

Can we add a comment why

Comment updated

@sxa
Copy link
Member

sxa commented Sep 30, 2024

@Haroon-Khel @gdams I'd appreciate your input on this in case there's any chance if it causing problems inside our infrastructure.

@Haroon-Khel
Copy link
Contributor

Haroon-Khel commented Oct 1, 2024

Adding become: true guarantee that ansible will not fail due to priviledge issue.

Do we have instances of it failing due to lack of privilege?

@mahdipub
Copy link
Author

mahdipub commented Oct 1, 2024

Adding become: true guarantee that ansible will not fail due to priviledge issue.

Do we have instances of it failing due to lack of privilege?

Here is a sample failure.

TASK [../AdoptOpenJDK_Unix_Playbook/roles/common : Writing kernel tuning parameters to /etc/sysctl.conf] ***************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 13] Permission denied: b'/Users/j9admin/.ansible/tmp/ansible-tmp-1727390025.62139-15462-277057472900612/tmpjpocvkr7' -> b'/private/etc/sysctl.conf'
fatal: [xxxx.xxx.xxxx.com]: FAILED! => {"changed": false, "msg": "The destination directory (/private/etc) is not writable by the current user. Error was: [Errno 13] Permission denied: b'/private/etc/.ansible_tmpff7031_ksysctl.conf'"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants