Skip to content

Commit

Permalink
[HOPSWORKS-2820] Remove any extended attributes from resolv.conf befo…
Browse files Browse the repository at this point in the history
…re editing it and persist any existing dns configuration (#32)
  • Loading branch information
kouzant authored Nov 23, 2021
1 parent 38e66b8 commit f4813a6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,10 @@
group 'root'
code <<-EOH
set -e
cp /etc/resolv.conf /etc/resolv.conf.bak
rm -f /etc/resolv.conf
echo "nameserver #{my_ip}" > /etc/resolv.conf
chmod 644 /etc/resolv.conf
chattr +i /etc/resolv.conf
cp #{effective_resolv_conf} #{effective_resolv_conf}.bak
chattr -i #{effective_resolv_conf}
sed -i 's;^nameserver[[:space:]].*$;nameserver #{my_ip};g' #{effective_resolv_conf}
chattr +i #{effective_resolv_conf}
EOH
action :nothing
end
Expand Down

0 comments on commit f4813a6

Please sign in to comment.