Add pass wrapper to check out store
This commit is contained in:
@@ -4,7 +4,7 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
PASS = 'pass'
|
PASS = '/usr/bin/pass'
|
||||||
|
|
||||||
def run(args):
|
def run(args):
|
||||||
return(subprocess.run(
|
return(subprocess.run(
|
||||||
|
|||||||
28
user.yml
28
user.yml
@@ -589,15 +589,23 @@
|
|||||||
tags: [gpg]
|
tags: [gpg]
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: stat passwordstore checkout
|
- name: add passwordstore init script
|
||||||
stat:
|
copy:
|
||||||
path: /home/{{ user.name }}/.password-store
|
dest: /home/{{ user.name }}/bin/pass
|
||||||
register: passwordstore_checkout
|
owner: "{{ user.name }}"
|
||||||
- name: check out passwordstore repository
|
group: "{{ user_group_name }}"
|
||||||
git:
|
mode: '0755'
|
||||||
dest: /home/{{ user.name }}/.password-store
|
content: |
|
||||||
repo: ssh://git@code.hkoerber.de:2222/hannes/passwordstore.git
|
#!/usr/bin/env bash
|
||||||
accept_hostkey: true
|
|
||||||
when: not passwordstore_checkout.stat.exists
|
if [[ ! -e ~/.password-store ]] ; then
|
||||||
|
printf '%s\n' 'This is the first time running pass, initializting repository ...'
|
||||||
|
|
||||||
|
git clone ssh://git@code.hkoerber.de:2222/hannes/passwordstore.git ~/.password-store
|
||||||
|
|
||||||
|
printf '%s\n' 'Done'
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec mypass "${@}"
|
||||||
when: user.enable_passwordstore|default(false) is sameas true
|
when: user.enable_passwordstore|default(false) is sameas true
|
||||||
tags: [passwordstore]
|
tags: [passwordstore]
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ alias json2yaml="python3 -c 'import sys, yaml, json; yaml.safe_dump(json.loads(s
|
|||||||
|
|
||||||
alias currentbranch='git rev-parse --abbrev-ref HEAD'
|
alias currentbranch='git rev-parse --abbrev-ref HEAD'
|
||||||
|
|
||||||
alias pass=mypass
|
|
||||||
|
|
||||||
alias issh="ssh -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null"
|
alias issh="ssh -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null"
|
||||||
alias gfix='git commit --amend --no-edit'
|
alias gfix='git commit --amend --no-edit'
|
||||||
alias gfixa='git commit --amend --no-edit --all '
|
alias gfixa='git commit --amend --no-edit --all '
|
||||||
|
|||||||
Reference in New Issue
Block a user