---
- name: dns | Install openresolv and {{ dns_resolver }}
  community.general.apk:
    name: openresolv, {{ dns_resolver }}
    state: present

# Static import_tasks doesn't work here
- name: dns | Configure {{ dns_resolver }}
  include_tasks: 'dns/{{ dns_resolver }}.yml'

- name: dns | Update resolvconf config
  template:
    src: dns/resolvconf.j2
    dest: /etc/resolvconf.conf
    owner: root
    group: root
    mode: '644'
