arnisoph / saltstack-network-formula

Salt Stack Formula to set up and configure a host's network configuration
Other
13 stars 13 forks source link

Unable to add many IPs to single interface #8

Open morsik opened 9 years ago

morsik commented 9 years ago

This causes Conflicting ID 'network_lo' when I want to assign many addresses to loopback interface (or any other).

Example:

network:
  interfaces:
    - name: lo
      ipaddr: 127.1.1.1
      netmask: 255.255.255.255
    - name: lo
      ipaddr: 127.1.1.2
      netmask: 255.255.255.255
arnisoph commented 9 years ago

@morsik thanks for the bug report! Could you please test against the latest version?

morsik commented 9 years ago

Doesn't works. It doesn't raise error, but second IP overrides first IP in /etc/sysconfig/network-interfaces/ifcfg-<interface> :(

stolenmoment commented 8 years ago

Collaboration between this formula and the salt template is required; salt/templates/rh_ip/rh?_eth.jinja doesn't emit multiple IP addresses into the ifcfg-eth? scripts.

I'm working on changes to both this formula and the salt templates to allow multiples of both IPv4 and IPv6 addresses.

In the pillar, ipaddr becomes a list of {'ip_addr': '1.2.3.4', 'netmask': '255.0.0.0'} dictionaries and rh?_eth.jinja produces IPADDR[0123...]= and NETMASK[0123...]= lines from this. A singleton ipaddr is still supported to maintain back-compatibility.

Does this sound like a good approach to you?

morsik commented 8 years ago

Looks good to me.

arnisoph commented 8 years ago

:+1:

I will refactor the formula in a few months, but if you want to fix this issue, your PR is welcome.