Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Stateless Address Autoconfiguration (SLAAC), Stateful DHCPv6, and Stateless DHCPv6 on a subnet. #193

Conversation

stone
Copy link
Contributor

@stone stone commented Dec 12, 2017

Adds support for Stateless Address Autoconfiguration (SLAAC), Stateful DHCPv6, and Stateless DHCPv6 on a subnet.

resource "openstack_networking_subnet_v2" "subnet_ipv6" {
  name                = "terraform-subnet-ipv6"
  network_id          = "${openstack_networking_network_v2.network.id}"
  cidr                = "ffff:c0:1f0:1002::/64"
  ipv6_address_mode   = "slaac"
  ipv6_ra_mode        = "slaac"
  ip_version          = 6
  enable_dhcp         = "true"
  gateway_ip          = "ffff:c0:1f0:1002::1"
}

…l DHCPv6, and Stateless DHCPv6 on a subnet.

    * ipv6_ra_mode : https://developer.openstack.org/api-ref/network/v2/index.html#create-subnet
    * ipv6_address_mode : https://developer.openstack.org/api-ref/network/v2/index.html#create-subnet

Example:

resource "openstack_networking_subnet_v2" "subnet_ipv6" {
  name                = "terraform-subnet-ipv6"
  network_id          = "${openstack_networking_network_v2.network.id}"
  cidr                = "ffff:c0:1f0:1002::/64"
  ipv6_address_mode   = "slaac"
  ipv6_ra_mode        = "slaac"
  ip_version          = 6
  enable_dhcp         = "true"
  gateway_ip          = "ffff:c0:1f0:1002::1"
}
@stone stone changed the title Openstack networking subnet v2 Support for Stateless Address Autoconfiguration (SLAAC), Stateful DHCPv6, and Stateless DHCPv6 on a subnet. Dec 12, 2017
Copy link
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stone Looks good. I left one comment with regard to the validation function. Let me know if you have any questions.

@@ -235,3 +259,12 @@ func dataSourceNetworkingSubnetV2Read(d *schema.ResourceData, meta interface{})

return nil
}

func dataSourceSubnetV2IPv6AddessMode(v interface{}, k string) (ws []string, errors []error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about renaming this to validateSubnetV2IPv6Mode and move it to the utils.go file? That way both the data source and the resource can use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks! Forgot about the validating function in resource.. New commit pushed to PR.

@jtopjian
Copy link
Contributor

Looks good! Thank you :)

@jtopjian jtopjian merged commit 74e9770 into terraform-provider-openstack:master Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants