-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ionutbalutoiu/development
More managed resources, code improvements, and docs updated
- Loading branch information
Showing
51 changed files
with
2,991 additions
and
1,021 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# `maas_fabric` | ||
# Data Source: maas_fabric | ||
|
||
Get an existing MAAS fabric. | ||
Provides details about an existing MAAS network fabric. | ||
|
||
Example: | ||
## Example Usage | ||
|
||
```hcl | ||
```terraform | ||
data "maas_fabric" "default" { | ||
name = "maas" | ||
} | ||
``` | ||
|
||
Parameters: | ||
## Argument Reference | ||
|
||
| Name | Type | Required | Description | ||
| ---- | ---- | -------- | ----------- | ||
| `name` | `string` | `true` | The fabric name. | ||
The following arguments are supported: | ||
|
||
* `name` - (Required) The fabric name. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - The fabric ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
# `maas_subnet` | ||
# Data Source: maas_subnet | ||
|
||
Fetches details about an existing MAAS subnet. | ||
Provides details about an existing MAAS network subnet. | ||
|
||
Example: | ||
## Example Usage | ||
|
||
```hcl | ||
data "maas_fabric" "default" { | ||
name = "maas" | ||
```terraform | ||
data "maas_subnet" "vid10" { | ||
cidr = "10.10.0.0/16" | ||
} | ||
``` | ||
|
||
data "maas_vlan" "default" { | ||
fabric_id = data.maas_fabric.default.id | ||
vid = 0 | ||
} | ||
## Argument Reference | ||
|
||
data "maas_subnet" "pxe" { | ||
cidr = "10.121.0.0/16" | ||
vlan_id = data.maas_vlan.default.id | ||
} | ||
``` | ||
The following arguments are supported: | ||
|
||
* `cidr` - (Requried) The subnet CIDR. | ||
|
||
## Attributes Reference | ||
|
||
Parameters: | ||
In addition to all arguments above, the following attributes are exported: | ||
|
||
| Name | Type | Required | Description | ||
| ---- | ---- | -------- | ----------- | ||
| `cidr` | `string` | `true` | The network CIDR for this subnet. | ||
| `vlan_id` | `int` | `false` | The ID of the VLAN this subnet belongs to. This is the unique identifier set by MAAS for the VLAN resource, not the actual VLAN traffic segregation ID. | ||
* `id` - The subnet ID. | ||
* `fabric` - The subnet fabric. | ||
* `vid` - The subnet VLAN traffic segregation ID. | ||
* `name` - The subnet name. | ||
* `rdns_mode` - How reverse DNS is handled for this subnet. It can have one of the following values: | ||
* `0` - Disabled, no reverse zone is created. | ||
* `1` - Enabled, generate reverse zone. | ||
* `2` - RFC2317, extends `1` to create the necessary parent zone with the appropriate CNAME resource records for the network, if the network is small enough to require the support described in RFC2317. | ||
* `allow_dns` - Boolean value that indicates if the MAAS DNS resolution is enabled for this subnet. | ||
* `allow_proxy` - Boolean value that indicates if `maas-proxy` allows requests from this subnet. | ||
* `gateway_ip` - Gateway IP address for the subnet. | ||
* `dns_servers` - List of IP addresses set as DNS servers for the subnet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
# `maas_vlan` | ||
# Data Source: maas_vlan | ||
|
||
Get an existing MAAS VLAN. | ||
Provides details about an existing MAAS VLAN. | ||
|
||
Example: | ||
## Example Usage | ||
|
||
```hcl | ||
data "maas_fabric" "default" { | ||
name = "maas" | ||
} | ||
data "maas_vlan" "default" { | ||
fabric_id = data.maas_fabric.default.id | ||
vid = 0 | ||
```terraform | ||
data "maas_vlan" "vid10" { | ||
fabric = data.maas_fabric.default.id | ||
vlan = 10 | ||
} | ||
``` | ||
|
||
Parameters: | ||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `fabric` - (Required) The fabric identifier (ID or name) for the VLAN. | ||
* `vlan` - (Required) The VLAN identifier (ID or traffic segregation ID). | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
| Name | Type | Required | Description | ||
| ---- | ---- | -------- | ----------- | ||
| `fabric_id` | `int` | `true` | The ID of the fabric containing the VLAN. | ||
| `vid` | `int` | `true` | The VLAN traffic segregation ID. | ||
* `mtu` - The MTU used on the VLAN. | ||
* `dhcp_on` - Boolean value indicating if DHCP is enabled on the VLAN. | ||
* `name` - The VLAN name. | ||
* `space` - The VLAN space. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
# Resource: maas_block_device | ||
|
||
Provides a resource to manage MAAS machines' block devices. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "maas_block_device" "vdb" { | ||
machine = maas_machine.virsh_vm2.id | ||
name = "vdb" | ||
id_path = "/dev/vdb" | ||
size_gigabytes = 27 | ||
tags = [ | ||
"ssd", | ||
] | ||
partitions { | ||
size_gigabytes = 10 | ||
fs_type = "ext4" | ||
label = "media" | ||
mount_point = "/media" | ||
} | ||
partitions { | ||
size_gigabytes = 15 | ||
fs_type = "ext4" | ||
mount_point = "/storage" | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `machine` - (Required) The machine identifier (system ID, hostname, or FQDN) that owns the block device. | ||
* `name` - (Required) The block device name. | ||
* `size_gigabytes` - (Required) The size of the block device (given in GB). | ||
* `block_size` - (Optional) The block size of the block device. Defaults to `512`. | ||
* `is_boot_device` - (Optional) Boolean value indicating if the block device is set as the boot device. | ||
* `partitions` - (Optional) List of partition resources created for the new block device. Parameters defined below. This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html). And, it is computed if it's not given. | ||
* `model` - (Optional) Model of the block device. Used in conjunction with `serial` argument. Conflicts with `id_path`. This argument is computed if it's not given. | ||
* `serial` - (Optional) Serial number of the block device. Used in conjunction with `model` argument. Conflicts with `id_path`. This argument is computed if it's not given. | ||
* `id_path` - (Optional) Only used if `model` and `serial` cannot be provided. This should be a path that is fixed and doesn't change depending on the boot order or kernel version. This argument is computed if it's not given. | ||
* `tags` - (Optional) A set of tag names assigned to the new block device. This argument is computed if it's not given. | ||
|
||
### partitions | ||
|
||
* `size_gigabytes` - (Required) The partition size (given in GB). | ||
* `bootable` - (Optional) Boolean value indicating if the partition is set as bootable. | ||
* `tags` - (Optional) The tags assigned to the new block device partition. | ||
* `fs_type` - (Optional) The file system type (e.g. `ext4`). If this is not set, the partition is unformatted. | ||
* `label` - (Optional) The label assigned if the partition is formatted. | ||
* `mount_point` - (Optional) The mount point used. If this is not set, the partition is not mounted. This is used only the partition is formatted. | ||
* `mount_options` - (Optional) The options used for the partition mount. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - Block device ID. | ||
* `uuid` - Block device UUID. | ||
* `path` - Block device path. | ||
|
||
## Import | ||
|
||
Block devices can be imported with the machine identifier (system ID, hostname, or FQDN) and the block device identifier (ID or name). e.g. | ||
|
||
```shell | ||
terraform import maas_block_device.vdb machine-06:vdb | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
# Resource: maas_dns_domain | ||
|
||
Provides a resource to manage MAAS DNS domains. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "maas_dns_domain" "cloudbase" { | ||
name = "cloudbase" | ||
ttl = 3600 | ||
authoritative = true | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) The name of the new DNS domain. | ||
* `ttl` - (Optional) The default TTL for the new DNS domain. | ||
* `authoritative` - (Optional) Boolean value indicating if the new DNS domain is authoritative. Defaults to `false`. | ||
* `is_default` - (Optional) Boolean value indicating if the new DNS domain will be set as the default in the MAAS environment. Defaults to `false`. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - The DNS domain ID. | ||
|
||
## Import | ||
|
||
DNS domains can be imported using their ID or name. e.g. | ||
|
||
```shell | ||
terraform import maas_dns_domain.cloudbase cloudbase | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
# Resource: maas_dns_record | ||
|
||
Provides a resource to manage MAAS DNS domain records. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "maas_dns_record" "test_a" { | ||
type = "A/AAAA" | ||
data = "10.99.11.33" | ||
fqdn = "test-a.${maas_dns_domain.cloudbase.name}" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `type` - (Required) The DNS record type. Valid options are: `A/AAAA`, `CNAME`, `MX`, `NS`, `SRV`, `SSHFP`, `TXT`. | ||
* `data` - (Required) The data set for the new DNS record. | ||
* `name` - (Optional) The new DNS record resource name. Used in conjunction with `domain`. It conflicts with `fqdn` argument. | ||
* `domain` - (Optional) The domain of the new DNS record. Used in conjunction with `name`. It conflicts with `fqdn` argument. | ||
* `fqdn` - (Optional) The fully qualified domain name of the new DNS record. This contains the name and the domain of the new DNS record. It conflicts with `name` and `domain` arguments. | ||
* `ttl` - (Optional) The TTL of the new DNS record. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - The DNS record ID. | ||
|
||
## Import | ||
|
||
DNS records can be imported using the type and the identifier (ID or FQDN). e.g. | ||
|
||
```shell | ||
terraform import maas_dns_record.test_a A/AAAA:test-a.cloudbase | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
# Resource: maas_fabric | ||
|
||
Provides a resource to manage MAAS network fabrics. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "maas_fabric" "tf_fabric" { | ||
name = "tf-fabric" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) The fabric name. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - The fabric ID. | ||
|
||
## Import | ||
|
||
An existing network fabric can be imported using its name or ID. e.g. | ||
|
||
```shell | ||
terraform import maas_fabric.tf_fabric tf-fabric | ||
``` |
Oops, something went wrong.