- name: Installing Notepad++ win_package: path: https://notepad-plus-plus.org/repository/7.x/7.5.1/npp.7.5.1.Installer.x64.exe arguments: '/S' product_id: "Notepad++" state: present when: ansible_os_family == 'Windows' - name: Check Path Variable on Windows hosts win_shell: $Env:Path register: path changed_when: False when: ansible_os_family == 'Windows' - name: Add Notepad++ to Path Variable on Windows hosts win_environment: state: present name: Path value: '{{ path.stdout }};C:\Program Files (x86)\Notepad++' level: machine when: (path.stdout.find('Notepad++') == -1 ) and (ansible_os_family == 'Windows')