Skip to content

Commit 168d588

Browse files
authored
Merge branch 'release-3.13' into release-3.13
2 parents b2215c9 + 1c425ba commit 168d588

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cookbooks/aws-parallelcluster-platform/files/ami_cleanup.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
IS_OFFICIAL_AMI_BUILD=${1:-"false"}
4+
35
# clean up cloud init artifacts https://cloudinit.readthedocs.io/en/latest/topics/cli.html#clean
46
cloud-init clean -s
57

@@ -21,8 +23,10 @@ if [ "${ID}${VERSION_ID}" == "centos7" ]; then
2123
fi
2224

2325
# Clean resolv.conf if it's not managed by system
24-
if [ ! -L "/etc/resolv.conf" ]; then
25-
sed -i '/^nameserver/d' /etc/resolv.conf
26+
if [ "${IS_OFFICIAL_AMI_BUILD}" == "true" ]; then
27+
echo "Clean resolv.conf for official AMIs"
28+
echo -n > /etc/resolv.conf
29+
rm -f /run/systemd/resolve/resolv.conf
2630
fi
2731

2832
find /var/log -type f -exec /bin/rm -v {} \;

0 commit comments

Comments
 (0)