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

Template does not allow multiple mentions of the same interface (e.g. for adding additional addresses) #14

Open
felixb opened this issue Oct 20, 2019 · 2 comments

Comments

@felixb
Copy link

felixb commented Oct 20, 2019

I configured the role like this based on hints from https://wiki.debian.org/NetworkConfiguration#Network_Interface_Names:

    network_interfaces_interfaces:
      - device: "{{ ansible_interfaces | select('match', '^en') | list | first }}"
        auto: true
        family: inet
        method: dhcp
      - device: "{{ ansible_interfaces | select('match', '^en') | list | first }}"
        auto: true
        family: inet
        method: static
        address: '192.168.178.4'

I'd expect an output like this:

# Ansible managed

auto enx001e06360900
iface enx001e06360900 inet dhcp

iface enx001e06360900 inet static
  address 192.168.178.4

Instead I got this (which destroys connectivity):

# Ansible managed

auto enx001e06360900
iface enx001e06360900 inet static
  address 192.168.178.4
@tersmitten
Copy link
Member

Is this even possible? An interface being inet dhcp and inet static. Can you point me to an example?

@felixb
Copy link
Author

felixb commented Mar 16, 2023

Yes it is.
The first IP would be managed by DHCP and a second IP is attached statically.

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

No branches or pull requests

2 participants