main.yaml 1.35 KB
Newer Older
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
---
- name: Include distribution specific vars
  include_vars: "{{ distro }}.yaml"

- name: Configure upstream reporitories
  include: "configure_repos/{{ distro }}.yaml"

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

- name: Install packages
  package:
    name: "{{ packages }}"
    state: latest

- 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

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

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

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

  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