-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.yml
58 lines (46 loc) · 1.35 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
---
- hosts: all
vars:
kind_version: v0.7.0
not_ssh_url: 'this is not an ssh url'
real_ssh_url: 'ssh://johndoe@server/test.git'
collections:
- community.kubernetes
pre_tasks:
- name: Test custom ssh_url test plugin.
assert:
that:
- not_ssh_url is not ssh_url
- real_ssh_url is ssh_url
roles:
- name: geerlingguy.git
become: true
- name: community_test
tasks:
- name: Create a kind cluster.
include_tasks: tasks/prepare-kind.yml
- name: Test the k8s_info module from the collection.
k8s_info:
kind: Pod
label_selectors:
- component=kube-apiserver
register: pod_list
delegate_to: localhost
- name: Test the k8s_exec module from the collection.
k8s_exec:
namespace: kube-system
pod: "{{ pod_list.resources[0].metadata.name }}"
command: date
register: exec_output
changed_when: false
delegate_to: localhost
- name: Dump the date.
debug: var=exec_output.stdout
- name: Run the same tasks as above, but in a standalone role.
include_role:
name: replay
- name: Test running two same-named roles in separate collections.
include_tasks: tasks/same-name-roles.yml
# post_tasks:
# - name: Delete the kind cluster.
# include_tasks: tasks/delete-kind.yml