Skip to content

Instantly share code, notes, and snippets.

@bethdehart
Last active May 6, 2019 21:18
Show Gist options
  • Save bethdehart/c27bcb09cc2caffdb2e7f280594fec7c to your computer and use it in GitHub Desktop.
Save bethdehart/c27bcb09cc2caffdb2e7f280594fec7c to your computer and use it in GitHub Desktop.
Kitchen template
---
driver:
# Global AWS Settings
# Configuring the compute instance that is used for isolated testing.
name: ec2
# The shared_credentials_profile points to the specific profile.
shared_credentials_profile: changeme_
# Configuring the compute instance provided by the driver.
provisioner:
# chef_solo or chef_zero
name: chef_zero
# which package to install chef || chefdk
product_name: chef
# Version of Chef to use.
product_version: 12.9.41
# Chef data bags location.
data_bags_path: '../data_bags'
# Chef encrypted data bags secret location.
encrypted_data_bag_secret_key_path: '../data_bags/changeme_'
# Chef environment location.
environments_path: '../environments'
# Chef roles location.
roles_path: '../roles'
client_rb:
# requires a corresponding file in environments_path
environment: changeme_
# verifier tests the configuration applied by the provisioner.
verifier:
name: inspec
# Specifies which transport to use when executing commands remotely on the test instance.
transport:
name: rsync
# This will be based on the AWS account your going to use.
ssh_key: changeme_
# Enumerate platforms
# A platform represents a single configuration of an operating system
# While this is often 1:1, the names allow this to be customizable
# At least 1 platform is **required**
platforms:
- name: centos-7.4
driver:
# Overides the global AWS Settings specified in this platform.
# ami-0ebdd976 => Centos 7 1901_01 (us-west-2)
image_id: changeme_
suites:
- name: changeme_
driver:
# (Required) The aws_ssh_key_id value is the name of the AWS key pair you want to use.
aws_ssh_key_id: changeme_
# (Required) An Array of EC2 security groups which will be applied to the instance.
security_group_ids: ["sg-changeme_", "sg-changeme_"]
# (Required) The AWS region to use.
region: changeme_
# (Required) The EC2 subnet to use.
subnet_id: subnet-changeme_
# (Optional) Force allocation of a public IP and associate it with the launched instance.
associate_public_ip: false
# (Required) The EC2 instance type (also known as size) to use.
instance_type: t2.small
# (Optional) EC2 IAM profile name to use.
# iam_profile_name:
# (Optional) EBS volume
block_device_mappings:
- device_name: /dev/sda1
ebs:
volume_size: 8
delete_on_termination: true
# (Optional) The Hash of EC2 tag name/value pairs which will be applied to the instance.
tags: {
"Name": "changeme_",
"created-by": "test-kitchen"
}
# Chef run-list
run_list:
recipe[changeme_]
role[changeme_]
# (Optional) for running tests on the converged EC2 server.
verifier:
inspec_tests:
# - test/integration/default
# (Optional) Chef node attributes
attributes:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment