PeterMosmans.compact-box
Ansible Role: compact-box
This role is used to make Linux distributions smaller and ready for tools like Vagrant. It keeps the locales you want and removes any unnecessary packages. You can set these preferences in the defaults/main.yml file.
By default, it will keep only the en_US locale and won't remove any packages.
Requirements
None.
Role Variables
Here are the variables you can use, along with their default values.
keep_locales: This is a list of locales that you want to keep. You can find the default list in defaults/main.yml. Example:
keep_locales:
- en_GB
- en_US
- i18n
- iso14651_t1
- iso14651_t1_common
unnecessary_packages: This is a list of packages that you want to remove. The default list is in defaults/main.yml. Example:
unnecessary_packages:
- build-essential
- bzip2
- dkms
- dpkg-dev
- gcc
- make
- task-laptop
Once the role has successfully run, it will copy a script to /usr/bin/compact_box.sh. This script will perform the final steps to compact the distribution before you turn it into a Vagrant box. If you run this script manually, it will shut down the box.
Dependencies
None.
Example Playbook
- hosts: all
become: yes
become_method: sudo
roles:
- role: PeterMosmans.compact-box
This example will compact a distribution.
License
GPLv3
Author Information
Created by Peter Mosmans.
Compacts a Linux distribution, preparing it for e.g. Vagrant boxing
ansible-galaxy install PeterMosmans.compact-box