mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
05dc76f3b2
There are too many possible special cases for Ansible to be able to precheck known_hosts files without introducing all kinds of false failures. * Alternative known_hosts paths * Alternative host name aliases * ssh host certificates * SSHFP + DNSSEC Fixes #24860
53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
---
|
|
|
|
- name: remove known_host files
|
|
file:
|
|
state: absent
|
|
path: '{{ item }}'
|
|
with_items: "{{known_host_files}}"
|
|
|
|
- name: checkout ssh://git@github.com repo without accept_hostkey (expected fail)
|
|
git:
|
|
repo: '{{ repo_format2 }}'
|
|
dest: '{{ checkout_dir }}'
|
|
register: git_result
|
|
ignore_errors: true
|
|
|
|
- assert:
|
|
that:
|
|
- 'git_result.failed'
|
|
|
|
- name: checkout git@github.com repo with accept_hostkey (expected pass)
|
|
git:
|
|
repo: '{{ repo_format2 }}'
|
|
dest: '{{ checkout_dir }}'
|
|
accept_hostkey: true
|
|
key_file: '{{ github_ssh_private_key }}'
|
|
register: git_result
|
|
when: github_ssh_private_key is defined
|
|
|
|
- assert:
|
|
that:
|
|
- 'git_result.changed'
|
|
when: not git_result|skipped
|
|
|
|
|
|
- name: clear checkout_dir
|
|
file:
|
|
state: absent
|
|
path: '{{ checkout_dir }}'
|
|
|
|
- name: checkout ssh://git@github.com repo with accept_hostkey (expected pass)
|
|
git:
|
|
repo: '{{ repo_format3 }}'
|
|
dest: '{{ checkout_dir }}'
|
|
version: 'master'
|
|
accept_hostkey: false # should already have been accepted
|
|
key_file: '{{ github_ssh_private_key }}'
|
|
register: git_result
|
|
when: github_ssh_private_key is defined
|
|
|
|
- assert:
|
|
that:
|
|
- 'git_result.changed'
|
|
when: not git_result|skipped
|