Skip to content

Commit

Permalink
Merge pull request #14 from mengesb/accept_license
Browse files Browse the repository at this point in the history
Updates to accept_license variable
  • Loading branch information
mengesb committed May 26, 2016
2 parents 551b15d + 111651e commit 9235366
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions files/attributes-json.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"fqdn": "${host}.${domain}",
"chef-compliance": {
"accept_license": "${license}",
"configuration": {
"compliance_fqdn": "${host}.${domain}",
"ssl": {
Expand Down
8 changes: 1 addition & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
}
#
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit 9235366

Please sign in to comment.