Compare commits
3 Commits
ae689d46b1
...
8810309515
Author | SHA1 | Date | |
---|---|---|---|
8810309515 | |||
b6b18b2b94 | |||
2286452f5b |
@ -2,4 +2,4 @@
|
|||||||
collections_path = collections
|
collections_path = collections
|
||||||
library = library
|
library = library
|
||||||
roles_path = roles
|
roles_path = roles
|
||||||
stdout_callback = yaml
|
result_format = yaml
|
||||||
|
@ -93,7 +93,7 @@ function Get-GitRemoteHeadBranch {
|
|||||||
$result = Run-Command -command $command -working_directory $dest
|
$result = Run-Command -command $command -working_directory $dest
|
||||||
if ($result.rc -ne 0) {
|
if ($result.rc -ne 0) {
|
||||||
$module.FailJson("Could not determine the default HEAD branch of remote: $remote" ` +
|
$module.FailJson("Could not determine the default HEAD branch of remote: $remote" ` +
|
||||||
"$result.stdout $result.stderr")
|
$result.stderr)
|
||||||
}
|
}
|
||||||
return $result.stdout.Trim().Replace("$remote/", '')
|
return $result.stdout.Trim().Replace("$remote/", '')
|
||||||
}
|
}
|
||||||
|
@ -18,51 +18,27 @@
|
|||||||
icon: '{{app_exe}},0'
|
icon: '{{app_exe}},0'
|
||||||
|
|
||||||
# CLI
|
# CLI
|
||||||
|
- name: install scoop cli package
|
||||||
|
community.windows.win_scoop:
|
||||||
|
state: present
|
||||||
|
name: 1password-cli
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
cli_dir: '{{ansible_env.LOCALAPPDATA}}\1Password\cli'
|
cli_dir: '{{ansible_env.LOCALAPPDATA}}\1Password\cli'
|
||||||
cli_zip: '{{ansible_env.TEMP}}/op_windows_amd64.zip'
|
|
||||||
- set_fact:
|
|
||||||
cli_exe: '{{cli_dir}}\op.exe'
|
|
||||||
|
|
||||||
- name: check if op already installed
|
- name: create cli directory
|
||||||
win_stat:
|
win_file:
|
||||||
path: '{{cli_exe}}'
|
state: directory
|
||||||
register: cli_stat
|
path: '{{cli_dir}}'
|
||||||
|
|
||||||
- name: get installed op version
|
- name: remove old op executable
|
||||||
when: cli_stat.stat.exists == True
|
win_file:
|
||||||
win_command: '{{cli_exe}} --version'
|
state: absent
|
||||||
register: cli_version
|
path: '{{cli_dir}}\op.exe'
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- when: cli_stat.stat.exists == True
|
- name: remove old op install directory from user PATH
|
||||||
set_fact:
|
|
||||||
cli_installed_version: '{{cli_version.stdout.strip()}}'
|
|
||||||
|
|
||||||
- name: get list of op releases
|
|
||||||
win_uri:
|
|
||||||
url: https://raw.githubusercontent.com/kbenzie/op-release-scraper/main/op-releases.json
|
|
||||||
return_content: true
|
|
||||||
register: releases
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
latest: '{{releases.json[0]}}'
|
|
||||||
|
|
||||||
- name: download latest op zip archive
|
|
||||||
when: cli_installed_version is not defined or cli_installed_version != latest.version
|
|
||||||
win_get_url:
|
|
||||||
url: '{{latest.downloads.Windows.amd64}}'
|
|
||||||
dest: '{{cli_zip}}'
|
|
||||||
environment: '{{proxy_environment}}'
|
|
||||||
|
|
||||||
- name: unzip op zip archive
|
|
||||||
when: cli_installed_version is not defined or cli_installed_version != latest.version
|
|
||||||
win_unzip:
|
|
||||||
src: '{{cli_zip}}'
|
|
||||||
dest: '{{cli_dir}}'
|
|
||||||
|
|
||||||
- name: add op install directory to user PATH
|
|
||||||
win_path:
|
win_path:
|
||||||
|
state: absent
|
||||||
scope: user
|
scope: user
|
||||||
name: Path
|
name: Path
|
||||||
elements: '{{cli_dir}}'
|
elements: '{{cli_dir}}'
|
||||||
@ -70,7 +46,7 @@
|
|||||||
- name: get op powershell completion script
|
- name: get op powershell completion script
|
||||||
win_command:
|
win_command:
|
||||||
argv:
|
argv:
|
||||||
- '{{ansible_env.LOCALAPPDATA}}/1Password/cli/op.exe'
|
- '{{ansible_env.LOCALAPPDATA}}\Scoop\shims\op.exe'
|
||||||
- completion
|
- completion
|
||||||
- powershell
|
- powershell
|
||||||
register: powershell_completion_script
|
register: powershell_completion_script
|
||||||
|
Loading…
x
Reference in New Issue
Block a user