-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
ini_file creates new file instead of following symlink #6470
Comments
Files identified in the description: If these files are incorrect, please update the |
ansibullbot
added
bug
This issue/PR relates to a bug
module
module
plugins
plugin (any type)
labels
May 1, 2023
goneri
added a commit
to goneri/community.general
that referenced
this issue
May 20, 2023
This is a bug fix that address a situation where `community.general.ini_file` was destroying symlinks instead of updating of updating their targets. Closes: ansible-collections#6470
Hi @tod-uma, Thank you for reporting this. I just pushed a PR that address the problem. Can you give it a try. |
patchback bot
pushed a commit
that referenced
this issue
May 29, 2023
* ini_file: Don't creates new file instead of following symlink This is a bug fix that address a situation where `community.general.ini_file` was destroying symlinks instead of updating of updating their targets. Closes: #6470 * ini_file: add the follow parameter If `poth` points on a symlink and `follow` is true, the `ini_file` plugin will preserve the symlink and modify the target file. * adjust the documentation of the new key - yes/no -> true/false. - new key will be introduced in 7.1.0. - clean up the `state=link` part. (cherry picked from commit c76af60)
felixfontein
pushed a commit
that referenced
this issue
May 29, 2023
…le instead of following symlink (#6598) ini_file: Don't creates new file instead of following symlink (#6546) * ini_file: Don't creates new file instead of following symlink This is a bug fix that address a situation where `community.general.ini_file` was destroying symlinks instead of updating of updating their targets. Closes: #6470 * ini_file: add the follow parameter If `poth` points on a symlink and `follow` is true, the `ini_file` plugin will preserve the symlink and modify the target file. * adjust the documentation of the new key - yes/no -> true/false. - new key will be introduced in 7.1.0. - clean up the `state=link` part. (cherry picked from commit c76af60) Co-authored-by: Gonéri Le Bouder <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
When you use community.general.ini_file to modify a symlink (like /etc/yum.conf which is a symlink to /etc/dnf/dnf.conf on a oel9 machine) it appears to copy the file, edit it and replace the symlink with the edited file. There should at least be an option to follow symlinks instead of replacing them.
Issue Type
Bug Report
Component Name
ini_file
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
OracleLinux 9
Steps to Reproduce
Expected Results
I expected it to edit the file that already existed instead of creating a new one.
Actual Results
Instead of modifying the existing file, it created a new file and replaced the symlink with it.
Code of Conduct
The text was updated successfully, but these errors were encountered: