From d12945606ffd3b73afc4ac290dc225e0c9dc74a1 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 1 Mar 2023 07:42:30 +0100 Subject: [PATCH 1/2] make metal-core hostname configurable --- partition/roles/metal-core/README.md | 3 ++- partition/roles/metal-core/templates/metal-core-env.j2 | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/partition/roles/metal-core/README.md b/partition/roles/metal-core/README.md index 7a8772b8..4efbe7cc 100644 --- a/partition/roles/metal-core/README.md +++ b/partition/roles/metal-core/README.md @@ -11,9 +11,10 @@ This role uses variables from [partition-defaults](/partition). So, make sure yo You can look up all the default values of this role [here](defaults/main/main.yaml). | Name | Mandatory | Description | -| ----------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|-------------------------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | metal_core_image_name | yes | Image name of metal-core | | metal_core_image_tag | yes | Image tag of metal-core | +| metal_core_hostname | | If given use this value instead of os.Hostname because the later takes a while after the switch was installed | | metal_core_cidr | | | | metal_core_dhcp_servers | | List of dhcp relay server ip addresses | | metal_core_log_level | | The metal-core log level | diff --git a/partition/roles/metal-core/templates/metal-core-env.j2 b/partition/roles/metal-core/templates/metal-core-env.j2 index 59fc11f0..13360e76 100644 --- a/partition/roles/metal-core/templates/metal-core-env.j2 +++ b/partition/roles/metal-core/templates/metal-core-env.j2 @@ -4,6 +4,9 @@ METAL_CORE_LOOPBACK_IP: "{{ lo }}" METAL_CORE_ASN: "{{ asn }}" METAL_CORE_CIDR: "{{ metal_core_cidr }}" +{% metal_core_hostname is defined %} +METAL_CORE_HOSTNAME: "{{ metal_core_hostname }}" +{% endif %} {% if metal_core_dhcp_servers is defined %} METAL_CORE_DHCP_SERVERS: "{{ metal_core_dhcp_servers | join(',') }}" {% endif %} From 292f5c03acfc650e3b8678c8906f9f53e3123df3 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Tue, 14 Mar 2023 10:05:37 +0100 Subject: [PATCH 2/2] Is required --- partition/roles/metal-core/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partition/roles/metal-core/README.md b/partition/roles/metal-core/README.md index 4efbe7cc..c822ab06 100644 --- a/partition/roles/metal-core/README.md +++ b/partition/roles/metal-core/README.md @@ -15,7 +15,7 @@ You can look up all the default values of this role [here](defaults/main/main.ya | metal_core_image_name | yes | Image name of metal-core | | metal_core_image_tag | yes | Image tag of metal-core | | metal_core_hostname | | If given use this value instead of os.Hostname because the later takes a while after the switch was installed | -| metal_core_cidr | | | +| metal_core_cidr | yes | | | metal_core_dhcp_servers | | List of dhcp relay server ip addresses | | metal_core_log_level | | The metal-core log level | | metal_core_rack_id | yes | The rack id describing the rack in which the leaf switches are contained. Can be a logical rack name and is used by the metal-api to identify the switch pair |