Skip to content

Commit 71690cc

Browse files
committed
Add support for allocations
1 parent 10e4860 commit 71690cc

File tree

13,589 files changed

+8032875
-295427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

13,589 files changed

+8032875
-295427
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endif
1111
default: fmt lint build
1212

1313
build:
14-
go build -ldflags "${LDFLAGS}"
14+
go build -ldflags "${LDFLAGS}" -tags "${TAGS}"
1515

1616
install: default
1717
mkdir -p ${TERRAFORM_PLUGINS}
@@ -27,10 +27,10 @@ lint: tools
2727
go run golang.org/x/lint/golint -set_exit_status ./ironic .
2828

2929
test:
30-
go test -v ./ironic
30+
go test -tags "${TAGS}" -v ./ironic
3131

3232
acceptance:
33-
TF_ACC=true go test -v ./ironic/...
33+
TF_ACC=true go test -tags "acceptance" -v ./ironic/...
3434

3535
clean:
3636
rm -f terraform-provider-ironic

README.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,29 @@
44

55
This is a terraform provider that lets you provision baremetal servers managed by Ironic.
66

7-
# Usage
7+
## Provider
88

9-
Example:
9+
Currently the provider only supports standalone noauth Ironic. At a
10+
minimum, the Ironic endpoint URL must be specified. The user may also
11+
optionally specify an API microversion.
1012

1113
```terraform
1214
provider "ironic" {
13-
"url" = "http://localhost:6385/v1"
14-
"microversion" = "1.50"
15+
url = "http://localhost:6385/v1"
16+
microversion = "1.52"
1517
}
18+
```
19+
20+
## Resources
21+
22+
This provider currently implements a number of native Ironic resources,
23+
described below.
1624

25+
### Nodes
26+
27+
A node describes a hardware resource.
28+
29+
```terraform
1730
resource "ironic_node_v1" "openshift-master-0" {
1831
name = "openshift-master-0"
1932
target_provision_state = "active"
@@ -50,6 +63,43 @@ resource "ironic_node_v1" "openshift-master-0" {
5063
}
5164
```
5265

66+
## Ports
67+
68+
Ports may be specified as part of the node resource, or as a separate `ironic_port_v1`
69+
declaration.
70+
71+
```terraform
72+
resource "ironic_port_v1" "openshift-master-0-port-0" {
73+
node_uuid = "${ironic_node_v1.openshift-master-0.id}"
74+
pxe_enabled = true
75+
address = "00:bb:4a:d0:5e:38"
76+
}
77+
```
78+
79+
## Allocation
80+
81+
The Allocation resource represents a request to find and allocate a Node
82+
for deployment. The microversion must be 1.52 or later.
83+
84+
```terraform
85+
resource "ironic_allocation_v1" "openshift-master-allocation" {
86+
name = "master-${count.index}"
87+
count = 3
88+
89+
resource_class = "baremetal"
90+
91+
candidates = [
92+
"${ironic_node_v1.openshift-master-0.id}",
93+
"${ironic_node_v1.openshift-master-1.id}",
94+
"${ironic_node_v1.openshift-master-2.id}",
95+
]
96+
97+
traits = [
98+
"CUSTOM_FOO",
99+
]
100+
}
101+
```
102+
53103
# License
54104

55105
Apache 2.0, See LICENSE file

0 commit comments

Comments
 (0)