for more explicit fix what you need is:
$ printf "\n#%s\n%s:\n %s\n" "work around lp 1553017" "early_commands" "fixresolv: ['sh', '-c', 'echo nameserver 8.8.8.8 > /etc/resolv.conf']" | sudo tee -a /etc/maas/preseeds/curtin_userdata
$ tail -n 4 /etc/maas/preseeds/curtin_userdata
#work around lp 1553017 early_commands: fixresolv: ['sh', '-c', 'echo nameserver 8.8.8.8 > /etc/resolv.conf']
for more explicit fix what you need is:
$ printf "\n#%s\n%s:\n %s\n" "work around lp 1553017" "early_commands" "fixresolv: ['sh', '-c', 'echo nameserver 8.8.8.8 > /etc/resolv.conf']" | sudo tee -a /etc/maas/ preseeds/ curtin_ userdata
$ tail -n 4 /etc/maas/ preseeds/ curtin_ userdata
#work around lp 1553017
early_commands:
fixresolv: ['sh', '-c', 'echo nameserver 8.8.8.8 > /etc/resolv.conf']