Commit 15433d7a authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis
Browse files

snf-deploy: Add `generated' note to resolv.conf

Add a note on top of /etc/resolv.conf file to inform users
that this file has been changed by snf-deploy and the
immutable bit has been used.

parent b481c3ad
......@@ -299,6 +299,18 @@ def setup_resolv_conf():
custom = customize_settings_from_tmpl(tmpl, replace)
put(custom, tmpl)
cmd = """
echo "\
# This has been generated automatically by snf-deploy, at
# $(date).
# The immutable bit (+i attribute) has been used to avoid it being
# overwritten by software such as NetworkManager or resolvconf.
# Use lsattr/chattr to view or modify its file attributes.
$(cat {0})" > {0}
try_run("chattr +i /etc/resolv.conf")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment