Debian Codegraph @

ansible_collections/community/crypto/tests/integration/targets/setup_ssh_keygen/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: Include OS-specific variables
12 ansible.builtin.include_vars: '{{ ansible_facts.os_family }}.yml'
13 when: not ansible_facts.os_family == "Darwin" and not ansible_facts.os_family == "FreeBSD"
14
15 - name: Install ssh-keygen
16 ansible.builtin.package:
17 name: '{{ openssh_client_package_name }}'
18 when: not ansible_facts.os_family == "Darwin" and not ansible_facts.os_family == "FreeBSD"
19
20 - name: Get ssh version
21 ansible.builtin.shell: ssh -Vq 2>&1|sed 's/^.*OpenSSH_\([0-9]\{1,\}\.[0-9]\{1,\}\).*$/\1/'
22 register:
23 rc_openssh_version_output
24
25 - name: Set ssh version facts
26 ansible.builtin.set_fact:
27 openssh_version: "{{ rc_openssh_version_output.stdout.strip() }}"
28
29 - name: Set ssh support facts
30 ansible.builtin.set_fact:
31 openssh_supports_dsa: "{{ openssh_version is version('9.8', '<') }}"