2017-10-13 16:30:15 +02:00
|
|
|
- name: MISSING-HOSTKEY | checkout ssh://git@github.com repo without accept_hostkey (expected fail)
|
2017-01-06 23:38:53 +01:00
|
|
|
git:
|
|
|
|
repo: '{{ repo_format2 }}'
|
|
|
|
dest: '{{ checkout_dir }}'
|
2017-07-05 22:19:07 +02:00
|
|
|
ssh_opts: '-o UserKnownHostsFile={{ output_dir }}/known_hosts'
|
2017-01-06 23:38:53 +01:00
|
|
|
register: git_result
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- git_result is failed
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: MISSING-HOSTKEY | checkout git@github.com repo with accept_hostkey (expected pass)
|
2017-01-06 23:38:53 +01:00
|
|
|
git:
|
|
|
|
repo: '{{ repo_format2 }}'
|
|
|
|
dest: '{{ checkout_dir }}'
|
|
|
|
accept_hostkey: true
|
|
|
|
key_file: '{{ github_ssh_private_key }}'
|
2017-07-05 22:19:07 +02:00
|
|
|
ssh_opts: '-o UserKnownHostsFile={{ output_dir }}/known_hosts'
|
2017-01-06 23:38:53 +01:00
|
|
|
register: git_result
|
|
|
|
when: github_ssh_private_key is defined
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- git_result is changed
|
2017-07-05 22:19:07 +02:00
|
|
|
when: github_ssh_private_key is defined
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: MISSING-HOSTKEY | clear checkout_dir
|
2017-01-06 23:38:53 +01:00
|
|
|
file:
|
|
|
|
state: absent
|
|
|
|
path: '{{ checkout_dir }}'
|
2017-07-05 22:19:07 +02:00
|
|
|
when: github_ssh_private_key is defined
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: MISSING-HOSTKEY | checkout ssh://git@github.com repo with accept_hostkey (expected pass)
|
2017-01-06 23:38:53 +01:00
|
|
|
git:
|
|
|
|
repo: '{{ repo_format3 }}'
|
|
|
|
dest: '{{ checkout_dir }}'
|
|
|
|
version: 'master'
|
|
|
|
accept_hostkey: false # should already have been accepted
|
|
|
|
key_file: '{{ github_ssh_private_key }}'
|
2017-07-05 22:19:07 +02:00
|
|
|
ssh_opts: '-o UserKnownHostsFile={{ output_dir }}/known_hosts'
|
2017-01-06 23:38:53 +01:00
|
|
|
register: git_result
|
|
|
|
when: github_ssh_private_key is defined
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- git_result is changed
|
2017-07-05 22:19:07 +02:00
|
|
|
when: github_ssh_private_key is defined
|