Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Add the loopback entry to the first line in the /etc/hosts file

$
0
0
Hi, I need to create a module which checks if the /etc/hosts file has the first line with the loopback entry. If it does, do nothing; else, insert 127.0.0.1 localhost localhost.localdomain in the first line of the file right after the comments. I tried using augeas but even if I write something using node(0), it doesn't let me save that file. I tried with augtool using the Hosts lens. Can someone please help me if this is possible or not. Thanks, Monal

Viewing all articles
Browse latest Browse all 6104