Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIndowsPb: gpg signature verification for ANT binary #3018

Merged
merged 15 commits into from
May 24, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ heapsize: normal

## Nagios Server Details
Nagios_Master_IP: 78.47.239.96

# GPG Public Keys
key:
apache_ant: CE8075A251547BEE249BC151A2115AE15F6B8B72 # Stefan Bodewig <bodewig@apache.org>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
register: ant_download
tags: ANT

- name: GPG Signature Verification of Binary
include_tasks:
file: ../../GPG_signature_verification/tasks/main.yml
vars:
file_path: c:\temp\ant.zip
signature_link: "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.zip.asc"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ant is on 1.10.13 now - should we upgrade?

GPG_key: "{{ key.apache_ant }}"
when: (not ant_installed.stat.exists)
tags: ANT

- name: Deploy Apache ANT
win_unzip:
src: c:\temp\ant.zip
Expand Down
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)