Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 391  / 2 Years ago, sun, may 29, 2022, 11:53:48

I need help understanding the order in which the netplan config files are applied and, if possible, how to set a fallback config.


Scenario:



  • Let's say I have two config files, A and B.

  • Config files A and B both set the same ethernet interfaces in
    different ways. (different auth methods...)

  • Config A file name is : 01-config.yaml

  • Config B file name is : 99-config.yaml


Question:



  1. Which config file will be applied?

  2. Would config B work as a fallback if config A didn't work? Or the other way around? Or neither?

  3. I want to set a fallback config file in case the existing one(A) fails. Is that possible?


Thanks ?


More From » networking

 Answers
0

A and B are not "separate" configs -- they are the building blocks of a single config.


They are cumulative. Example:


01-File:           02-File:
XYZ XYZ
Foo: True Bar: [1,2,3]

Final config:
XYZ
Foo: True
Bar: [1,2,3]

The order of the files (01-99) is important when you have conflicting settings. Earlier settings are overwritten by later. This offers you the opportunity to override settings by placing a new file instead of editing the current files (much better for automated changes). Example:


01-File:           02-File:             03-File:
XYZ XYZ XYZ
Foo: True Bar: [1,2,3] Baz: Blue
Baz: Green Foo: False

Final config:
XYZ
Foo: False
Bar: [1,2,3]
Baz: Blue

[#102] Sunday, May 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mugustered

Total Points: 193
Total Questions: 123
Total Answers: 108

Location: Bermuda
Member since Wed, Mar 22, 2023
1 Year ago
mugustered questions
;