Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 055cf2c4 authored by Pierre Neyron's avatar Pierre Neyron :bicyclist:
Browse files

Merge branch 'oobm-cname' into 'master'

Fix CNAME generation issue +  create CNAME for estats-N-bmc -> oobm

See merge request !517
parents 6407f6be 3a2c8c08
No related branches found
No related tags found
1 merge request!517Fix CNAME generation issue + create CNAME for estats-N-bmc -> oobm
Pipeline #854801 passed with warnings
{
"alias": [
"estats-bmc"
"estats-1-bmc",
"estats-2-bmc",
"estats-3-bmc",
"estats-4-bmc",
"estats-5-bmc",
"estats-6-bmc",
"estats-7-bmc",
"estats-8-bmc",
"estats-9-bmc",
"estats-10-bmc",
"estats-11-bmc",
"estats-12-bmc"
],
"kind": "physical",
"network_adapters": {
......
......@@ -42,7 +42,7 @@ srv-data:
oobm:
kind: physical
alias: [estats-bmc]
alias: [estats-1-bmc, estats-2-bmc, estats-3-bmc, estats-4-bmc, estats-5-bmc, estats-6-bmc, estats-7-bmc, estats-8-bmc, estats-9-bmc, estats-10-bmc, estats-11-bmc, estats-12-bmc]
network_adapters:
default:
ip: 172.17.121.1
......
......@@ -406,18 +406,18 @@ def sort_records(records)
sorted_records += ptr
#Sort CNAMES by node_id for node, node_id then kavlan number for node kavlan entry or finally by label
cnames.sort_by!{ |record|
sort_by = record.label
sort_by = [ record.label ]
label_array = record.label.split("-")
if label_array.length > 1 and label_array[1] !~ /\D/
sort_by = (record.label.match(/ipv6/).nil? ? [0] : [1]) # -ipv6 at end
if label_array.length > 1 and label_array[1] !~ /\D/ #only digit: must be something related to a node!
sort_by = [ label_array[0] ]
sort_by << (record.label.match(/ipv6/).nil? ? 0 : 1) # -ipv6 at end
sort_by << label_array.length # sort by record 'type'
sort_by << record.label.scan(/-(\d+)-?/).flatten.map{ |i| i.to_i} # sort by node then kavlan number
intf = record.label.scan(/((eth|en)\w+)-?/).flatten.first # detect intf
unless intf.nil?
sort_by << (record.label.match(/eth/).nil? ? [1] : [0]) # ethX first
sort_by << (record.label.match(/eth/).nil? ? 1 : 0) # ethX first
sort_by << intf.scan(/\d+/).reverse.map{ |i| i.to_i } # sort intf
end
sort_by.flatten!
end
sort_by
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment