Add pass wrapper to check out store
This commit is contained in:
@@ -4,7 +4,7 @@ import sys
|
||||
import subprocess
|
||||
import yaml
|
||||
|
||||
PASS = 'pass'
|
||||
PASS = '/usr/bin/pass'
|
||||
|
||||
def run(args):
|
||||
return(subprocess.run(
|
||||
|
||||
28
user.yml
28
user.yml
@@ -589,15 +589,23 @@
|
||||
tags: [gpg]
|
||||
|
||||
- block:
|
||||
- name: stat passwordstore checkout
|
||||
stat:
|
||||
path: /home/{{ user.name }}/.password-store
|
||||
register: passwordstore_checkout
|
||||
- name: check out passwordstore repository
|
||||
git:
|
||||
dest: /home/{{ user.name }}/.password-store
|
||||
repo: ssh://git@code.hkoerber.de:2222/hannes/passwordstore.git
|
||||
accept_hostkey: true
|
||||
when: not passwordstore_checkout.stat.exists
|
||||
- name: add passwordstore init script
|
||||
copy:
|
||||
dest: /home/{{ user.name }}/bin/pass
|
||||
owner: "{{ user.name }}"
|
||||
group: "{{ user_group_name }}"
|
||||
mode: '0755'
|
||||
content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
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 pass=mypass
|
||||
|
||||
alias issh="ssh -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null"
|
||||
alias gfix='git commit --amend --no-edit'
|
||||
alias gfixa='git commit --amend --no-edit --all '
|
||||
|
||||
Reference in New Issue
Block a user