Debian Codegraph @

ansible_collections/community/crypto/tests/integration/targets/openssl_signature/tasks/loop.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 # This file is intended to be included in a loop statement
7 - name: Sign statement with {{ item.type }} key - {{ item.passwd }} using {{ item.backend }}
8 community.crypto.openssl_signature:
9 privatekey_path: '{{ remote_tmp_dir }}/{{ item.backend }}_privatekey_{{ item.type }}_{{ item.passwd }}.pem'
10 privatekey_passphrase: '{{ item.privatekey_passphrase | default(omit) }}'
11 path: '{{ remote_tmp_dir }}/statement.txt'
12 select_crypto_backend: '{{ item.backend }}'
13 register: sign_result
14
15 - ansible.builtin.debug:
16 var: sign_result
17
18 - name: Verify {{ item.type }} signature - {{ item.passwd }} using {{ item.backend }}
19 community.crypto.openssl_signature_info:
20 certificate_path: '{{ remote_tmp_dir }}/{{ item.backend }}_certificate_{{ item.type }}_{{ item.passwd }}.pem'
21 path: '{{ remote_tmp_dir }}/statement.txt'
22 signature: '{{ sign_result.signature }}'
23 select_crypto_backend: '{{ item.backend }}'
24 register: verify_result
25
26 - name: Make sure the signature is valid
27 ansible.builtin.assert:
28 that:
29 - verify_result.valid
30
31 - ansible.builtin.debug:
32 var: verify_result