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

add "prepend" option to win_path #661

Open
teridon opened this issue Sep 24, 2024 · 1 comment
Open

add "prepend" option to win_path #661

teridon opened this issue Sep 24, 2024 · 1 comment

Comments

@teridon
Copy link

teridon commented Sep 24, 2024

SUMMARY

Add an option to the module that will prepend the specified path(s) to the existing path. If the path(s) already exists, then move it(them) to the top.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

ansible.windows.win_path

ADDITIONAL INFORMATION

In some cases, we need a path element to occur before System32. The existing code moves System32 later in the path, which could unintentionally cause executables in system32 to be overridden by other path elements.

- name: Ensure that updated OpenSSH executables are preferred over older ones in System32
  ansible.windows.win_path:
    elements: 
      - 'C:\Program Files\OpenSSH'
      - '%SystemRoot%\system32'
    state: prepend
@jborean93
Copy link
Collaborator

This does sound like a good idea but I would probably put it in it's own option rather than overloading state for this similar to lineinfile.

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

No branches or pull requests

2 participants