diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f3a28..fc1a598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,13 @@ tf_chef_compliance CHANGELOG This file is used to list changes made in each version of the tf_chef_compliance Terraform plan. -v0.1.3 (2016-04-25) +v0.1.4 (2016-05-25) +------------------- +- [Brian Menges] - Correct [CHANGELOG.md](CHANGELOG.md) +- [Brian Menges] - Update `accept_license` variable type, handling and documentation +- [Brian Menges] - Add `"accept_license": "${license}",` to [attributes-json.tpl](files/attributes-json.tpl) + +v0.1.3 (2016-05-25) ------------------- - [Brian Menges] - Spruce up [CONTRIBUTING.md](CONTRIBUTING.md) diff --git a/README.md b/README.md index c740df0..aafc6fd 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Create a local `terraform.tfvars` and populate with override values for variable ### tf_chef_compliance variables -* `accept_license`: Set to `1` to accept the [Chef MLSA License Agreement](https://downloads.chef.io/compliance/1.1.9/ubuntu/14.04/license.html). Default `0` +* `accept_license`: [Chef MLSA license](https://www.chef.io/online-master-agreement) agreement. Default: `false`; change to `true` to indicate agreement * `allowed_cidrs`: The comma seperated list of addresses in CIDR format to allow SSH access. Default: `0.0.0.0/0` * `chef_fqdn`: DNS address of the Chef Server * `chef_org`: Chef organization to join to diff --git a/files/attributes-json.tpl b/files/attributes-json.tpl index 9e50835..4df95b0 100644 --- a/files/attributes-json.tpl +++ b/files/attributes-json.tpl @@ -1,6 +1,7 @@ { "fqdn": "${host}.${domain}", "chef-compliance": { + "accept_license": "${license}", "configuration": { "compliance_fqdn": "${host}.${domain}", "ssl": { diff --git a/main.tf b/main.tf index e981f50..9fac26d 100644 --- a/main.tf +++ b/main.tf @@ -59,6 +59,7 @@ resource "template_file" "attributes-json" { cert_key = "/var/opt/chef-compliance/ssl/${var.hostname}.${var.domain}.key" domain = "${var.domain}" host = "${var.hostname}" + license = "${var.accept_license}" } } # @@ -79,13 +80,6 @@ resource "null_resource" "compliance-prep" { private_key = "${var.aws_private_key_file}" host = "${var.chef_fqdn}" } - # Check if we're accepting the license - provisioner "local-exec" { - command = <<-EOC - [ ${var.accept_license} -eq 1 ] && echo 'Chef MLSA License ACCEPTED' || echo 'Chef MLSA License NOT ACCEPTED' - [ ${var.accept_license} -eq 1 ] && exit 0 || exit 1 - EOC - } # Push in some cookbooks provisioner "remote-exec" { script = "${path.module}/files/chef-cookbooks.sh" diff --git a/variables.tf b/variables.tf index bbf1acf..df15bbc 100644 --- a/variables.tf +++ b/variables.tf @@ -104,7 +104,7 @@ variable "ami_usermap" { # variable "accept_license" { description = "Accept the Chef Compliance license agreement: https://downloads.chef.io/compliance/1.1.9/ubuntu/14.04/license.html" - default = 0 + default = true } variable "allowed_cidrs" { description = "List of CIDRs to allow SSH from (CSV list allowed)"