43 lines
No EOL
1.1 KiB
YAML
43 lines
No EOL
1.1 KiB
YAML
---
|
|
- name: Set OS dependent variables
|
|
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
|
vars:
|
|
params:
|
|
files:
|
|
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml"
|
|
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version | lower }}.yml"
|
|
- "{{ ansible_distribution | lower }}.yml"
|
|
- "{{ ansible_os_family | lower }}.yml"
|
|
- "{{ ansible_system | lower }}.yml"
|
|
paths:
|
|
- '{{ role_path }}/vars'
|
|
ignore_errors: True
|
|
|
|
- name: OS is supported
|
|
ansible.builtin.assert:
|
|
that: __os_supported
|
|
quiet: True
|
|
vars:
|
|
__os_supported: "{{ lookup('vars', '{}_os_supported'.format(role_name)) | bool }}"
|
|
|
|
- name: Disable and stop systemd-resolved
|
|
service:
|
|
name: systemd-resolved
|
|
state: stopped
|
|
enabled: no
|
|
|
|
- name: Install dnsmasq
|
|
apt:
|
|
name: dnsmasq
|
|
state: latest
|
|
|
|
- name: Set dnsmasq config
|
|
template:
|
|
src: default.conf.j2
|
|
dest: /etc/dnsmasq.d/default.conf
|
|
|
|
- name: Enable and restart dnsmasq
|
|
service:
|
|
name: dnsmasq
|
|
state: restarted
|
|
enabled: yes |