--- - lineinfile: path: /etc/dhcpcd.conf regexp: "{{ item.regexp }}" line: "{{ item.line }}" with_items: - { regexp: '^static\ domain_name=', line: 'static domain_name=demo.dsfinancial.com' } - { regexp: '^static\ domain_search=', line: 'static domain_search=demo.dsfinancial.com' } become: true tags: update_domainname