mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 03:53:59 -07:00
java_cert role pkcs12 import (#24616)
* java_cert pkcs12 import * documentation and formatting * update examples * update examples #2 * integration tests * integration tests #2 * added aliases.txt * renamed aliases * bugfix * empty it alieses
This commit is contained in:
parent
6d015294c2
commit
982e322287
5 changed files with 144 additions and 27 deletions
0
test/integration/targets/java_cert/aliases
Normal file
0
test/integration/targets/java_cert/aliases
Normal file
3
test/integration/targets/java_cert/defaults/main.yml
Normal file
3
test/integration/targets/java_cert/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
test_pkcs12_path: testpkcs.p12
|
||||
test_keystore_path: keystore.jks
|
BIN
test/integration/targets/java_cert/files/testpkcs.p12
Normal file
BIN
test/integration/targets/java_cert/files/testpkcs.p12
Normal file
Binary file not shown.
56
test/integration/targets/java_cert/tasks/main.yml
Normal file
56
test/integration/targets/java_cert/tasks/main.yml
Normal file
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
- name: prep pkcs12 file
|
||||
copy: src="{{ test_pkcs12_path }}" dest="{{output_dir}}/{{ test_pkcs12_path }}"
|
||||
|
||||
- name: import pkcs12
|
||||
local_action:
|
||||
module: java_cert
|
||||
pkcs12_path: "{{output_dir}}/{{ test_pkcs12_path }}"
|
||||
pkcs12_password: changeit
|
||||
pkcs12_alias: default
|
||||
cert_alias: default
|
||||
keystore_path: "{{output_dir}}/{{ test_keystore_path }}"
|
||||
keystore_pass: changeme_keystore
|
||||
keystore_create: yes
|
||||
state: present
|
||||
register: result_success
|
||||
- name: verify success
|
||||
assert:
|
||||
that:
|
||||
- result_success|success
|
||||
|
||||
- name: import pkcs12 with wrong password
|
||||
local_action:
|
||||
module: java_cert
|
||||
pkcs12_path: "{{output_dir}}/{{ test_pkcs12_path }}"
|
||||
pkcs12_password: wrong_pass
|
||||
pkcs12_alias: default
|
||||
cert_alias: default_new
|
||||
keystore_path: "{{output_dir}}/{{ test_keystore_path }}"
|
||||
keystore_pass: changeme_keystore
|
||||
keystore_create: yes
|
||||
state: present
|
||||
ignore_errors: true
|
||||
register: result_wrong_pass
|
||||
|
||||
- name: verify fail with wrong import password
|
||||
assert:
|
||||
that:
|
||||
- result_wrong_pass|failed
|
||||
|
||||
- name: test fail on mutually exclusive params
|
||||
local_action:
|
||||
module: java_cert
|
||||
cert_path: ca.crt
|
||||
pkcs12_path: "{{output_dir}}/{{ test_pkcs12_path }}"
|
||||
cert_alias: default
|
||||
keystore_path: "{{output_dir}}/{{ test_keystore_path }}"
|
||||
keystore_pass: changeme_keystore
|
||||
keystore_create: yes
|
||||
state: present
|
||||
ignore_errors: true
|
||||
register: result_excl_params
|
||||
- name: verify failed exclusive params
|
||||
assert:
|
||||
that:
|
||||
- result_excl_params|failed
|
Loading…
Add table
Add a link
Reference in a new issue