Skip to content

Commit 85ca404

Browse files
authored
Merge pull request #28 from unifio/kj-enable-variable-dhcp
Add enable flag for dhcp to conditionally add resources
2 parents fd3c29d + 8acdfed commit 85ca404

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#### Consider Implementing:
22
* ipv6 support
33

4+
## 0.3.3 (November 13, 2017)
5+
6+
#### IMPROVEMENTS / NEW FEATURES:
7+
* Add 'enable' flag for DHCP. Default is true. This allows for stacks to include these based on variable since at this time you cannot conditionally include modules.
8+
49
## 0.3.2 (May 16, 2017)
510

611
#### BACKWARDS INCOMPATIBILITIES / NOTES:

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
require 'rake'
22
require 'covalence/environment_tasks'
3-
require 'covalence/packer_tasks'
43
require 'covalence/spec_tasks'

dhcp/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ terraform {
77

88
## Provisions DHCP options
99
resource "aws_vpc_dhcp_options" "dhcp" {
10+
count = "${var.enable == "true" ? "1" : "0"}"
11+
1012
domain_name = "${var.domain_name}"
1113
domain_name_servers = ["${compact(var.name_servers)}"]
1214
netbios_name_servers = ["${compact(var.netbios_name_servers)}"]
@@ -21,6 +23,8 @@ resource "aws_vpc_dhcp_options" "dhcp" {
2123
}
2224

2325
resource "aws_vpc_dhcp_options_association" "dns_resolver" {
26+
count = "${var.enable == "true" ? "1" : "0"}"
27+
2428
dhcp_options_id = "${aws_vpc_dhcp_options.dhcp.id}"
2529
vpc_id = "${var.vpc_id}"
2630
}

dhcp/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variable "domain_name" {
2424
default = ""
2525
}
2626

27+
variable "enable" {
28+
type = "string"
29+
description = "Determine if resources should be added. Used if you want to include conditionally in a module."
30+
default = "true"
31+
}
32+
2733
variable "name_servers" {
2834
type = "list"
2935
description = "List of name servers to configure in '/etc/resolv.conf'"

0 commit comments

Comments
 (0)