---
# This role deals only with specific DNS server setup

- become: true
  block:

  - name: Install dnsmasq and bind-utils
    yum:
      name: "{{ item }}"
      state: present
    with_items:
      - dnsmasq
      - bind-utils

  - name: Configure - change cache size
    lineinfile:
      dest: /etc/dnsmasq.conf
      regexp: '^#cache-size=.[0-9]*$'
      line: 'cache-size=1500'
      backrefs: yes

  - name: Start and enable dnsmasq service
    systemd:
      name: dnsmasq
      state: started
      enabled: yes

- name: Test that the server works
  command: "dig @{{ dns_external_network_ip }} docker.io"
  changed_when: false

---
# This role deals only with specific DNS server setup

- become: true
  block:

  - name: Install dnsmasq and bind-utils
    package:
      name: "{{ packages }}"
      state: present
    vars:
      packages:
        - dnsmasq
        - bind-utils

  - name: Configure - change cache size
    lineinfile:
      dest: /etc/dnsmasq.conf
      regexp: '^#cache-size=.[0-9]*$'
      line: 'cache-size=1500'
      backrefs: yes

  - name: Start and enable dnsmasq service
    systemd:
      name: dnsmasq
      state: started
      enabled: yes

- name: Test that the server works
  command: "dig @{{ dns_external_network_ip }} docker.io"
  changed_when: false

Prepare DNS role for centos8
Prepare DNS role for centos8

Change-Id: I0625d0db439fd991f6f371467f32202f766167d0
