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

[FEATURE REQUEST] file.symlink should not try to set ownership #63093

Closed
nicholasmhughes opened this issue Nov 21, 2022 · 1 comment · Fixed by #63106
Closed

[FEATURE REQUEST] file.symlink should not try to set ownership #63093

nicholasmhughes opened this issue Nov 21, 2022 · 1 comment · Fixed by #63106
Labels
Feature new functionality including changes to functionality and code refactors, etc. State-Module
Milestone

Comments

@nicholasmhughes
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
The file.symlink state always sets the user/group on the symlink, even when not explicitly set by using the available parameters. This functionality departs from file.managed, which does not alter existing permissions if not explicitly set by parameter.

Describe the solution you'd like
Changing the existing operation to mirror how file.managed handles user/group permissions would be one solution. However, this would change existing outcomes... so we'd probably want a deprecation period. Another solution would be to allow for a switch to "inherit" the permissions from the existing link. This would not impact existing solutions, and would also allow for the switch default to be changed after a deprecation period if desirable.

Describe alternatives you've considered
Current workaround via templating is shown below.

{% set path = "/tmp/mylink" -%}
manage_symlink:
  file.symlink:
    - name: {{ path }}
    - target: /tmp/target
    - force: true
{% if salt.file.is_link(path) %}
    - user: "{{ salt.file.get_user(path, follow_symlinks=False) }}"
    - group: "{{ salt.file.get_group(path, follow_symlinks=False) }}"
{% endif -%}

Additional context
Similar to #39360

Please Note
If this feature request would be considered a substantial change or addition, this should go through a SEP process here https://github.com/saltstack/salt-enhancement-proposals, instead of a feature request.

@nicholasmhughes nicholasmhughes added Feature new functionality including changes to functionality and code refactors, etc. needs-triage labels Nov 21, 2022
@OrangeDog
Copy link
Contributor

As the duplicate was already approved, but then staled, I've approved this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. State-Module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants