Skip to content

Commit

Permalink
Copy key cert and jwt for nginx plus dos
Browse files Browse the repository at this point in the history
Co-authored-by: Francis Kayiwa <[email protected]>
  • Loading branch information
Ryan Laddusaw and kayiwa committed Jan 27, 2025
1 parent d5d27ec commit 8c7b866
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roles/nginxplus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ nginx_license:
certificate: license/nginx-repo.crt
key: license/nginx-repo.key

# Location of your NGINX Plus DoS license in your local machine.
# Default is the files folder within the NGINX Ansible role.
nginx_dos_license:
certificate: license/nginx-repo_dos.crt
key: license/nginx-repo_dos.key

# Delete NGINX Plus license after installation for security purposes.
# Default is true.
nginx_delete_license: true
Expand Down
25 changes: 25 additions & 0 deletions roles/nginxplus/tasks/plus/setup-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,41 @@
loop:
- "{{ nginx_license.certificate }}"
- "{{ nginx_license.key }}"
when:
- runtime_env == "production"

- name: "Copy NGINX Plus DoS Certificate and License Key"
ansible.builtin.copy:
src: "{{ item }}"
dest: /etc/ssl/nginx
decrypt: true
mode: "0644"
loop:
- "{{ nginx_dos_license.certificate }}"
- "{{ nginx_dos_license.key }}"
when:
- runtime_env == "staging"

- name: Create Nginx Directory
ansible.builtin.file:
path: /etc/nginx
state: directory
mode: "0755"

- name: Copy NGINX Plus DoS jwt
ansible.builtin.copy:
src: "license/nginx-repo_dos.jwt"
dest: /etc/nginx/license.jwt
decrypt: true
mode: "0644"
when:
- runtime_env == "staging"

- name: "Copy NGINX Plus jwt"
ansible.builtin.copy:
src: "license/nginx-repo.jwt"
dest: /etc/nginx/license.jwt
decrypt: true
mode: "0644"
when:
- runtime_env == "production"

0 comments on commit 8c7b866

Please sign in to comment.