-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIndowsPb: gpg signature verification for ANT binary (#3018)
* gpg signature verification for ANT binary * fix conditional * Create gnupg dir when doesnt exist Create the home/.gnupg directory within windows/cygwin environment. * Linter fix * Linter fix. * Linter fix * Tweak path to GPG tasks * Linter Fix * Test Regsvr without silent for vs2017 * Undo regsvr test * remove playbooks_dir variable * change import to include --------- Co-authored-by: Scott Fryer <60462088+steelhead31@users.noreply.github.com> Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>
- Loading branch information
1 parent
4d6ef21
commit d9b705d
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...e/playbooks/AdoptOpenJDK_Windows_Playbook/roles/GPG_signature_verification/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# These tasks can only run once cygwin is installed on the remote machine | ||
|
||
- name: Check if gnupg directory exists | ||
win_stat: | ||
path: 'C:\cygwin64\home\%USERNAME%\.gnupg' | ||
register: gnupg_check | ||
|
||
- name: Create gnupg directory with Cygwin ( if it doesnt exist ) | ||
win_shell: C:/cygwin64/bin/bash.exe -c "mkdir -p ~/.gnupg" | ||
when: (not gnupg_check.stat.exists) | ||
|
||
- name: Fix Permissions | ||
win_shell: C:/cygwin64/bin/bash.exe -c "chmod og-rwx ~/.gnupg" | ||
|
||
- name: Import GPG Key | ||
win_command: gpg --keyserver keyserver.ubuntu.com --recv-keys "{{ GPG_key }}" | ||
|
||
- name: Get signature file | ||
win_command: wget -q "{{ signature_link }}" -O sigfile | ||
|
||
- name: Verify binary | ||
win_command: gpg --verify sigfile {{ file_path }} | ||
|
||
- name: Remove gnupg directory with Cygwin ( when it didnt exist previously ) | ||
win_shell: C:/cygwin64/bin/bash.exe -c "rm -rf ~/.gnupg" | ||
when: (not gnupg_check.stat.exists) |