Debian Codegraph @

ansible_collections/community/crypto/tests/integration/targets/openssl_publickey_info/tasks/main.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 ####################################################################
7 # WARNING: These are designed specifically for Ansible tests #
8 # and should not be used as examples of how to write Ansible roles #
9 ####################################################################
10
11 - name: Generate privatekey 1
12 community.crypto.openssl_privatekey:
13 path: '{{ remote_tmp_dir }}/privatekey_1.pem'
14
15 - name: Generate privatekey 2 (less bits)
16 community.crypto.openssl_privatekey:
17 path: '{{ remote_tmp_dir }}/privatekey_2.pem'
18 type: RSA
19 size: '{{ default_rsa_key_size }}'
20
21 - name: Generate privatekey 3 (ECC)
22 community.crypto.openssl_privatekey:
23 path: '{{ remote_tmp_dir }}/privatekey_3.pem'
24 type: ECC
25 curve: "{{ (ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '6') | ternary('secp521r1', 'secp256k1') }}"
26 # ^ cryptography on CentOS6 doesn't support secp256k1, so we use secp521r1 instead
27 select_crypto_backend: cryptography
28
29 - name: Generate privatekey 4 (DSA)
30 community.crypto.openssl_privatekey:
31 path: '{{ remote_tmp_dir }}/privatekey_4.pem'
32 type: DSA
33 size: 1024
34
35 - name: Generate public keys
36 community.crypto.openssl_publickey:
37 privatekey_path: '{{ remote_tmp_dir }}/privatekey_{{ item }}.pem'
38 path: '{{ remote_tmp_dir }}/publickey_{{ item }}.pem'
39 loop:
40 - 1
41 - 2
42 - 3
43 - 4
44
45 - name: Running tests with cryptography backend
46 ansible.builtin.include_tasks: impl.yml
47 vars:
48 select_crypto_backend: cryptography
49 when: cryptography_version is version('3.3', '>=')