mengesb / tf_chef_server

Chef server module for Terraform
Apache License 2.0
13 stars 20 forks source link

tf_chef_server

Terraform module to setup a Chef Server in standalone mode. Nothing spectacular here and a very simple implementation. Once this is up and running, recommend you use Chef to configure your Chef Server to suit your needs.

Assumptions

Usage

Module

In your terraform plan:

module "module_name_here" {
  source = "github.com/mengesb/tf_chef_server"
  aws = {
    access_key = "AWS_ACCESS_KEY_ID"
    secret_key = "AWS_SECRET_ACCESS_KEY"
  }
  aws_network = {
    subnet = "AWS_SUBNET_ID"
    vpc    = "AWS_VPC_ID"
  }
  chef_license = "true"
  chef_ssl = {
    cert = "SSL_CERTIFICATE"
    key  = "SSL_CERTIFICATE_KEY"
  }
  instance_key = {
    file = "AWS_INSTANCE_SSH_KEY_FILE"
    name = "AWS_INSTANCE_KEY_NAME"
  }
}

Directly

  1. Clone this repo: git clone https://github.com/mengesb/tf_chef_server.git
  2. Make a local terraform.tfvars file: cp terraform.tfvars.example terraform.tfvars
  3. Edit terraform.tfvars with your editor of choice, ensuring accept_license is set to true
  4. Test the plan: terraform plan
  5. Apply the plan: terraform apply

Supported OSes

All supported OSes are 64-bit and HVM (though PV should be supported)

AWS

These resources will incur charges on your AWS bill. It is your responsibility to delete the resources.

Input variables

AWS variables

AWS instance settings

tf_chef_server variables

AMI map variables

The below mapping variables construct selection criteria

The ami_map is a combination of ami_os and aws_region which declares the AMI selected. To override this pre-declared AMI, define

ami_map.<ami_os>-<aws_region> = "value"

Variable ami_os should be one of the following:

Variable aws_region should be one of the following:

Map ami_usermap uses ami_os to look the default username for interracting with the instance. To override this pre-declared user, define

ami_usermap.<ami_os> = "value"

Outputs

Contributors

Runtime sample

You can view a runtime output sample here: tf_chef_server-runtime.txt

Contributing

Please understand that this is a work in progress and is subject to change rapidly. Be sure to keep up to date with the repo should you fork, and feel free to contact me regarding development and suggested direction. Familiarize yoursef with the contributing before making/submitting changes.

CHANGELOG

Please refer to the CHANGELOG.md

License

This is licensed under the Apache 2.0 license.