Compare commits

...

2 Commits

Author SHA1 Message Date
3b312e6f9a Fix 1password role on Windows
When 1password is already installed and the installer is invoked, it
hangs because it launches the GUI and never returns.
2023-07-29 11:53:22 +01:00
e625f463d7 Add Windows support to fonts role 2023-07-29 11:33:20 +01:00
4 changed files with 15 additions and 22 deletions

View File

@ -25,6 +25,7 @@
- role: autohotkey - role: autohotkey
- role: ferdium - role: ferdium
- role: firefox - role: firefox
- role: fonts
- role: obsidian - role: obsidian
- role: powertoys - role: powertoys
- role: windows-terminal - role: windows-terminal

View File

@ -11,36 +11,21 @@
path: '{{app_exe}}' path: '{{app_exe}}'
register: app_stat register: app_stat
- name: get installed version
when: app_stat.stat.exists == True
win_command: '{{app_exe}} --version'
register: app_version
changed_when: false
- when: app_stat.stat.exists == True
set_fact:
installed_version: '{{app_version.stdout.strip()}}'
- name: download latest installer - name: download latest installer
when: not app_stat.stat.exists
win_get_url: win_get_url:
url: https://downloads.1password.com/win/1PasswordSetup-latest.exe url: https://downloads.1password.com/win/1PasswordSetup-latest.exe
dest: '{{installer_exe}}' dest: '{{installer_exe}}'
- name: get installer version
win_shell: |
(Get-ItemProperty {{installer_exe}}).VersionInfo.ProductVersion
register: installer_product_version
changed_when: false
# FIXME: The [5:] is to account for a mystery "\e[6 q" prefix, not sure if this
# is consistent across machines or some other oddity.
- set_fact:
installer_version: '{{installer_product_version.stdout.strip()[5:]}}'
- name: run installer - name: run installer
when: installed_version is not defined or installed_version != installer_version when: not app_stat.stat.exists
win_command: '{{installer_exe}}' win_command: '{{installer_exe}}'
- name: remove installer
win_file:
path: '{{installer_exe}}'
state: absent
- name: create start menu shortcut - name: create start menu shortcut
win_shortcut: win_shortcut:
src: '{{app_exe}}' src: '{{app_exe}}'

View File

@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: nerd-fonts-CascadiaCode
state: latest

View File

@ -1,5 +1,7 @@
--- ---
- when: ansible_os_family == 'Darwin' - when: ansible_os_family == 'Darwin'
include_tasks: 'Darwin.yaml' include_tasks: 'Darwin.yaml'
- when: ansible_os_family == 'Windows'
include_tasks: 'Windows.yaml'
- when: ansible_os_family != 'Darwin' and ansible_os_family != 'Windows' - when: ansible_os_family != 'Darwin' and ansible_os_family != 'Windows'
include_tasks: 'Linux.yaml' include_tasks: 'Linux.yaml'