Add op role for Linux, macOS, and Windows
This commit is contained in:
parent
60a147124f
commit
651909ff71
@ -10,6 +10,7 @@
|
||||
- role: ag
|
||||
- role: bat
|
||||
- role: git
|
||||
- role: op
|
||||
- role: tree
|
||||
|
||||
- role: llvm
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
- role: ag
|
||||
- role: git
|
||||
- role: op
|
||||
- role: tree
|
||||
|
||||
- role: llvm
|
||||
|
5
roles/op/tasks/Darwin.yaml
Normal file
5
roles/op/tasks/Darwin.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew_cask:
|
||||
name: 1password-cli
|
||||
state: latest
|
38
roles/op/tasks/Debian.yaml
Normal file
38
roles/op/tasks/Debian.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
- name: get html of latest versions
|
||||
uri:
|
||||
url: https://raw.githubusercontent.com/kbenzie/op-release-scraper/main/op-releases.json
|
||||
register: op_releases
|
||||
|
||||
- when: ansible_machine == "x86"
|
||||
set_fact: {op_arch: '386'}
|
||||
- when: ansible_machine == "x86_64"
|
||||
set_fact: {op_arch: 'amd64'}
|
||||
- when: ansible_machine == "arm"
|
||||
set_fact: {op_arch: 'arm'}
|
||||
- when: ansible_machine == "arm64"
|
||||
set_fact: {op_arch: 'arm64'}
|
||||
|
||||
- set_fact:
|
||||
op_zip_url: '{{op_releases.json[0].downloads.Linux[op_arch]}}'
|
||||
|
||||
- name: create directory for downloaded package
|
||||
file:
|
||||
state: directory
|
||||
dest: ~/.local/src/op
|
||||
|
||||
- name: download latest release package
|
||||
get_url:
|
||||
url: '{{op_zip_url}}'
|
||||
dest: ~/.local/src/op/op.zip
|
||||
|
||||
- name: extract zip package
|
||||
unarchive:
|
||||
src: ~/.local/src/op/op.zip
|
||||
dest: ~/.local/src/op
|
||||
|
||||
- name: create symbolic links
|
||||
file:
|
||||
src: ~/.local/src/op/op
|
||||
dest: ~/.local/bin/op
|
||||
state: link
|
5
roles/op/tasks/Windows.yaml
Normal file
5
roles/op/tasks/Windows.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: op
|
||||
state: latest
|
2
roles/op/tasks/main.yaml
Normal file
2
roles/op/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
Loading…
x
Reference in New Issue
Block a user