Blame tests/roles/dirinstall/tasks/ks-run.yml
|
Radek Vykydal |
147131 |
---
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- set_fact:
|
|
Radek Vykydal |
147131 |
kickstart: "{{ kickstart_template | basename }}"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- set_fact:
|
|
Radek Vykydal |
147131 |
test_name_with_ks: "{{ test_name }}.{{ kickstart }}"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- debug:
|
|
Radek Vykydal |
147131 |
msg: "Running '{{ test_name }}' with kickstart '{{ kickstart }}'"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Copy installation kickstart
|
|
Radek Vykydal |
147131 |
template:
|
|
Radek Vykydal |
147131 |
src: "templates/kickstarts/{{ kickstart }}"
|
|
Radek Vykydal |
147131 |
dest: "{{ kickstart_dest }}"
|
|
Radek Vykydal |
147131 |
mode: 0755
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Clean target directory
|
|
Radek Vykydal |
147131 |
file:
|
|
Radek Vykydal |
147131 |
path: "{{ install_dir }}"
|
|
Radek Vykydal |
147131 |
state: "{{ item }}"
|
|
Radek Vykydal |
147131 |
mode: 0755
|
|
Radek Vykydal |
147131 |
with_items:
|
|
Radek Vykydal |
147131 |
- absent
|
|
Radek Vykydal |
147131 |
- directory
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Clean installation logs
|
|
Radek Vykydal |
147131 |
file:
|
|
Radek Vykydal |
147131 |
path: "/tmp/{{ item }}"
|
|
Radek Vykydal |
147131 |
state: absent
|
|
Radek Vykydal |
147131 |
with_items: "{{ installation_logs }}"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Run dirinstall
|
|
Radek Vykydal |
147131 |
shell: timeout -k 10s 3600s anaconda --dirinstall {{ install_dir }} --kickstart {{ kickstart_dest }} {{ method }} --noninteractive 2>&1
|
|
Radek Vykydal |
147131 |
register: result
|
|
Radek Vykydal |
147131 |
ignore_errors: True
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- debug:
|
|
Radek Vykydal |
147131 |
msg: "{{ result }}"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- set_fact:
|
|
Radek Vykydal |
147131 |
result_str: "PASS"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- set_fact:
|
|
Radek Vykydal |
147131 |
result_str: "FAIL"
|
|
Radek Vykydal |
147131 |
global_result: "FAIL"
|
|
Radek Vykydal |
147131 |
when: result.rc != 0
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Update global test.log
|
|
Radek Vykydal |
147131 |
lineinfile:
|
|
Radek Vykydal |
147131 |
path: "{{ local_artifacts }}/test.log"
|
|
Radek Vykydal |
147131 |
line: "{{ result_str }} {{ test_name_with_ks }}"
|
|
Radek Vykydal |
147131 |
create: yes
|
|
Radek Vykydal |
147131 |
insertafter: EOF
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Create this test log
|
|
Radek Vykydal |
147131 |
copy:
|
|
Radek Vykydal |
147131 |
content: "{{ result.stdout }}"
|
|
Radek Vykydal |
147131 |
dest: "{{ local_artifacts }}/{{ result_str }}_{{ test_name_with_ks }}.log"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Create installation logs dir in artifacts
|
|
Radek Vykydal |
147131 |
file:
|
|
Radek Vykydal |
147131 |
path: "{{ local_artifacts }}/{{ test_name_with_ks }}"
|
|
Radek Vykydal |
147131 |
state: directory
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Copy input kickstart to artifacts
|
|
Radek Vykydal |
147131 |
copy:
|
|
Radek Vykydal |
147131 |
remote_src: True
|
|
Radek Vykydal |
147131 |
src: "{{ kickstart_dest }}"
|
|
Radek Vykydal |
147131 |
dest: "{{ local_artifacts }}/{{ test_name_with_ks }}/{{ kickstart_dest | basename }}"
|
|
Radek Vykydal |
147131 |
|
|
Radek Vykydal |
147131 |
- name: Copy installation logs to artifacts
|
|
Radek Vykydal |
147131 |
copy:
|
|
Radek Vykydal |
147131 |
remote_src: True
|
|
Radek Vykydal |
147131 |
src: "/tmp/{{ item }}"
|
|
Radek Vykydal |
147131 |
dest: "{{ local_artifacts }}/{{ test_name_with_ks }}/{{ item }}"
|
|
Radek Vykydal |
147131 |
with_items: "{{ installation_logs }}"
|
|
Radek Vykydal |
147131 |
ignore_errors: True
|