We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b2215c9 + 1c425ba commit 168d588Copy full SHA for 168d588
cookbooks/aws-parallelcluster-platform/files/ami_cleanup.sh
@@ -1,5 +1,7 @@
1
#!/bin/bash
2
3
+IS_OFFICIAL_AMI_BUILD=${1:-"false"}
4
+
5
# clean up cloud init artifacts https://cloudinit.readthedocs.io/en/latest/topics/cli.html#clean
6
cloud-init clean -s
7
@@ -21,8 +23,10 @@ if [ "${ID}${VERSION_ID}" == "centos7" ]; then
21
23
fi
22
24
25
# Clean resolv.conf if it's not managed by system
-if [ ! -L "/etc/resolv.conf" ]; then
- 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
30
31
32
find /var/log -type f -exec /bin/rm -v {} \;
0 commit comments