summaryrefslogtreecommitdiffstats
path: root/controller/share/dtf-controller/ansible/playbooks/default.yml
diff options
context:
space:
mode:
Diffstat (limited to 'controller/share/dtf-controller/ansible/playbooks/default.yml')
-rw-r--r--controller/share/dtf-controller/ansible/playbooks/default.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/controller/share/dtf-controller/ansible/playbooks/default.yml b/controller/share/dtf-controller/ansible/playbooks/default.yml
new file mode 100644
index 0000000..825ee46
--- /dev/null
+++ b/controller/share/dtf-controller/ansible/playbooks/default.yml
@@ -0,0 +1,56 @@
+- name: self-standing testsuite
+ remote_user: root
+ gather_facts: False
+ hosts: localhost
+ vars_files:
+ - "{{ opt_generated_vars }}"
+
+ tasks:
+ - name: generate builder name
+ local_action: shell echo `dd if=/dev/urandom bs=1k count=10 | md5sum ; echo DBTESTS`
+ register: vm_name
+
+ - local_action: shell {{ config_bindir }}/dtf-get-machine
+ --distro {{ opt_distro }} --distro-version {{ opt_distro_ver }}
+ --quiet --name "{{ vm_name.stdout }}"
+ register: machine_ip
+
+ - debug: var=machine_ip
+
+ - name: wait for the host to be hot
+ local_action: wait_for host={{ machine_ip.stdout }} port=22 delay=5 timeout=600
+
+ - local_action: shell {{ config_libexecdir }}/dtf-wait-for-ssh "root@{{ machine_ip.stdout }}"
+
+ - name: add it to the special group
+ local_action: add_host hostname={{ machine_ip.stdout }}
+ groupname=temp_group
+
+- hosts: temp_group
+ user: root
+ gather_facts: False
+ vars_files:
+ - "{{ opt_generated_vars }}"
+ tasks:
+ - include: "{{ opt_setup_playbook }}"
+ when: opt_setup_playbook is defined
+
+ - copy: src={{ opt_workdir }}/{{ opt_testsuite_name }}.tar.gz
+ dest=/root/{{ opt_testsuite_name }}.tar.gz
+
+ - include: "{{ config_ansibleplaybooksdir }}/include/beakerlib.yml"
+
+ - include: "{{ config_ansibleplaybooksdir }}/include/additional-packages.yml"
+ when: dtf_rpm_files_list is defined
+
+ - shell: cd /root && tar -xf {{ opt_testsuite_name }}.tar.gz
+
+ - shell: cd /root/{{ opt_testsuite_name }}&& ./run --force &>/var/tmp/dtf-run.overview
+ register: test_result
+ ignore_errors: yes
+
+ - include: "{{ config_ansibleplaybooksdir }}/include/download-results.yml"
+
+ - name: stop the vm
+ local_action: shell "{{ config_bindir }}/dtf-return-machine" {{ inventory_hostname }}
+ when: test_result.rc == 0