Skip to content

Commit c1c3a37

Browse files
authored
Allow setting a custom apt and rpm signing key host (#84)
* Allow setting a custom apt and rpm signing key host * Change default fallback key to https * Use facts to determine which signing key to use * Add single quotes
1 parent bd09ecd commit c1c3a37

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ nginx_type: opensource
184184
# Default is nginx_repository.
185185
nginx_install_from: nginx_repository
186186

187+
# Choose where to fetch the NGINX signing key from.
188+
# Default is the official NGINX signing key host.
189+
nginx_signing_key: https://nginx.org/keys/nginx_signing.key
190+
187191
# Specify source repository for NGINX Open Source.
188192
# Only works if 'install_from' is set to 'nginx_repository'.
189193
# Defaults are the official NGINX repositories.
@@ -364,7 +368,6 @@ nginx_http_template:
364368
# Enable creating dynamic templated NGINX stream configuration files.
365369
nginx_stream_template_enable: false
366370
nginx_stream_template_listen: 12345
367-
368371
```
369372
370373
Dependencies

defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ nginx_type: opensource
1717
# Default is nginx_repository.
1818
nginx_install_from: nginx_repository
1919

20+
# Choose where to fetch the NGINX signing key from.
21+
# Default is the official NGINX signing key host.
22+
nginx_signing_key: http://nginx.org/keys/nginx_signing.key
23+
2024
# Specify source repository for NGINX Open Source.
2125
# Only works if 'install_from' is set to 'nginx_repository'.
2226
# Defaults are the official NGINX repositories.

tasks/keys/apt-key.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
---
2+
- name: "(Install: APT OSs) Set APT NGINX Signing Key URL"
3+
set_fact:
4+
keysite: "{{ nginx_signing_key | default('http://nginx.org/keys/nginx_signing.key') }}"
5+
26
- name: "(Install: APT OSs) Add APT NGINX Signing Key"
37
apt_key:
4-
url: "{{ 'http://nginx.org/keys/nginx_signing.key' | default('https://nginx.org/keys/nginx_signing.key') }}"
8+
url: "{{ keysite | default('https://nginx.org/keys/nginx_signing.key') }}"

tasks/keys/rpm-key.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
---
2+
- name: "(Install: RPM OSs) Set RPM NGINX Signing Key URL"
3+
set_fact:
4+
keysite: "{{ nginx_signing_key | default('http://nginx.org/keys/nginx_signing.key') }}"
5+
26
- name: "(Install: RPM OSs) Add RPM NGINX Signing Key"
37
rpm_key:
4-
key: "{{ 'http://nginx.org/keys/nginx_signing.key' | default('https://nginx.org/keys/nginx_signing.key') }}"
8+
key: "{{ keysite | default('https://nginx.org/keys/nginx_signing.key') }}"

0 commit comments

Comments
 (0)