--- - name: change hostname setting lineinfile: dest: /etc/dhcpcd.conf regexp: "^#hostname" line: "hostname" state present