-
Notifications
You must be signed in to change notification settings - Fork 139
Don't try to change sysctl settings in a container #65
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
base: master
Are you sure you want to change the base?
Conversation
|
An alternative would be to keep trying to set sysctl settings, but only output a warning if it fails. But this approach wouldn't work with the |
|
I was thinking about a block to have just one when clause. Or an include_tasks when statement. And I wanted to check if there is no ansible variable set by gather_facts to find out if the playbook is running inside a container. |
|
I have been using something like this in the past:
Not sure if there is a more conveniant way. |
|
Could we also leverage the systemd-detect-virt for that? Here a short snippet with a local change only (would be necessary at every step). If a global change is more suitable I can test this as well. This checks only for containers, not for VMs. |
|
I'm afraid no. In a container the command I found two facts:
I only have to check the values inside a container. And hope that won't change when the user is using podman. |
|
It would be: But next iI'm getting a So it seems to make no sense to run the playbook in a container. Or? |
|
Hi Reiner, For me the start and enable works in the container (which one are you testing? podman?) |
|
I'm developing and testing the "nextcloud" playbook on aws ec2. Sometimes on hetzner vms. I wouldn't do it in a container. Because of the limitations we discuss here. And I don't have any experience with lxc so I wasn't aware about any problems inside an lxc container. So if you're modifications are working now in lxc it's fine. If they don't work in docker or podman imho it doesn't matter because the playbook is meant to run in an docker container. One should do this with dockerfile. |
No description provided.