1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/openssl_dhparam/tasks/main.yml
Thom Wiggers e2af5dfae0 Module to generate Diffie-Hellman parameters (#32620)
* Module to generate Diffie-Hellman parameters

Implements #32577

* Add integration tests for openssl_dhparam

* Slightly refactor check to prevent unnecessary regeneration

* Fix code smell in tests

Highly annoying to have to do this again and again and again as the rules change during the game

* Using module.run_command() and module.atomic_move() from a tempfile.

* Remove underscore variable

Ansible prefers dummy
2018-01-26 08:08:29 +00:00

44 lines
1.2 KiB
YAML

- block:
# This module generates unsafe parameters for testing purposes
# otherwise tests would be too slow
- name: Generate parameter
openssl_dhparam:
size: 768
path: '{{ output_dir }}/dh768.pem'
- name: Don't regenerate parameters with no change
openssl_dhparam:
size: 768
path: '{{ output_dir }}/dh768.pem'
register: dhparam_changed
- name: Generate parameters with size option
openssl_dhparam:
path: '{{ output_dir }}/dh512.pem'
size: 512
- name: Don't regenerate parameters with size option and no change
openssl_dhparam:
path: '{{ output_dir }}/dh512.pem'
size: 512
register: dhparam_changed_512
- copy:
src: '{{ output_dir }}/dh768.pem'
remote_src: yes
dest: '{{ output_dir }}/dh512.pem'
- name: Re-generate if size is different
openssl_dhparam:
path: '{{ output_dir }}/dh512.pem'
size: 512
register: dhparam_changed_to_512
- name: Force re-generate parameters with size option
openssl_dhparam:
path: '{{ output_dir }}/dh512.pem'
size: 512
force: yes
register: dhparam_changed_force
- import_tasks: ../tests/validate.yml