Repository showing simple use case for using Packer to build an image with Chef Infra Client cookbook provisioning and Chef Inspec testing.
├── cookbooks
│ └── packer_build_nginx
│ └── ssh_hardening
│ └── ssh-hardening(vendor cookbook)
├── templates
│ └── ubuntu_20-04_nginx.pkr.hcl
└── test
└── packer_check_nginx
└── ssh_baseline
Build an image from this repository with Packer:
packer build templates
Packer template files are located under the templates
directory within this repository. These files assume usage of AWS for building an AMI image and expect input of an AWS_PROFILE
variable for authentication.
Example build passing the AWS_PROFILE
attribute inline:
PKR_VAR_AWS_PROFILE='some-profile-name' packer build templates
The Packer template files in this repository use Chef Infra Client cookbooks for configuration provisioning of the images. Cookbooks which are used by this build are referenced in chef-solo
provisioner
configurations within template files and are stored locally under the cookbooks
directory in this repository.
The Packer template files in this repository use Chef Inspec profiles for validation images before creation. Profiles which are used by this build are referenced in inspec
provisioner
configurations within template files and are stored locally under the test
directory in this repository.