ansible-role-nginx-lego/tasks/dhparams.yml

23 lines
691 B
YAML
Raw Normal View History

2023-05-23 15:45:42 +00:00
---
- name: Check for a pre-generated dhparams file.
ansible.builtin.stat:
path: files/dhparams.pem
register: dhparams
delegate_to: localhost
tags: dhparams
become: false
2023-05-23 15:45:42 +00:00
- name: Use previously generated dhparams to reduce deployment time by several minutes.
ansible.builtin.copy:
src: dhparams.pem
2023-08-03 22:30:51 +00:00
dest: "{{ nginx_config_dhparam }}"
2023-05-23 15:45:42 +00:00
force: false
when: dhparams.stat.exists
tags: dhparams
# https://docs.ansible.com/ansible/latest/collections/community/crypto/openssl_dhparam_module.html
- name: Generate Diffie-Hellman parameters with the default size (4096 bits)
community.crypto.openssl_dhparam:
2023-08-11 19:24:10 +00:00
path: "{{ nginx_config_dhparam }}"
2023-05-23 15:45:42 +00:00
tags: dhparams