Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
---
|
2022-08-05 14:03:38 +02:00
|
|
|
# Copyright (c) Ansible Project
|
|
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-07-26 11:42:13 +02:00
|
|
|
#
|
|
|
|
# Prepare X509 and PKCS#12 materials
|
|
|
|
#
|
|
|
|
|
|
|
|
- name: Create private keys
|
|
|
|
community.crypto.openssl_privatekey:
|
|
|
|
path: "{{ item }}"
|
|
|
|
mode: "u=rw,go="
|
|
|
|
loop:
|
|
|
|
- "{{ test_key_path }}"
|
|
|
|
- "{{ test_key2_path }}"
|
|
|
|
|
|
|
|
- name: Generate CSR for self-signed certificate used as a placeholder to create the java keystore
|
|
|
|
community.crypto.openssl_csr:
|
|
|
|
path: "{{ test_csr_path }}"
|
|
|
|
privatekey_path: "{{ test_key_path }}"
|
|
|
|
commonName: "localhost"
|
|
|
|
|
|
|
|
- name: Generate CSR for self-signed certificate used for testing
|
|
|
|
community.crypto.openssl_csr:
|
|
|
|
path: "{{ test_csr2_path }}"
|
|
|
|
privatekey_path: "{{ test_key2_path }}"
|
|
|
|
commonName: "localhost"
|
|
|
|
|
|
|
|
- name: Generate the self-signed cert used as a placeholder to create the java keystore
|
|
|
|
community.crypto.x509_certificate:
|
|
|
|
path: "{{ test_cert_path }}"
|
|
|
|
csr_path: "{{ test_csr_path }}"
|
|
|
|
privatekey_path: "{{ test_key_path }}"
|
|
|
|
provider: selfsigned
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
|
|
|
|
- name: Generate the self signed cert we will use for testing
|
2021-07-26 11:42:13 +02:00
|
|
|
community.crypto.x509_certificate:
|
|
|
|
path: "{{ test_cert2_path }}"
|
|
|
|
csr_path: "{{ test_csr2_path }}"
|
|
|
|
privatekey_path: "{{ test_key2_path }}"
|
|
|
|
provider: selfsigned
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
|
2021-05-22 13:33:27 +02:00
|
|
|
- name: Create the pkcs12 archive from the test x509 cert
|
2021-07-26 11:42:13 +02:00
|
|
|
community.crypto.openssl_pkcs12:
|
|
|
|
name: "test_pkcs12_cert"
|
|
|
|
path: "{{ test_pkcs_path }}"
|
|
|
|
passphrase: "{{ test_keystore2_password }}"
|
|
|
|
certificate_path: "{{ test_cert_path }}"
|
|
|
|
privatekey_path: "{{ test_key_path }}"
|
|
|
|
when:
|
|
|
|
- "not (ansible_os_family == 'RedHat' and ansible_distribution_version is version('8.0', '<'))"
|
|
|
|
|
|
|
|
- name: Create the pkcs12 archive from the test x509 cert (command)
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: >
|
|
|
|
openssl pkcs12 -export
|
|
|
|
-in {{ test_cert_path }}
|
|
|
|
-inkey {{ test_key_path }}
|
|
|
|
-name test_pkcs12_cert
|
|
|
|
-out {{ test_pkcs_path }}
|
|
|
|
-passout stdin
|
|
|
|
stdin: "{{ test_keystore2_password }}"
|
|
|
|
when:
|
|
|
|
- "ansible_os_family == 'RedHat'"
|
|
|
|
- "ansible_distribution_version is version('8.0', '<')"
|
2021-05-22 13:33:27 +02:00
|
|
|
|
|
|
|
- name: Create the pkcs12 archive from the certificate we will be trying to add to the keystore
|
2021-07-26 11:42:13 +02:00
|
|
|
community.crypto.openssl_pkcs12:
|
|
|
|
name: "test_pkcs12_cert"
|
|
|
|
path: "{{ test_pkcs2_path }}"
|
|
|
|
passphrase: "{{ test_keystore2_password }}"
|
|
|
|
certificate_path: "{{ test_cert2_path }}"
|
|
|
|
privatekey_path: "{{ test_key2_path }}"
|
|
|
|
when:
|
|
|
|
- "not (ansible_os_family == 'RedHat' and ansible_distribution_version is version('8.0', '<'))"
|
|
|
|
|
|
|
|
- name: Create the pkcs12 archive from the certificate we will be trying to add to the keystore (command)
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: >
|
|
|
|
openssl pkcs12 -export
|
|
|
|
-in {{ test_cert2_path }}
|
|
|
|
-inkey {{ test_key2_path }}
|
|
|
|
-name test_pkcs12_cert
|
|
|
|
-out {{ test_pkcs2_path }}
|
|
|
|
-passout stdin
|
|
|
|
stdin: "{{ test_keystore2_password }}"
|
|
|
|
when:
|
|
|
|
- "ansible_os_family == 'RedHat'"
|
|
|
|
- "ansible_distribution_version is version('8.0', '<')"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Run tests
|
|
|
|
#
|
2021-05-22 13:33:27 +02:00
|
|
|
|
|
|
|
- name: try to create the test keystore based on the just created pkcs12, keystore_create flag not enabled
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
2021-05-22 13:33:27 +02:00
|
|
|
cert_alias: test_pkcs12_cert
|
|
|
|
pkcs12_alias: test_pkcs12_cert
|
|
|
|
pkcs12_path: "{{ test_pkcs_path }}"
|
|
|
|
pkcs12_password: "{{ test_keystore2_password }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
ignore_errors: true
|
|
|
|
register: result_x509_changed
|
|
|
|
|
|
|
|
- name: Verify the x509 status is failed
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
2021-05-22 13:33:27 +02:00
|
|
|
that:
|
|
|
|
- result_x509_changed is failed
|
|
|
|
|
|
|
|
- name: Create the test keystore based on the just created pkcs12
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
2021-05-22 13:33:27 +02:00
|
|
|
cert_alias: test_pkcs12_cert
|
|
|
|
pkcs12_alias: test_pkcs12_cert
|
|
|
|
pkcs12_path: "{{ test_pkcs_path }}"
|
|
|
|
pkcs12_password: "{{ test_keystore2_password }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
2023-02-15 22:55:23 +01:00
|
|
|
keystore_create: true
|
2021-05-22 13:33:27 +02:00
|
|
|
|
2021-07-26 11:42:13 +02:00
|
|
|
- name: List newly created keystore content
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: "keytool -list -keystore {{ test_keystore2_path }}"
|
|
|
|
stdin: "{{ test_keystore2_password }}"
|
|
|
|
register: keytool_list_keystore
|
|
|
|
|
|
|
|
- name: Assert that the keystore has a private key entry
|
|
|
|
ansible.builtin.assert:
|
|
|
|
that:
|
|
|
|
- "keytool_list_keystore.stdout_lines[5] is match('test_pkcs12_cert,.*, PrivateKeyEntry, $')"
|
|
|
|
|
2021-05-22 13:33:27 +02:00
|
|
|
- name: try to import from pkcs12 a non existing alias
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
2021-05-22 13:33:27 +02:00
|
|
|
cert_alias: test_pkcs12_cert
|
|
|
|
pkcs12_alias: non_existing_alias
|
|
|
|
pkcs12_path: "{{ test_pkcs_path }}"
|
|
|
|
pkcs12_password: "{{ test_keystore2_password }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
2023-02-15 22:55:23 +01:00
|
|
|
keystore_create: true
|
|
|
|
ignore_errors: true
|
2021-05-22 13:33:27 +02:00
|
|
|
register: result_x509_changed
|
|
|
|
|
|
|
|
- name: Verify the x509 status is failed
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
2021-05-22 13:33:27 +02:00
|
|
|
that:
|
|
|
|
- result_x509_changed is failed
|
|
|
|
|
|
|
|
- name: import initial test certificate from file path
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
2021-05-22 13:33:27 +02:00
|
|
|
cert_alias: test_cert
|
|
|
|
cert_path: "{{ test_cert_path }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
2023-02-15 22:55:23 +01:00
|
|
|
keystore_create: true
|
2021-05-22 13:33:27 +02:00
|
|
|
state: present
|
|
|
|
register: result_x509_changed
|
|
|
|
|
|
|
|
- name: Verify the x509 status is changed
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
2021-05-22 13:33:27 +02:00
|
|
|
that:
|
|
|
|
- result_x509_changed is changed
|
|
|
|
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
- name: |
|
|
|
|
Import the newly created certificate. This is our main test.
|
|
|
|
If the java_cert has been updated properly, then this task will report changed each time
|
|
|
|
since the module will be comparing the hash of the certificate instead of validating that the alias
|
|
|
|
simply exists
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_cert
|
|
|
|
cert_path: "{{ test_cert2_path }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
state: present
|
|
|
|
register: result_x509_changed
|
|
|
|
|
2021-05-22 13:33:27 +02:00
|
|
|
- name: Verify the x509 status is changed
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
that:
|
|
|
|
- result_x509_changed is changed
|
|
|
|
|
|
|
|
- name: |
|
|
|
|
We also want to make sure that the status doesnt change if we import the same cert
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_cert
|
|
|
|
cert_path: "{{ test_cert2_path }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
state: present
|
|
|
|
register: result_x509_succeeded
|
|
|
|
|
|
|
|
- name: Verify the x509 status is ok
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
that:
|
|
|
|
- result_x509_succeeded is succeeded
|
|
|
|
|
|
|
|
- name: >
|
|
|
|
Ensure the original pkcs12 cert is in the keystore
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_pkcs12_cert
|
|
|
|
pkcs12_alias: test_pkcs12_cert
|
|
|
|
pkcs12_path: "{{ test_pkcs_path }}"
|
|
|
|
pkcs12_password: "{{ test_keystore2_password }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: |
|
|
|
|
Perform the same test, but we will now be testing the pkcs12 functionality
|
2021-05-22 13:33:27 +02:00
|
|
|
If we add a different pkcs12 cert with the same alias, we should have a changed result, NOT the same
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_pkcs12_cert
|
|
|
|
pkcs12_alias: test_pkcs12_cert
|
|
|
|
pkcs12_path: "{{ test_pkcs2_path }}"
|
|
|
|
pkcs12_password: "{{ test_keystore2_password }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
state: present
|
|
|
|
register: result_pkcs12_changed
|
|
|
|
|
2021-05-22 13:33:27 +02:00
|
|
|
- name: Verify the pkcs12 status is changed
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
that:
|
|
|
|
- result_pkcs12_changed is changed
|
|
|
|
|
|
|
|
- name: |
|
|
|
|
We are requesting the same cert now, so the status should show OK
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_pkcs12_cert
|
|
|
|
pkcs12_alias: test_pkcs12_cert
|
|
|
|
pkcs12_path: "{{ test_pkcs2_path }}"
|
|
|
|
pkcs12_password: "{{ test_keystore2_password }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
register: result_pkcs12_succeeded
|
|
|
|
|
|
|
|
- name: Verify the pkcs12 status is ok
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
that:
|
|
|
|
- result_pkcs12_succeeded is succeeded
|
|
|
|
|
|
|
|
- name: Copy the ssl server script
|
|
|
|
copy:
|
|
|
|
src: "setupSSLServer.py"
|
2021-09-09 07:31:44 +02:00
|
|
|
dest: "{{ remote_tmp_dir }}"
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
|
|
|
|
- name: Create an SSL server that we will use for testing URL imports
|
2021-09-09 07:31:44 +02:00
|
|
|
command: "{{ ansible_python.executable }} {{ remote_tmp_dir }}/setupSSLServer.py {{ remote_tmp_dir }} {{ test_ssl_port }}"
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
async: 10
|
|
|
|
poll: 0
|
|
|
|
|
2021-09-09 07:31:44 +02:00
|
|
|
- name: "Wait for one second to make sure that the serve script has actually been started"
|
|
|
|
pause:
|
|
|
|
seconds: 1
|
|
|
|
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
- name: |
|
|
|
|
Download the original cert.pem from our temporary server. The current cert should contain
|
|
|
|
cert2.pem. Importing this cert should return a status of changed
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_cert_localhost
|
|
|
|
cert_url: localhost
|
|
|
|
cert_port: "{{ test_ssl_port }}"
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
state: present
|
|
|
|
register: result_url_changed
|
|
|
|
|
|
|
|
- name: Verify that the url status is changed
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
that:
|
|
|
|
- result_url_changed is changed
|
|
|
|
|
|
|
|
- name: Ensure we can remove the x509 cert
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_cert
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
state: absent
|
|
|
|
register: result_x509_absent
|
|
|
|
|
|
|
|
- name: Verify the x509 cert is absent
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
that:
|
|
|
|
- result_x509_absent is changed
|
|
|
|
|
2021-05-22 13:33:27 +02:00
|
|
|
- name: Ensure we can remove the certificate imported from pkcs12 archive
|
2021-07-26 11:42:13 +02:00
|
|
|
community.general.java_cert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
cert_alias: test_pkcs12_cert
|
|
|
|
keystore_path: "{{ test_keystore2_path }}"
|
|
|
|
keystore_pass: "{{ test_keystore2_password }}"
|
|
|
|
state: absent
|
|
|
|
register: result_pkcs12_absent
|
|
|
|
|
|
|
|
- name: Verify the pkcs12 archive is absent
|
2021-07-26 11:42:13 +02:00
|
|
|
ansible.builtin.assert:
|
Update java_cert module (#2008)
* porting https://github.com/ansible/ansible/pull/56778 as requested in https://github.com/ansible-collections/community.general/issues/821
* fix imports, add back trust_cacerts option
* try to fix import, ansible-lint fixes
* modify import to use ansible.module_utils.six instead
* cleanup indentation for tests/integration/targets/java_cert/tasks/main.yml file
* remove external crypto dependency - switch to openssl, work on password obfuscation, using files compare to reduce logic
* java_cert - remove latest run_command using password in arguments
* fix sanity check
* rename changelog fragment file - wrong extension
* add openssl dependency
* fix openssl_bin parameter missing on _get_digest_from_x509_file function call
* remove useless close files, fix paragraph, fix changelog, clean import re
* fix missing dots at end-of-line in changelogs fragments
* fix reminder case
* fix changelog
* restore .gitignore
* fix indentation on integration test files, delete useless json file
* fix typo importing tasks in tests/integration/targets/java_cert/tasks/main.yml
* Update changelogs/fragments/2008-update-java-cert-replace-cert-when-changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/integration/targets/java_cert/tasks/state_change.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/java_cert.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix hardcoded executable keytool, use re.sub instead of import, add required cert_url or cert_alias parameter when absent, fix python script and cert_url test
* fix pylint issue with setupSSLServeR.py
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-07 19:31:58 +02:00
|
|
|
that:
|
|
|
|
- result_pkcs12_absent is changed
|