Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Network restart never happens on CentOS 7.5 #254

Open
lschweiss-wustl opened this issue Oct 15, 2018 · 2 comments
Open

Network restart never happens on CentOS 7.5 #254

lschweiss-wustl opened this issue Oct 15, 2018 · 2 comments

Comments

@lschweiss-wustl
Copy link

Expected Behavior

When adding a routing rule to an interface the network should be restarted for at least that interface.

Actual Behavior

Network restart claims to happen, but never does:

Notice: /Stage[main]/Network/Network::Mroute[ens192]/File[route-ens192]/ensure: defined content as '{md5}14562cbe8446fd65d5001ada0a17524e'
Info: /Stage[main]/Network/Network::Mroute[ens192]/File[route-ens192]: Scheduling refresh of Exec[service network restart]
Notice: /Stage[main]/Network/Exec[service network restart]: Triggered 'refresh' from 1 events

After the Puppet run:

# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.27.125.158   0.0.0.0         UG        0 0          0 ens192
10.27.125.128   0.0.0.0         255.255.255.224 U         0 0          0 ens192

# service network restart
Restarting network (via systemctl):                        [  OK  ]

# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.27.125.158   0.0.0.0         UG        0 0          0 ens192
10.27.125.128   0.0.0.0         255.255.255.224 U         0 0          0 ens192
100.64.100.0    10.27.125.155   255.255.254.0   UG        0 0          0 ens192

Steps to Reproduce the Problem

  1. Add a route
  2. Run Puppet
  3. Observe routing table

Specifications

Please add this info:

  1. Output of facter -p on the failing node (at least the OS related facts)
os => {
  architecture => "x86_64",
  family => "RedHat",
  hardware => "x86_64",
  name => "CentOS",
  release => {
    full => "7.5.1804",
    major => "7",
    minor => "5"
  },
  selinux => {
    config_mode => "permissive",
    current_mode => "permissive",
    enabled => true,
    enforced => false,
    policy_version => "31"
  }
}
  1. Version of Puppet and of the module
    Puppet: 4.10.12 module: 3.5.0
  2. The relevant Puppet code and eventually Hiera data
classes:
  - network

network::mroutes_hash:
  ens192:
    routes:
      100.64.100.0/23: 10.27.125.155
@alvagante
Copy link
Member

This is strange, as you noticed the network restart command is actually executed ( Notice: /Stage[main]/Network/Exec[service network restart]: Triggered 'refresh' from 1 events ) , have to isolate the issue.

@alvagante
Copy link
Member

Did some more checks here. Looks like , for reasons still unclear, the first time network is configured the service network restart command doesn't actually apply the new routes, even if executed after all the network related files are managed. Then, since the files are already in their expected state, subsequent puppet runs don't trigger any restart command.
A manual workaround is to change in any place (even just by adding a space anywhere) the route script, and then run puppet again. In that run, puppet chnages the file back to the expected state , triggers the network restart and that actually correctly configures the routes.
Leaving the ticket open, even if clueless on how to fix it.

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

No branches or pull requests

2 participants