Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting arbitrary options #10

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

chmduquesne
Copy link

This would solve #9.

Let me know if you are ok with this PR (in that case, integrate it). If you do not like it, I would just fork the role for my own use.

@tersmitten tersmitten added this to the 2.0.0 milestone Feb 28, 2018
@tersmitten
Copy link
Member

It looks like some option disappeared, am I right?

Can you describe if (or not) this is backwards compatible. Maybe using some examples?

@chmduquesne
Copy link
Author

This supports arbitrary options, but this is not backwards compatible in the sense that in some cases, one needs to rewrite their variables if they want to achieve the same effect. So for example,

dns_search:
  - 8.8.8.8
  - 8.8.4.4

Becomes:

dns-nameservers: "8.8.8.8 8.8.4.4"

The idea is that options that would appear in an iface section (as in below "iface eth0 inet dhcp") are named directly after the option. This allows to support arbitrary options that were not possible before, and that I needed. For example, I am using this on my server now (note the "request_prefix" option)

network_interfaces_interfaces:
  - device: enp0s20
    family: inet6
    method: dhcp
    request_prefix: 1
    up:
      - "ip addr add {{ inet6_address }}/{{ inet6_netmask }} dev $IFACE"

It all boils down to the lines 13-17 in templates/etc/network/interfaces.d/device.j2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants