A large refactor of packer templates

- .gitignore added to remove packer_cache from index
- Documentation has been added with detailed explanation how to build
  the image, what was changed
- A structure change:
  * A new structure has one directory for ubuntu, debian. This allows to
    remove code duplication in bash scripts. Later, template for centos
    can be easily incorporated.
  * script directry contains post-processor scripts for all
    distributives
  * scripts/debian directory contains only changes specifig to Debian
    family (Debian, Ubuntu)
- packer templates
  * Code has been separated from variables.
  * virtualbox builder has been added

Change-Id: If96d86cead153019dddcffe2256b2d5ab9b41adf
Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
This commit is contained in:
Sergii Golovatiuk
2016-07-28 03:36:48 +02:00
parent f924ed9b5b
commit c354cb8673
26 changed files with 1599 additions and 452 deletions

67
doc/PACKER.md Normal file
View File

@@ -0,0 +1,67 @@
# [Packer](https://www.packer.io) Templates
The most of settings are specified as variables. This allows to override them
with `-var` key without template modification. A few environment variables
should be specified as a safety measure. See `debian.json` `ubuntu.json` with
the post-processors section with all details about deploying the Vagrant Boxes
to Atlas.
## Custom builds
### Ubuntu build
```sh
UBUNTU_MAJOR_VERSION=16.04 \
UBUNTU_MINOR_VERSION=.1 \
UBUNTU_TYPE=server \
ARCH=amd64 \
HEADLESS=true \
packer build -var 'cpus=2' ubuntu.json
```
### Debian build
```sh
DEBIAN_MAJOR_VERSION=8 \
DEBIAN_MINOR_VERSION=5 \
ARCH=amd64 \
HEADLESS=true \
packer build -var 'cpus=2' debian.json
```
## Login Credentials
(root password is "vagrant" or is not set )
* Username: vagrant
* Password: vagrant
SSH_USER may be used to create a different user whci may be used later to
access environment.
## VM Specifications
* Vagrant Libvirt Provider
* Vagrant Virtualbox Provider
### qemu
* VirtIO dynamic Hard Disk (up to 10 GiB)
#### Customized installation
Debian configuration is based on
[jessie preseed](https://www.debian.org/releases/jessie/example-preseed.txt).
Ubuntu configuration is based on
[xenial preseed](https://help.ubuntu.com/lts/installation-guide/example-preseed.txt).
A few modifications have been made. Use `diff` for more details.
##### Debian/Ubuntu installation
* en_US.UTF-8
* keymap for standard US keyboard
* UTC timezone
* NTP enabled (default configuration)
* full-upgrade
* unattended-upgrades
* /dev/vda1 mounted on / using ext4 filesystem (all files in one partition)
* no swap