Files
Felix Fontein 99d6a17653 Fix some ansible-lint issues (#907) (#908)
* Fix fqcn[action-core].

* Fix fqcn[action].

* Fix jinja[spacing].

(cherry picked from commit 8792635bef)
2025-05-30 22:43:43 +02:00

108 lines
4.0 KiB
YAML

---
# 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
- name: ({{ select_crypto_backend }}) Create key
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
register: result
- name: ({{ select_crypto_backend }}) Get key info
community.crypto.openssl_privatekey_info:
content: "{{ result.privatekey }}"
register: result_info
- ansible.builtin.assert:
that:
- result is changed
- result.privatekey.startswith('----')
- result_info.type == 'RSA'
- result_info.public_data.size == 4096
- result_info.public_data.exponent >= 5
- ansible.builtin.assert:
that:
- result_info.public_key_fingerprints.sha256 | length > 10
- result.fingerprint.sha256 == result_info.public_key_fingerprints.sha256
when: result.fingerprint is not none
- name: ({{ select_crypto_backend }}) Update key (check mode)
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
content: "{{ result.privatekey }}"
size: '{{ default_rsa_key_size }}'
register: update_check
check_mode: true
- name: ({{ select_crypto_backend }}) Update key (check mode, with return_current_key=true)
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
content: "{{ result.privatekey }}"
size: '{{ default_rsa_key_size }}'
return_current_key: true
register: update_check_return
check_mode: true
- name: ({{ select_crypto_backend }}) Update key
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
content: "{{ result.privatekey }}"
size: '{{ default_rsa_key_size }}'
register: update
- name: ({{ select_crypto_backend }}) Update key (idempotent, check mode)
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
content: "{{ update.privatekey }}"
size: '{{ default_rsa_key_size }}'
register: update_idempotent_check
check_mode: true
- name: ({{ select_crypto_backend }}) Update key (idempotent)
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
content: "{{ update.privatekey }}"
size: '{{ default_rsa_key_size }}'
register: update_idempotent
- name: ({{ select_crypto_backend }}) Update key (idempotent, check mode, with return_current_key=true)
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
content: "{{ update.privatekey }}"
size: '{{ default_rsa_key_size }}'
return_current_key: true
register: update_idempotent_return_check
check_mode: true
- name: ({{ select_crypto_backend }}) Update key (idempotent, with return_current_key=true)
community.crypto.openssl_privatekey_pipe:
select_crypto_backend: '{{ select_crypto_backend }}'
content: "{{ update.privatekey }}"
size: '{{ default_rsa_key_size }}'
return_current_key: true
register: update_idempotent_return
- name: ({{ select_crypto_backend }}) Get key info
community.crypto.openssl_privatekey_info:
content: "{{ update.privatekey }}"
register: update_info
- ansible.builtin.assert:
that:
- update_check is changed
- update_check.privatekey == 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER'
- update_check_return is changed
- update_check_return.privatekey == result.privatekey
- update is changed
- update.privatekey != result.privatekey
- update_info.public_data.size == default_rsa_key_size
- update_idempotent_check is not changed
- update_idempotent_check.privatekey is undefined
- update_idempotent is not changed
- update_idempotent.privatekey is undefined
- update_idempotent_return_check is not changed
- update_idempotent_return_check.privatekey == update.privatekey
- update_idempotent_return is not changed
- update_idempotent_return.privatekey == update.privatekey