@@ -28,13 +28,15 @@ variable "control_ip_addresses" {
2828 type = map (string )
2929 description = <<- EOT
3030 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.
3234 EOT
3335 default = {}
3436 validation {
3537 # 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"
3840 }
3941}
4042
@@ -44,39 +46,45 @@ variable "control_node_flavor" {
4446}
4547
4648variable "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.
5254
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
5586
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
8088}
8189
8290variable "cluster_image_id" {
@@ -85,7 +93,7 @@ variable "cluster_image_id" {
8593}
8694
8795variable "compute" {
88-
96+ default = {}
8997 description = <<- EOF
9098 Mapping defining homogenous groups of compute nodes. Groups are used
9199 in Slurm partition definitions.
@@ -109,12 +117,16 @@ variable "compute" {
109117 Values are a mapping with:
110118 size: Size of volume in GB
111119 **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.
112124 match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
113125 availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
114126 gateway_ip: Address to add default route via
115127 nodename_template: Overrides variable cluster_nodename_template
116128 EOF
117- default = {}
129+
118130 type = any # can't do any better; TF type constraints can't cope with heterogeneous inner mappings
119131}
120132
0 commit comments