Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
95 lines (57 sloc)
3.22 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Packer Image Builder for CentOS | |
## Introduction | |
In conjunction with the [ansible-playbooks](https://github.internet2.edu/docker/ansible-playbooks), these packer templates create the Shibboleth IdP, Grouper, and COmanage appliances for use by TIER members. These appliances are CentOS 7 with `.vmx` and `.ova` formats available. In addition, if your account has VMImport privileges on EC2, you can also create AMI for AWS purposes. You will need to have credentials setup according to [AWS credentials setup](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files) | |
## Requirements | |
The templates are only tested with [packer](http://www.packer.io/downloads.html) 0.10.1 and later. If you have homebrew installed, `brew install packer` is effective. | |
For local builds, you will need to provide a symbolic link to the `ansible-playbooks` directory for matching repo location. Make sure you have cloned and setup the [ansible-playbooks repo](https://github.internet2.edu/docker/ansible-playbooks). The `master` branch is acceptable for all developer test builds. | |
For Automated builds utilizing Jenkins, you will want to setup your build hosts on physical hardware, as how VirtualBox interacts with the host environment. | |
#### example | |
``` | |
ln -s /path/to/ansible-playbooks ansible-playbooks | |
``` | |
##### common parent | |
If you have ansible-playbooks checked out in the same parent directory as this repository, this command will work. | |
``` | |
ln -s ../ansible-playbooks ansible-playbooks | |
``` | |
### Pre-Requisites for AWS / AMI import | |
- IAM needs to be setup for the `vmimport` role per the [AWS guide](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/VMImportPrerequisites.html#vmimport-service-role). | |
- The bucket `internet2-ami-import-us-west-1` needs to be setup on AWS S3. (Alternatively, you can provide your own bucket name that you prefer.) | |
AMI build will require both `aws_access_key` and `aws_secret_key` to be setup with [AWS credentials setup](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files) | |
## Building | |
``` | |
packer build shibboleth-appliance.json | |
``` | |
If you encounter issues you don't understand, try this command: | |
``` | |
PACKER_LOG packer build shibboleth-appliance.json | |
``` | |
Expect the build to take 30-45 minutes. If you are in position to watch the VirtualBox window, it can verify that progress is continuing during some times that the process appears to have hung. | |
## Author | |
- Author:: Mason Packard (<mason.packard@levvel.io>) | |
## Appendix | |
The OS versions are: | |
- Centos 7 | |
For all operating systems we generate images for | |
- centos7.json will build: | |
- VirtualBox (user: packer/changeme1234) | |
- aws-centos7-base.json will build: | |
- AMI for AWS (user: centos/centos) | |
- sibboleth-appliance.json will build: | |
- VirtualBox (user: centos/centos) | |
This template only is tested against 64 bit systems. With the following sizing requirements: | |
``` | |
"profile": "xfs", | |
"disk_size": "20000", | |
"memory": "6122", | |
"cpus": "2", | |
``` | |
``` | |
"disk_size": 81920 | |
``` | |
## Post Processors | |
The final VM appliance formats will be uploaded into AWS infrastructure. The two compressed tarballs to S3 buckets and AMI to EC2. | |
- Compressed ova / ovf format | |
- Imported AWS AMI | |
# License | |
TBD | |