question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

network.managed doesn't support static networks on CentOS 7

See original GitHub issue

Description of Issue/Question

I traced this a little ways and it looks like the network state relies on the ip module which is actually a virtual module and is being supplied by rh_ip.py. There is a list of supported protocols in the _parse_settings_eth function with only none, bootp, and dhcp are present. This is in contrast to the debian_ip.py which includes static, loopback and ppp (but not none).

Setup

eth0:
  network.managed:
    - enabled: True
    - type: eth
    - proto: static
    - ipaddr: 10.1.0.7
    - netmask: 255.255.255.0
    - gateway: 10.1.0.1

The start of the state.network example from the documentation

Steps to Reproduce Issue

$ salt minion state.apply core.net test=True
minion:
----------
          ID: eth0
    Function: network.managed
      Result: False
     Comment: Invalid option -- Interface: eth0, Option: static, Expected: [none|bootp|dhcp]
     Started: 13:35:49.561414
    Duration: 4.534 ms
     Changes:

Summary for minion
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time:   4.534 ms

Versions Report

Salt Version:
           Salt: 2018.3.3

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.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Oct 30 2018, 23:45:53)
   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.6.1810 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-957.1.3.el7.x86_64
         system: Linux
        version: CentOS Linux 7.6.1810 Core

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
alexkolomolocommented, May 21, 2020

In Centos 8 this does not work.

1reaction
gee456commented, Jul 22, 2021

Same here, the lack of NetworkManager/nmcli support show a lack of OS commitment from the Salt developer community. Ansible has it. https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html This should have been implemented Years ago. Why was the Feature request closed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure a static IP address on CentOS 7 / RHEL 7
Explains how to configure static IP address on CentOS 7 or RHEL 7 ... To restart networking service, enter the following systemctl command:...
Read more >
How to Configure Network Static IP Address on RHEL/CentOS ...
The scope of this tutorial is to explain how we can edit and make changes to Network Configurations on RHEL/CentOS 8/7 from the...
Read more >
Static IP Configuration on CentOS 7 - Snel.com
How to configure Static IP Configuration on CentOS 7? Network configuration on CentOS 7 is made automatic and simple through the use of...
Read more >
How to Configure a Network Interface on CentOS7 and RHEL7/8
We can manage Network Manager service using below commands, But keep in mind while running below commands it will affect all the interfaces ......
Read more >
How To Configure a Static IP Address on CentOS 7/8
In RHEL and CentOS 7 and 8 the networking service is managed by the NetworkManager daemon and it is used to dynamically configure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found