k3s/tests/e2e/e2e_test_playbook.yaml
ShylajaDevadiga 6b7b9c5aa9
Add scripts to run e2e test using ansible (#5134)
Signed-off-by: Shylaja Devadiga <shylaja.devadiga@suse.com>
2022-08-05 09:16:10 -07:00

35 lines
1.1 KiB
YAML

---
- name: Run Cluster validation tests
gather_facts: false
hosts: node
vars:
user: "{{ user }}"
key: "{{ key }}"
ip: "{{ ip }}"
dir: scripts
tasks:
- name : Print var
debug:
msg: |
user: {{ user }}
key: {{ key }}
ip: {{ ip }}
db: {{ db }}
nodeOS: {{ nodeOS }}
serverCount: {{ serverCount }}
agentCount: {{ agentCount }}
- name: build container image
command: chdir=k3s/tests/e2e /usr/local/bin/docker build -t k3s_nightly_build -f {{ dir }}/Dockerfile .
- name: Delete docker container
command: "/usr/local/bin/docker rm createcluster -f"
ignore_errors: True
- name: create docker container
command: "/usr/local/bin/docker run -d -it -v ~/config:/config --cap-add=NET_ADMIN --device /dev/net/tun --sysctl net.ipv6.conf.all.disable_ipv6=0 --name createcluster --privileged k3s_nightly_build"
- name: execute command in docker
shell: |
/usr/local/bin/docker exec -it createcluster /bin/bash ./run_tests.sh {{ key }} {{ user }} {{ ip }} {{ db }} {{ nodeOS }} {{ serverCount }} {{ agentCount }}