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

network.managed doesn't work on CentOS 7 #43348

Closed
9maf4you opened this issue Sep 5, 2017 · 2 comments
Closed

network.managed doesn't work on CentOS 7 #43348

9maf4you opened this issue Sep 5, 2017 · 2 comments
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix
Milestone

Comments

@9maf4you
Copy link

9maf4you commented Sep 5, 2017

Description of Issue/Question

Hello!
I'm trying to assign a range of ip-addresses on a single interface on my CentOS Linux 7 system like this :

lo:
  network.managed:
    - name: lo
    - enabled: True
    - type: eth
    - ipaddr_start: X.X.X.16
    - ipaddr_end: X.X.X.19

and like this:

lo:
  network.managed:
    - name: lo
    - enabled: True
    - type: eth
    - onboot: yes
    - ipaddr: X.X.X.16
      netmask: 255.255.255.255
    - ipaddr: X.X.X.17
      netmask: 255.255.255.255
    - ipaddr: X.X.X.18
      netmask: 255.255.255.255
    - ipaddr: X.X.X.19
      netmask: 255.255.255.255

But, every time it puts to config-file this:

IPADDR="['127.0.0.1/8', 'X.X.X.16/32', 'X.X.X.17/32', 'X.X.X.18/32', 'X.X.X.19/32']"

Obviously, I got this:

Sep  5 12:58:38 front00-linux systemd: Starting LSB: Bring up/down networking...
Sep  5 12:58:38 front00-linux network: Bringing up loopback interface:  ipcalc: bad prefix: 8', 'X.X.X.16/32', 'X.X.X.17/32', 'X.X.X.18/32', 'X.X.X.19/32']
Sep  5 12:58:38 front00-linux network: ipcalc: bad prefix: 8',
Sep  5 12:58:38 front00-linux network: ipcalc: bad prefix: 8',
Sep  5 12:58:38 front00-linux network: ipcalc: bad prefix: 8',
Sep  5 12:58:38 front00-linux network: Error: ??? prefix is expected rather than "['127.0.0.1/8',".
Sep  5 12:58:38 front00-linux network: [  OK  ]
Sep  5 12:58:43 front00-linux network: Bringing up interface enp1s0f0:  [  OK  ]

Versions Report

Salt Version:
           Salt: 2017.7.0

Dependency Versions:
           cffi: 1.10.0
       cherrypy: unknown
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.13 (default, Feb 22 2017, 19:02:48)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.3.1611 Core
         locale: ANSI_X3.4-1968
        machine: x86_64
        release: 4.4.30-1.el7.elrepo.x86_64
         system: Linux
        version: CentOS Linux 7.3.1611 Core

Minion:

Salt Version:
           Salt: 2017.7.1

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov  6 2016, 00:28:07)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.3.1611 Core
         locale: UTF-8
        machine: x86_64
        release: 4.9.20-1.comapyname.el7.centos.x86_64
         system: Linux
        version: CentOS Linux 7.3.1611 Core

PS:
unfortunately, the documentation is poor at all.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.network.html
Any suggestions how can I solve this problem?
Thank you!

@gtmanfred
Copy link
Contributor

I have submitted PR #43359 Which adds ipaddr_{start,end} to the template for el7 interfaces.

In the mean time, you would have to make one state for each ipaddr, or use names for each alias

lo:
  network.managed:
    - names:
      - "lo:1":
        - ipaddr: 127.0.0.16
      - "lo:2":
        - ipaddr: 127.0.0.17
      - "lo:3":
        - ipaddr: 127.0.0.18
      - "lo:4":
        - ipaddr: 127.0.0.19
    - enabled: True
    - type: eth
    - onboot: yes
    - netmask: 255.255.255.255

@gtmanfred gtmanfred added Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix labels Sep 5, 2017
@gtmanfred gtmanfred added this to the Approved milestone Sep 5, 2017
@rallytime
Copy link
Contributor

Closed via #43359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix
Projects
None yet
Development

No branches or pull requests

3 participants