- name: set dns become: yes lineinfile: path: /etc/resolv.conf regexp: '^nameserver ' line: 'nameserver 10.210.18.138' firstmatch: yes