common: Added helper scripts support and gpg_import_url_key
parent
0e8234fa08
commit
0df56b9ddc
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage: <url> <fpr> <keyring>
|
||||
|
||||
set -e;
|
||||
|
||||
readonly keyfile="$(mktemp --dry-run)";
|
||||
|
||||
mkdir --parents ~/.gnupg;
|
||||
chmod "u=rwx,g=,o=" ~/.gnupg;
|
||||
|
||||
/usr/bin/wget --output-document="$keyfile" -- "$1";
|
||||
/usr/bin/gpg2 --dry-run --quiet --import-options import-show --with-colons --import "$keyfile" | awk -F: '$1 == "fpr" { print $10 }' | head --lines=1 | grep --fixed-strings "$2";
|
||||
/usr/bin/gpg2 --quiet --no-default-keyring --keyring "$3" --import "$keyfile";
|
||||
rm "$keyfile";
|
@ -0,0 +1,19 @@
|
||||
---
|
||||
|
||||
- name: Create directory for helper scripts
|
||||
file:
|
||||
path: "{{ global_helper_directory }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "u=rwx,g=rx,o=rx"
|
||||
|
||||
- name: Upload helper scripts
|
||||
copy:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ global_helper_directory }}/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "u=rwx,g=rx,o=rx"
|
||||
loop:
|
||||
- gpg_import_url_key.sh
|
Loading…
Reference in New Issue