diff --git a/cookbooks/aws-parallelcluster-platform/files/ami_cleanup.sh b/cookbooks/aws-parallelcluster-platform/files/ami_cleanup.sh index 2943b51f38..bb14fa8e53 100644 --- a/cookbooks/aws-parallelcluster-platform/files/ami_cleanup.sh +++ b/cookbooks/aws-parallelcluster-platform/files/ami_cleanup.sh @@ -20,5 +20,10 @@ if [ "${ID}${VERSION_ID}" == "centos7" ]; then rm -f /etc/sysconfig/network-scripts/ifcfg-eth0 fi +# Clean resolv.conf if it's not managed by system +if [ ! -L "/etc/resolv.conf" ]; then + sed -i '/^nameserver/d' /etc/resolv.conf +fi + find /var/log -type f -exec /bin/rm -v {} \; touch /var/log/lastlog