ansible-collections / ansible.windows

Windows core collection for Ansible
https://galaxy.ansible.com/ansible/windows
GNU General Public License v3.0
233 stars 157 forks source link

RFI: Does State:Searched and State:Installed work together #586

Open michael-franck opened 4 months ago

michael-franck commented 4 months ago
SUMMARY

I'm not sure but couldn't make it out from the documentation.

When performing a win_updates task with a state:searched, does this store the searched updates for subsequent tasks.

Let's say you want to perform the search in the beginning of your playbook in async mode. At the end you want to reboot and start another win_updates task with state:installed in synchronous mode.

Would the second only perform the installs, completing faster?

ISSUE TYPE
COMPONENT NAME

ansible.windows.win_updates

ANSIBLE VERSION
ansible [core 2.13.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0]
  jinja version = 3.0.3
  libyaml = True
jborean93 commented 4 months ago

It's all part of the Windows Update API, while I believe it does cache the existing results internally so doing a search then install as separate tasks might be more efficient it is still going to check if there are more updates available on the second run.