summaryrefslogtreecommitdiffstats
path: root/distro/tests/ansible-roles/knot_resolver/tasks/main.yaml
blob: 8d683c809e347ea3bc405fadc462b7f345985568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Include distribution specific vars
  include_vars: "{{ distro }}.yaml"

- name: Update all packages
  package:
    name: '*'
    state: latest
  when: update_packages|bool

- name: Install packages
  package:
    name: "{{ packages }}"
    state: latest
  # knot-utils may be missing on opensuse (depending on upstream vs downstream pkg)
  failed_when: false

- name: Always print package version at the end
  block:

    - include: restart_kresd.yaml

    - include: test_udp.yaml
    - include: test_tcp.yaml
    - include: test_tls.yaml
    - include: test_dnssec.yaml

    - include: test_kres_cache_gc.yaml

    - name: Test DoH (new implementation)
      block:
        - include: configure_doh2.yaml
        - include: restart_kresd.yaml
        - include: test_doh2.yaml

    - name: Test DoH (legacy)
      block:
        - name: Install knot-resolver-module-http
          package:
            name: knot-resolver-module-http
            state: latest

        - include: configure_doh.yaml
          when: ansible_distribution in ["CentOS", "Rocky", "Fedora", "Debian", "Ubuntu"]

        - include: restart_kresd.yaml
        - include: test_doh.yaml
      when: distro in ["Fedora", "Debian", "CentOS", "Rocky"] or (distro == "Ubuntu" and ansible_distribution_major_version|int >= 18)

    - name: Test dnstap module
      block:
        - name: Install knot-resolver-module-dnstap
          package:
            name: knot-resolver-module-dnstap
            state: latest
        - include: configure_dnstap.yaml
        - include: restart_kresd.yaml
      when: distro in ["Fedora", "Debian", "CentOS", "Rocky", "Ubuntu"]

  always:

    - name: Get installed package version
      shell: "{{ show_package_version }}"
      args:
        warn: false
      register: package_version

    - name: Show installed version
      debug:
        var: package_version.stdout