Page MenuHomeVyOS Platform

vyos-1x: node.def generation always contains "type: txt"
Closed, ResolvedPublicBUG

Description

During implementation/test of T560 and T588 I noticed that this XML snipped

<interfaceDefinition>
  <node name="service">
    <children>
      <node name="dns">
        <children>
          <node name="forwarding" owner="${vyos_sbindir}/vyos-config-dns-forwarding.py">
            <properties>
              <help>DNS forwarding</help>
              <priority>918</priority>
            </properties>
            <children>
              <leafNode name="ignore-hosts-file">
                <properties>
                  <help>Do not use local /etc/hosts file in name resolution</help>
                </properties>
              </leafNode>
              ...
              <leafNode name="system">
                <properties>
                  <help>DNS forwarding to system nameservers</help>
                </properties>
              </leafNode>
            </children>
          </node>
        </children>
      </node>
    </children>
  </node>
</interfaceDefinition>

Produces the following output files:

# cat templates/service/dns/forwarding/system/node.def
type: txt
help: DNS forwarding to system nameservers

# cat templates/service/dns/forwarding/ignore-hosts-file/node.def
type: txt
help: Do not use local /etc/hosts file in name resolution

Which is not correct, as those nodes always require a specific value. Previous VyOS 1.2.x and 1.1.8 version only used the following content in those files:

# cat templates/service/dns/forwarding/system/node.def
help: DNS forwarding to system nameservers

# cat templates/service/dns/forwarding/ignore-hosts-file/node.def
help: Do not use local /etc/hosts file in name resolution

@dmbaturin I feel that this is something for you as you have all the details in your head.

A bloody workaround is:

Makefile:
       # Workaround for special nodes that should not have "type: txt"
       sed -i '/^type: txt/d' $(TMPL_DIR)/service/dns/forwarding/listen-on/node.def
       sed -i '/^type: txt/d' $(TMPL_DIR)/service/dns/forwarding/system/node.def

Details

Difficulty level
Normal (likely a few hours)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

Sorry it took me so long to react to!

Omission of the type option is very much intentional. I've reverted your changes, fixed the logic for generating the type option when it's needed (always to txt:), and redone the XML definitions the way I always intended.

Support for the intended way was there already, and I touched this subject in the blog, but I suppose I'll make a detailed blog post about the motivation for it and the new approach.

I just tested the latest vyos-1x package commit 860b229.

A lot of node.def files now contain type: txt again which don't support this b/c those nodes have no attribute at all.

Examples:

  • service ssh allow-root
  • system ntp server 0.de.pool.ntp.org dynamic
  • system dns forwarding ignore-hosts-file
  • system dns forwarding system

This breaks current running Configs

dmbaturin claimed this task.

Seems to be fine now.