I am using the win_updates module and I want to include a list of approved patches in the whitelist option. I have the list of all my approved patches in a file already, and I would like to know if and how I can import this file to use?
As in example, can I import the list somehow to be a variable called patchlist ?
Actually, it didn’t quite work The task was able to run through but I just realized it was not importing the file in correct as a list for the whitelist.
and then in the whitelist option of win_updates:
whitelist: “{{my_data}}”
The only caveat is that I need to make my patchlist.txt file to be in the form of
patch1
patch2
instead of it normally being
patch1
patch2
Is there an easy way as part of the Ansible playbook or in the lookup function itself to read the normal file and then convert it to having the - automatically? Or should I add a new play in the playbook to add the "- " in front of the file?