@@ -28,13 +28,15 @@ variable "control_ip_addresses" {
28
28
type = map (string )
29
29
description = <<- EOT
30
30
Mapping of fixed IP addresses for control node, keyed by network name.
31
- The default means the cloud will select an address.
31
+ For any networks not specified here the cloud will select an address.
32
+
33
+ NB: Changing IP addresses after deployment may hit terraform provider bugs.
32
34
EOT
33
35
default = {}
34
36
validation {
35
37
# check all keys are network names in cluster_networks
36
- condition = length (setsubtract (keys (var. control_ip_addresses ), [ for n in var . cluster_networks : n . network ] )) == 0
37
- error_message = " keys in var.control_ip_addresses must match network names in var.cluster_networks"
38
+ condition = length (setsubtract (keys (var. control_ip_addresses ), var. cluster_networks [ * ] . network )) == 0
39
+ error_message = " Keys in var.control_ip_addresses must match network names in var.cluster_networks"
38
40
}
39
41
}
40
42
@@ -44,39 +46,45 @@ variable "control_node_flavor" {
44
46
}
45
47
46
48
variable "login" {
47
- type = any
48
- description = <<- EOF
49
- Mapping defining homogenous groups of login nodes. Multiple groups may
50
- be useful for e.g. separating nodes for ssh and Open Ondemand usage, or
51
- to define login nodes with different capabilities such as high-memory.
49
+ default = {}
50
+ description = <<- EOF
51
+ Mapping defining homogenous groups of login nodes. Multiple groups may
52
+ be useful for e.g. separating nodes for ssh and Open Ondemand usage, or
53
+ to define login nodes with different capabilities such as high-memory.
52
54
53
- Keys are names of groups.
54
- Values are a mapping as follows:
55
+ Keys are names of groups.
56
+ Values are a mapping as follows:
57
+
58
+ Required:
59
+ nodes: List of node names
60
+ flavor: String flavor name
61
+ Optional:
62
+ image_id: Overrides variable cluster_image_id
63
+ extra_networks: List of mappings in same format as cluster_networks
64
+ vnic_types: Overrides variable vnic_types
65
+ volume_backed_instances: Overrides variable volume_backed_instances
66
+ root_volume_size: Overrides variable root_volume_size
67
+ extra_volumes: Mapping defining additional volumes to create and attach
68
+ Keys are unique volume name.
69
+ Values are a mapping with:
70
+ size: Size of volume in GB
71
+ **NB**: The order in /dev is not guaranteed to match the mapping
72
+ fip_addresses: List of addresses of floating IPs to associate with
73
+ nodes, in the same order as nodes parameter. The
74
+ floating IPs must already be allocated to the project.
75
+ fip_network: Name of network containing ports to attach FIPs to. Only
76
+ required if multiple networks are defined.
77
+ ip_addresses: Mapping of list of fixed IP addresses for nodes, keyed
78
+ by network name, in same order as nodes parameter.
79
+ For any networks not specified here the cloud will
80
+ select addresses.
81
+ match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
82
+ availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
83
+ gateway_ip: Address to add default route via
84
+ nodename_template: Overrides variable cluster_nodename_template
85
+ EOF
55
86
56
- Required:
57
- nodes: List of node names
58
- flavor: String flavor name
59
- Optional:
60
- image_id: Overrides variable cluster_image_id
61
- extra_networks: List of mappings in same format as cluster_networks
62
- vnic_types: Overrides variable vnic_types
63
- volume_backed_instances: Overrides variable volume_backed_instances
64
- root_volume_size: Overrides variable root_volume_size
65
- extra_volumes: Mapping defining additional volumes to create and attach
66
- Keys are unique volume name.
67
- Values are a mapping with:
68
- size: Size of volume in GB
69
- **NB**: The order in /dev is not guaranteed to match the mapping
70
- fip_addresses: List of addresses of floating IPs to associate with nodes,
71
- in the same order as nodes parameter. The floating IPs
72
- must already be allocated to the project.
73
- fip_network: Name of network containing ports to attach FIPs to. Only
74
- required if multiple networks are defined.
75
- match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
76
- availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
77
- gateway_ip: Address to add default route via
78
- nodename_template: Overrides variable cluster_nodename_template
79
- EOF
87
+ type = any
80
88
}
81
89
82
90
variable "cluster_image_id" {
@@ -85,7 +93,7 @@ variable "cluster_image_id" {
85
93
}
86
94
87
95
variable "compute" {
88
-
96
+ default = {}
89
97
description = <<- EOF
90
98
Mapping defining homogenous groups of compute nodes. Groups are used
91
99
in Slurm partition definitions.
@@ -109,12 +117,16 @@ variable "compute" {
109
117
Values are a mapping with:
110
118
size: Size of volume in GB
111
119
**NB**: The order in /dev is not guaranteed to match the mapping
120
+ ip_addresses: Mapping of list of fixed IP addresses for nodes, keyed
121
+ by network name, in same order as nodes parameter.
122
+ For any networks not specified here the cloud will
123
+ select addresses.
112
124
match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
113
125
availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
114
126
gateway_ip: Address to add default route via
115
127
nodename_template: Overrides variable cluster_nodename_template
116
128
EOF
117
- default = {}
129
+
118
130
type = any # can't do any better; TF type constraints can't cope with heterogeneous inner mappings
119
131
}
120
132
0 commit comments