--- - hosts: goude.ucl.ac.uk tasks: - name: "Copying 7zip to remote host" win_copy: dest: "C:\\temp\\" src: /home/software/windows/7z1900-x64.exe - name: "Installing 7zip" when: "ACTION == \"install\"" win_package: arguments: /S path: "C:\\temp\\7z1900-x64.exe" product_id: 7-zip state: present - name: "Uninstalling 7zip" when: "ACTION == \"uninstall\"" win_package: arguments: /S path: "C:\\Program Files\\7-Zip\\Uninstall.exe" product_id: 7-zip state: absent