Debian Codegraph @

ansible_collections/community/crypto/tests/integration/targets/openssh_cert/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: Declare global variables
12 ansible.builtin.set_fact:
13 signing_key: '{{ remote_tmp_dir }}/id_key'
14 public_key: '{{ remote_tmp_dir }}/id_key.pub'
15 certificate_path: '{{ remote_tmp_dir }}/id_cert'
16
17 - name: Generate keypair
18 community.crypto.openssh_keypair:
19 path: "{{ signing_key }}"
20 type: rsa
21 size: 1024
22
23 - block:
24 - name: Import idempotency tests
25 ansible.builtin.import_tasks: ../tests/idempotency.yml
26
27 - name: Import key_idempotency tests
28 ansible.builtin.import_tasks: ../tests/key_idempotency.yml
29
30 - name: Import options tests
31 ansible.builtin.import_tasks: ../tests/options_idempotency.yml
32
33 - name: Import regenerate tests
34 ansible.builtin.import_tasks: ../tests/regenerate.yml
35
36 - name: Import remove tests
37 ansible.builtin.import_tasks: ../tests/remove.yml
38 when: not (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "6")
39
40 - name: Import ssh-agent tests
41 ansible.builtin.import_tasks: ../tests/ssh-agent.yml
42 when: openssh_version is version("7.6",">=")
43
44 - name: Remove keypair
45 community.crypto.openssh_keypair:
46 path: "{{ signing_key }}"
47 state: absent