Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cookbooks/aws-parallelcluster-platform/files/ami_cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

IS_OFFICIAL_AMI_BUILD=${1:-"false"}

# clean up cloud init artifacts https://cloudinit.readthedocs.io/en/latest/topics/cli.html#clean
cloud-init clean -s

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

# Clean resolv.conf if it's not managed by system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please align this comment to the current strategy and put a short explanation, so that we will not forget i future?

if [ ! -L "/etc/resolv.conf" ]; then
sed -i '/^nameserver/d' /etc/resolv.conf
if [ "${IS_OFFICIAL_AMI_BUILD}" == "true" ]; then
echo "Clean resolv.conf for official AMIs"
echo -n > /etc/resolv.conf
rm -f /run/systemd/resolve/resolv.conf
fi

find /var/log -type f -exec /bin/rm -v {} \;
Expand Down
Loading