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
This commit is contained in:
Alessandro Fael Garcia 2019-01-09 00:26:14 +01:00 committed by GitHub
parent bd09ecd85e
commit c1c3a372d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 3 deletions

View File

@ -184,6 +184,10 @@ nginx_type: opensource
# Default is nginx_repository. # Default is nginx_repository.
nginx_install_from: nginx_repository nginx_install_from: nginx_repository
# Choose where to fetch the NGINX signing key from.
# Default is the official NGINX signing key host.
nginx_signing_key: https://nginx.org/keys/nginx_signing.key
# Specify source repository for NGINX Open Source. # Specify source repository for NGINX Open Source.
# Only works if 'install_from' is set to 'nginx_repository'. # Only works if 'install_from' is set to 'nginx_repository'.
# Defaults are the official NGINX repositories. # Defaults are the official NGINX repositories.
@ -364,7 +368,6 @@ nginx_http_template:
# Enable creating dynamic templated NGINX stream configuration files. # Enable creating dynamic templated NGINX stream configuration files.
nginx_stream_template_enable: false nginx_stream_template_enable: false
nginx_stream_template_listen: 12345 nginx_stream_template_listen: 12345
``` ```
Dependencies Dependencies

View File

@ -17,6 +17,10 @@ nginx_type: opensource
# Default is nginx_repository. # Default is nginx_repository.
nginx_install_from: nginx_repository nginx_install_from: nginx_repository
# Choose where to fetch the NGINX signing key from.
# Default is the official NGINX signing key host.
nginx_signing_key: http://nginx.org/keys/nginx_signing.key
# Specify source repository for NGINX Open Source. # Specify source repository for NGINX Open Source.
# Only works if 'install_from' is set to 'nginx_repository'. # Only works if 'install_from' is set to 'nginx_repository'.
# Defaults are the official NGINX repositories. # Defaults are the official NGINX repositories.

View File

@ -1,4 +1,8 @@
--- ---
- name: "(Install: APT OSs) Set APT NGINX Signing Key URL"
set_fact:
keysite: "{{ nginx_signing_key | default('http://nginx.org/keys/nginx_signing.key') }}"
- name: "(Install: APT OSs) Add APT NGINX Signing Key" - name: "(Install: APT OSs) Add APT NGINX Signing Key"
apt_key: apt_key:
url: "{{ 'http://nginx.org/keys/nginx_signing.key' | default('https://nginx.org/keys/nginx_signing.key') }}" url: "{{ keysite | default('https://nginx.org/keys/nginx_signing.key') }}"

View File

@ -1,4 +1,8 @@
--- ---
- name: "(Install: RPM OSs) Set RPM NGINX Signing Key URL"
set_fact:
keysite: "{{ nginx_signing_key | default('http://nginx.org/keys/nginx_signing.key') }}"
- name: "(Install: RPM OSs) Add RPM NGINX Signing Key" - name: "(Install: RPM OSs) Add RPM NGINX Signing Key"
rpm_key: rpm_key:
key: "{{ 'http://nginx.org/keys/nginx_signing.key' | default('https://nginx.org/keys/nginx_signing.key') }}" key: "{{ keysite | default('https://nginx.org/keys/nginx_signing.key') }}"