Debian Codegraph @

test/integration/targets/dnf/tasks/dnf_config.yml

raw
1 ---
2 - name: Create a broken dnf config file
3 copy:
4 content: '[broken_section\nname=value'
5 dest: '{{ remote_tmp_dir }}/broken.conf'
6 register: broken_conf
7
8 - name: Use broken conf file
9 dnf:
10 name: bash
11 state: present
12 conf_file: '{{ broken_conf.dest }}'
13 register: dnf_bash_result
14 ignore_errors: true
15
16 - name: Verify that broken conf raises an error
17 assert:
18 that:
19 - "dnf_bash_result is failed"
20 - "'Error in configuration file' in dnf_bash_result.msg"
21 when: ansible_facts['distribution'] == 'Fedora'
22
23 - name: Verify that broken conf raises an error on RHEL
24 assert:
25 that:
26 - "dnf_bash_result is failed"
27 - "'Parsing file' in dnf_bash_result.msg"
28 when:
29 - ansible_facts['distribution'] == 'RedHat'
30 - ansible_facts['distribution_major_version'] in (9, 10)