--- # NOTE: The 1Password chocolatey packages are not up to date. # GUI - set_fact: app_exe: '{{ansible_env.LOCALAPPDATA}}/1Password/app/8/1Password.exe' installer_exe: '{{ansible_env.TEMP}}/1PasswordSetup-latest.exe' - name: install chocolatey package win_chocolatey: state: latest name: 1password - name: create start menu shortcut win_shortcut: src: '{{app_exe}}' dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/1Password.lnk' icon: '{{app_exe}},0' # CLI - name: install scoop cli package community.windows.win_scoop: state: present name: 1password-cli - set_fact: cli_dir: '{{ansible_env.LOCALAPPDATA}}\1Password\cli' - name: create cli directory win_file: state: directory path: '{{cli_dir}}' - name: remove old op executable win_file: state: absent path: '{{cli_dir}}\op.exe' - name: remove old op install directory from user PATH win_path: state: absent scope: user name: Path elements: '{{cli_dir}}' - name: get op powershell completion script win_command: argv: - '{{ansible_env.LOCALAPPDATA}}\Scoop\shims\op.exe' - completion - powershell register: powershell_completion_script changed_when: false - name: create op powershell completion file win_copy: content: '{{powershell_completion_script.stdout}}' dest: '{{cli_dir}}/opProfile.psm1'