Skip to content

Commit

Permalink
fix dhparams generation
Browse files Browse the repository at this point in the history
Signed-off-by: kogeler <kogeler@gmail.com>
  • Loading branch information
kogeler committed Jul 22, 2024
1 parent ab29287 commit 4feae99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
1 change: 1 addition & 0 deletions roles/nginx/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
state: reloaded
enabled: true
daemon_reload: true
ignore_errors: "{{ ansible_check_mode }}"
16 changes: 3 additions & 13 deletions roles/nginx/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,16 @@
path: /etc/nginx/dhparams.pem
register: stat_dhparams

# The file is generated locally because it takes a LONG time to generate on VMs
- name: nginx | generate dhparams locally
become: false
- name: nginx | generate dhparams
community.crypto.openssl_dhparam:
path: /tmp/dhparams_{{ inventory_hostname }}.pem
path: /etc/nginx/dhparams.pem
size: "{{ nginx_dhparam_size }}"
delegate_to: localhost
when: not stat_dhparams.stat.exists
# molecule skip test
tags: molecule-notest

- name: nginx | copy dhparams to node
ansible.builtin.copy:
src: /tmp/dhparams_{{ inventory_hostname }}.pem
dest: /etc/nginx/dhparams.pem
owner: root
group: root
mode: "0600"
notify: reload nginx config
when: not stat_dhparams.stat.exists
ignore_errors: "{{ ansible_check_mode }}"
# molecule skip test
tags: molecule-notest

Expand Down

0 comments on commit 4feae99

Please sign in to comment.