There is a folder with a bunch of zip files. In each archive - a program and help to it. Periodically, some archives are updated. How to make it work like this:

- win_unzip: src: '{{ ansible_env.ProgramFiles }}\soft\*.zip' dest: '{{ ansible_env.ProgramFiles }}\soft\' 

    1 answer 1

    The task was to unpack zip archives downloaded from http://www.nirsoft.net/ . The list of files received using the module win_find . How to connect everything - peeped here .

     --- - name: Install NirSoft hosts: all strategy: free serial: - "100%" tasks: - name: Install\Update NirSoft 4 Windows when: ansible_os_family == 'Windows' become: yes become_method: runas become_flags: logon_type=new_credentials logon_flags=netcredentials_only block: - win_file: path: '%ProgramFiles%\nirsoft\' state: directory - win_path: elements: - '%ProgramFiles%\nirsoft\' state: present - win_find: paths: \\10.10.10.10\soft\nirsoft patterns: ['*.zip'] get_checksum: no register: nirsoft_find_zips - win_unzip: src: '{{ item.path }}' dest: '{{ ansible_env.ProgramFiles }}\nirsoft\' with_items: "{{ nirsoft_find_zips.files }}"