You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# Verify logging function is enabled in the dnf module.
|
|
|
|
# The following tasks has been supported in dnf-4.2.17-6 or later
|
|
|
|
# Note: https://bugzilla.redhat.com/show_bug.cgi?id=1788212
|
|
|
|
- name: Install latest version python3-dnf
|
|
|
|
dnf:
|
|
|
|
name:
|
|
|
|
- python3-dnf
|
|
|
|
- python3-libdnf # https://bugzilla.redhat.com/show_bug.cgi?id=1887502
|
|
|
|
state: latest
|
|
|
|
register: dnf_result
|
|
|
|
|
|
|
|
- name: Verify python3-dnf installed
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "dnf_result.rc == 0"
|
|
|
|
|
|
|
|
- name: Get python3-dnf version
|
|
|
|
shell: "dnf info python3-dnf | awk '/^Version/ { print $3 }'"
|
|
|
|
register: py3_dnf_version
|
|
|
|
|
|
|
|
- name: Check logging enabled
|
|
|
|
block:
|
|
|
|
- name: remove logfiles if exist
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: absent
|
|
|
|
loop: "{{ dnf_log_files }}"
|
|
|
|
|
|
|
|
- name: Install sos package
|
|
|
|
dnf:
|
|
|
|
name: sos
|
|
|
|
state: present
|
|
|
|
register: dnf_result
|
|
|
|
|
|
|
|
- name: Get status of logfiles
|
|
|
|
stat:
|
|
|
|
path: "{{ item }}"
|
|
|
|
loop: "{{ dnf_log_files }}"
|
|
|
|
register: stats
|
|
|
|
|
|
|
|
- name: Verify logfile exists
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "item.stat.exists"
|
|
|
|
loop: "{{ stats.results }}"
|
|
|
|
when:
|
|
|
|
- 'py3_dnf_version.stdout is version("4.2.17", ">=")'
|