-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload-pod-data.yml
57 lines (51 loc) · 1.16 KB
/
load-pod-data.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
---
- name: Simple Perf Test
hosts: localhost
connection: local
vars:
api: ""
token: ""
test_image: "nginx:latest"
cluster_name: ""
pod_test:
enabled: true
pod_cnt: 50
pg:
host: localhost
port: 5432
db: postgres
user:
pass:
tasks:
- name: Search for all Pods
community.kubernetes.k8s_info:
validate_certs: no
host: "{{ api }}"
api_key: "{{ token }}"
kind: Pod
register: pod_info
- name: template sql
template:
src: pod_result_insert.j2
dest: results.sql
- name: replace blank dates
replace:
path: results.sql
regexp: ',,'
replace: ",'2000-00-00T00:00:00Z',"
- name: replace EOL comma
replace:
path: results.sql
regexp: ',\),'
replace: '),'
- name: Insert Results to postgres DB
community.postgresql.postgresql_query:
db: "{{ pg.db }}"
login_host: "{{ pg.host }}"
login_port: "{{ pg.port }}"
login_user: "{{ pg.user }}"
login_password: "{{ pg.pass }}"
path_to_script: results.sql
as_single_query: true
search_path:
- perftest