solar/bootstrap/playbooks/centos/files/minimize.sh
Bogdan Dobrelya 467d84c620 Add centos7 docker support
* Separate OSTYPE specific tasks/files.
* Keep only common tasks and files in the
playbooks dir.

TODO pxe case to be working for centos as well
note, the cmtools.sh installs ansible 2.0.1.0
  in centos7, while we have 2.0.0.2 for ubuntu trusty
note, the base.yaml installs python-keystoneclient
  1:1.3.0-1.el7 from kilo-2 (no juno for centos7),
  while for ubuntu we have one from juno
note, there is no pygraphviz for centos7, see also
  https://bugs.launchpad.net/fuel/+bug/1510884

Closes-bug: #1548851

Change-Id: Icec5637f9242104322d1104725f9f132d1ca16f0
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
2016-03-02 11:16:23 +01:00

36 lines
1.3 KiB
Bash

#!/bin/bash -eux
# TODO(bogdando) add centos7 support
exit 0
echo "==> Installed packages before cleanup"
dpkg --get-selections | grep -v deinstall
# Remove some packages to get a minimal install
echo "==> Removing all linux kernels except the currrent one"
dpkg --list | awk '{ print $2 }' | grep 'linux-image-3.*-generic' | grep -v $(uname -r) | xargs apt-get -y purge
echo "==> Removing linux source"
dpkg --list | awk '{ print $2 }' | grep linux-source | xargs apt-get -y purge
echo "==> Removing documentation"
dpkg --list | awk '{ print $2 }' | grep -- '-doc$' | xargs apt-get -y purge
echo "==> Removing obsolete networking components"
apt-get -y purge ppp pppconfig pppoeconf
echo "==> Removing other oddities"
apt-get -y purge popularity-contest installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
# Clean up the apt cache
apt-get -y autoremove --purge
apt-get -y autoclean
apt-get -y clean
echo "==> Removing man pages"
rm -rf /usr/share/man/*
echo "==> Removing anything in /usr/src but this kernel src"
p2=$(uname -r | cut -d- -f1-2)
mv "/usr/src/linux-headers-${p2}" /tmp
mv /usr/src/linux-headers-$(uname -r) /tmp
rm -rf /usr/src/*
mv "/tmp/linux-headers-${p2}" /usr/src/
mv /tmp/linux-headers-$(uname -r) /usr/src/
echo "==> Removing any docs"
rm -rf /usr/share/doc/*