-
Notifications
You must be signed in to change notification settings - Fork 153
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
sysctl
module replaces symlink with a real file
#111
Comments
Akasurde
added
the
waiting_on_contributor
Needs help. Feel free to engage to get things unblocked
label
Jun 4, 2021
satken2
pushed a commit
to satken2/ansible.posix
that referenced
this issue
Jun 10, 2021
satken2
pushed a commit
to satken2/ansible.posix
that referenced
this issue
Jun 11, 2021
satken2
pushed a commit
to satken2/ansible.posix
that referenced
this issue
Jun 11, 2021
satken2
pushed a commit
to satken2/ansible.posix
that referenced
this issue
Jun 11, 2021
satken2
pushed a commit
to satken2/ansible.posix
that referenced
this issue
Jun 11, 2021
aminvakil
added a commit
to aminvakil/ansible.posix
that referenced
this issue
Jun 11, 2021
)" This reverts commit 34b4677.
aminvakil
pushed a commit
to aminvakil/ansible.posix
that referenced
this issue
Jun 11, 2021
aminvakil
pushed a commit
to aminvakil/ansible.posix
that referenced
this issue
Jun 11, 2021
aminvakil
pushed a commit
to aminvakil/ansible.posix
that referenced
this issue
Jun 11, 2021
aminvakil
pushed a commit
to aminvakil/ansible.posix
that referenced
this issue
Jun 11, 2021
aminvakil
pushed a commit
to aminvakil/ansible.posix
that referenced
this issue
Jun 11, 2021
aminvakil
added a commit
to aminvakil/ansible.posix
that referenced
this issue
Jun 11, 2021
)" This reverts commit 34b4677.
saito-hideki
added
has_pr
and removed
waiting_on_contributor
Needs help. Feel free to engage to get things unblocked
labels
Nov 29, 2021
jillr
added a commit
to satken2/ansible.posix
that referenced
this issue
May 7, 2024
)" This reverts commit 34b4677.
jillr
pushed a commit
to satken2/ansible.posix
that referenced
this issue
May 7, 2024
jillr
pushed a commit
to satken2/ansible.posix
that referenced
this issue
May 7, 2024
jillr
pushed a commit
to satken2/ansible.posix
that referenced
this issue
May 7, 2024
jillr
pushed a commit
to satken2/ansible.posix
that referenced
this issue
May 7, 2024
jillr
pushed a commit
to satken2/ansible.posix
that referenced
this issue
May 7, 2024
jillr
added a commit
to satken2/ansible.posix
that referenced
this issue
May 7, 2024
)" This reverts commit 34b4677.
softwarefactory-project-zuul bot
added a commit
that referenced
this issue
May 9, 2024
Fixed sysctl to work on symlinks SUMMARY Fixes #111. This issue reports a bug of sysctl that the module does not work properly when sysctl_file is a symlink. I Fixed the bug by inserting os.path.realpath to get real path. When sysctl_file is a real file, os.path.realpath return the original path as is. ISSUE TYPE Bugfix Pull Request COMPONENT NAME sysctl ADDITIONAL INFORMATION I have executed the script described in #111 and confirmed that it works properly. But I need to add some tests. satken@dockerhost1:~/ansible$ sudo docker run --rm -v ${PWD}:/work -w /work -e ANSIBLE_LIBRARY=/work/ansible.posix -e ANSIBLE_HOST_KEY_CHECKING=False satken2/ansible:3.3.0 ansible-playbook -i hosts main.yml PLAY [test] ******************************************************************** TASK [Gathering Facts] ********************************************************* ok: [192.168.91.76] TASK [test] ******************************************************************** ok: [192.168.91.76] => { "msg": "This is test" } TASK [command] ***************************************************************** changed: [192.168.91.76] TASK [command] ***************************************************************** ok: [192.168.91.76] TASK [debug] ******************************************************************* ok: [192.168.91.76] => { "sysctl_current_value.stdout": "kernel.randomize_va_space = 2" } TASK [copy] ******************************************************************** changed: [192.168.91.76] TASK [file] ******************************************************************** changed: [192.168.91.76] TASK [stat] ******************************************************************** ok: [192.168.91.76] TASK [assert] ****************************************************************** ok: [192.168.91.76] => { "changed": false, "msg": "/tmp/ansible_sysctl_test_symlink.conf is correct symlink" } TASK [sysctl | enable randomized layout of virtual address space] ************** changed: [192.168.91.76] TASK [stat] ******************************************************************** ok: [192.168.91.76] TASK [assert] ****************************************************************** ok: [192.168.91.76] => { "changed": false, "msg": "/tmp/ansible_sysctl_test_symlink.conf is correct symlink" } PLAY RECAP ********************************************************************* 192.168.91.76 : ok=12 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Reviewed-by: quidame Reviewed-by: Jill R
lumiere-bot bot
referenced
this issue
in coolguy1771/home-ops
Sep 16, 2024
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ansible.posix](https://redirect.github.com/ansible-collections/ansible.posix) | galaxy-collection | minor | `1.5.4` -> `1.6.0` | --- ### Release Notes <details> <summary>ansible-collections/ansible.posix (ansible.posix)</summary> ### [`v1.6.0`](https://redirect.github.com/ansible-collections/ansible.posix/blob/HEAD/CHANGELOG.rst#v160) [Compare Source](https://redirect.github.com/ansible-collections/ansible.posix/compare/1.5.4...1.6.0) \====== ## Release Summary This is the minor release of the `ansible.posix` collection. This changelog contains all changes to the modules and plugins in this collection that have been added after the release of `ansible.posix` 1.5.4. ## Major Changes - Dropping support for Ansible 2.9, ansible-core 2.15 will be minimum required version for this release ## Minor Changes - Add summary_only parameter to profile_roles and profile_tasks callbacks. - firewalld - add functionality to set forwarding ([https://github.com/ansible-collections/ansible.posix/pull/548](https://redirect.github.com/ansible-collections/ansible.posix/pull/548)). - firewalld - added offline flag implementation ([https://github.com/ansible-collections/ansible.posix/pull/484](https://redirect.github.com/ansible-collections/ansible.posix/pull/484)) - firewalld - respawn module to use the system python interpreter when the `firewall` python module is not available for `ansible_python_interpreter` ([https://github.com/ansible-collections/ansible.posix/pull/460](https://redirect.github.com/ansible-collections/ansible.posix/pull/460)). - firewalld_info - Only warn about ignored zones, when there are zones ignored. - firewalld_info - respawn module to use the system python interpreter when the `firewall` python module is not available for `ansible_python_interpreter` ([https://github.com/ansible-collections/ansible.posix/pull/460](https://redirect.github.com/ansible-collections/ansible.posix/pull/460)). - mount - add no_log option for opts parameter ([https://github.com/ansible-collections/ansible.posix/pull/563](https://redirect.github.com/ansible-collections/ansible.posix/pull/563)). - seboolean - respawn module to use the system python interpreter when the `selinux` python module is not available for `ansible_python_interpreter` ([https://github.com/ansible-collections/ansible.posix/pull/460](https://redirect.github.com/ansible-collections/ansible.posix/pull/460)). - selinux - respawn module to use the system python interpreter when the `selinux` python module is not available for `ansible_python_interpreter` ([https://github.com/ansible-collections/ansible.posix/pull/460](https://redirect.github.com/ansible-collections/ansible.posix/pull/460)). ## Removed Features (previously deprecated) - skippy - Remove skippy pluglin as it is no longer supported([https://github.com/ansible-collections/ansible.posix/issues/350](https://redirect.github.com/ansible-collections/ansible.posix/issues/350)). ## Bugfixes - Bugfix in the documentation regarding the path option for authorised_key([https://github.com/ansible-collections/ansible.posix/issues/483](https://redirect.github.com/ansible-collections/ansible.posix/issues/483)). - seboolean - make it work with disabled SELinux - synchronize - maintain proper formatting of the remote paths ([https://github.com/ansible-collections/ansible.posix/pull/361](https://redirect.github.com/ansible-collections/ansible.posix/pull/361)). - sysctl - fix sysctl to work properly on symlinks ([https://github.com/ansible-collections/ansible.posix/issues/111](https://redirect.github.com/ansible-collections/ansible.posix/issues/111)). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43Ny4wIiwidXBkYXRlZEluVmVyIjoiMzguNzcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUvYW5zaWJsZSIsInR5cGUvbWlub3IiXX0=--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
When the destination file for the
sysctl
module is a symlink, the module will replace that symlink with a real file. All other content in the file is carried forward, as expected. However, but I would have expected the symlink to be left and destination of the symlink instead be modified.Alternatively, if the module included the
follow: true
parameter (as does thecopy
module), then the behavior would be clear and expected.FWIW, this sounds VERY similar to ansible/ansible#49809.
ISSUE TYPE
COMPONENT NAME
Compnent:
ansible.posix.sysctl
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible node:
Target machine:
STEPS TO REPRODUCE
Run the following playbook:
EXPECTED RESULTS
From the above playbook, the output should end with:
ACTUAL RESULTS
From the above playbook, the output actually is:
The text was updated successfully, but these errors were encountered: