This repository was archived by the owner on Jan 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathmain.yml
89 lines (76 loc) · 2.16 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
- name: Test port number
ssh_config: >
user=vagrant
host=example.com
port=2200
- include: _assert.yml option=port value=2200
- name: Test user
ssh_config: >
user=vagrant
host=example.com
remote_user=gaqzi
- include: _assert.yml option=user value=gaqzi
- name: Test hostname
ssh_config: >
user=vagrant
host=example.com
hostname=test.example.com
- include: _assert.yml option=hostname value=test.example.com
- name: Test identity file
ssh_config: >
user=vagrant
host=example.com
identity_file=id_rsa.fake
- include: _assert.yml option=identityfile value=id_rsa.fake
- name: create fake identity file (1/4)
file: >
path=/home/vagrant/.ssh/id_rsa.fake
mode=0600
state=touch
changed_when: false
- name: Test identity file has not changed - initial setup (2/4)
ssh_config: >
user=vagrant
host=example.com
identity_file=id_rsa.fake
- name: Test identity file has not changed - change to same value (3/4)
ssh_config: >
user=vagrant
host=example.com
identity_file=id_rsa.fake
register: identityfile
- name: assert identity file didn't change when it didn't (4/4)
assert:
that:
- identityfile['changed'] == False
- name: Test user known hosts file
ssh_config: >
user=vagrant
host=example.com
user_known_hosts_file=/dev/null
- include: _assert.yml option=userknownhostsfile value=/dev/null
- name: Test strict host key checking
ssh_config: >
user=vagrant
host=example.com
strict_host_key_checking=yes
- include: _assert.yml option=stricthostkeychecking value=yes
- name: Test host key checking with lax config
ssh_config:
user: vagrant
host: example.com
strict_host_key_checking: true
- include: _assert.yml option=stricthostkeychecking value=yes
- name: Test no host key checking with lax config
ssh_config:
user: vagrant
host: example.com
strict_host_key_checking: false
- include: _assert.yml option=stricthostkeychecking value=no
- name: Test ask host key checking with lax config
ssh_config:
user: vagrant
host: example.com
strict_host_key_checking: ask
- include: _assert.yml option=stricthostkeychecking value=ask