Fixes #16 by replacing uses of the `apt_key:` module with `get_url:` to download apt keyrings into `/etc/apt/keyrings`, then used `signed-by=/etc/path/keyrings/<keyring>` in the appropriate sources.list file.
59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
---
|
|
- name: set keyring path
|
|
set_fact:
|
|
keyring: /etc/apt/keyrings/1password.asc
|
|
old_keyring: /etc/apt/trusted.gpg.d/1password-archive-keyring.gpg
|
|
|
|
- name: remove old keyring
|
|
file:
|
|
path: '{{old_keyring}}'
|
|
state: absent
|
|
|
|
- name: add apt signing key
|
|
when: '"WSL" not in ansible_kernel'
|
|
become: true
|
|
get_url:
|
|
url: https://downloads.1password.com/linux/keys/1password.asc
|
|
dest: '{{keyring}}'
|
|
|
|
- name: set compatible architecture
|
|
when: ansible_machine == 'x86_64'
|
|
set_fact:
|
|
arch: amd64
|
|
|
|
- assert:
|
|
that: arch is defined
|
|
fail_msg: 'Architecture not currently supported: {{ansible_machine}}'
|
|
|
|
- name: add apt repository
|
|
when: '"WSL" not in ansible_kernel'
|
|
become: true
|
|
apt_repository:
|
|
repo: >-
|
|
deb [arch={{arch}} signed-by={{keyring}}]
|
|
https://downloads.1password.com/linux/debian/{{arch}} stable main
|
|
filename: 1password
|
|
|
|
- name: install gui package
|
|
when: '"WSL" not in ansible_kernel'
|
|
become: true
|
|
apt:
|
|
name: 1password
|
|
state: latest
|
|
|
|
- name: install cli package
|
|
when: '"WSL" not in ansible_kernel'
|
|
become: true
|
|
apt:
|
|
name: 1password-cli
|
|
state: latest
|
|
|
|
- name: create symlink to op.exe
|
|
when: '"WSL" in ansible_kernel'
|
|
file:
|
|
state: link
|
|
src: /mnt/c/Users/Benie/AppData/Local/1Password/cli/op.exe
|
|
dest: ~/.local/bin/op
|
|
|
|
- include_tasks: zsh-completion.yaml
|