community.windows icon indicating copy to clipboard operation
community.windows copied to clipboard

New Module win_ini_file

Open gamethis opened this issue 3 years ago • 2 comments

SUMMARY

create windows equivalent of https://docs.ansible.com/ansible/2.5/modules/ini_file_module.html

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

Windows Operating systems have loads of INI files. It would be nice to have the same features as linux systems. this is also helpful when defining MS SQL servers and other apps on windows.

ADDITIONAL INFORMATION
- name: Ensure "fav=lemonade is in section "[drinks]" in specified file
  community.windows.win_ini_file:
    path: c:\path\to\file.ini
    section: drinks
    option: fav
    value: lemonade
    backup: yes

gamethis avatar Apr 05 '21 15:04 gamethis

I think win_template can be used to create ini files. It gives more flexibility with jinja2

kvprasoon avatar Aug 04 '21 17:08 kvprasoon

@kvprasoon I agree you can use jinja2 with win_template but on linux side we have the feature and it would be nice to have parity. I also favor the idea of having clarity in code of what exactly is being done. the template will do it.. but adds a layer of complexity for someone new to the code to understand what you are changing on the os.

gamethis avatar Aug 05 '21 14:08 gamethis

As per the README https://github.com/ansible-collections/community.windows#contributing-to-this-collection this collection is currently only accepting bugfixes or features to existing modules.

jborean93 avatar May 29 '23 04:05 jborean93