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

forcing network service restart upon a change #221

Open
gerases opened this issue Apr 14, 2017 · 4 comments
Open

forcing network service restart upon a change #221

gerases opened this issue Apr 14, 2017 · 4 comments
Labels

Comments

@gerases
Copy link

gerases commented Apr 14, 2017

Hi,

Upon configuring an interface, I though the network service would restart, but it doesn't. Can I do something to make that happen automatically? This is how I configure an interface:

network_config { $corosync_iface:
    ensure    => 'present',
    family    => 'inet',
    ipaddress => $corosync_ip,
    method    => 'static',
    onboot    => true,
}

Thanks

@rski
Copy link
Member

rski commented Apr 14, 2017

Hi gerases,

this is a known issue #132. Forcing an if down/up on the interfaces (with exec?) would make them use the updated configuration.

@gerases
Copy link
Author

gerases commented Apr 14, 2017

Cool. I was thinking about doing an exec but wasn't sure if it was best practice. Thank you much.

@rski
Copy link
Member

rski commented Apr 14, 2017

Well, I don't know if that is the right solution either, but that is what I ended up doing when using puppet-network myself. Hope it helps.

@eliaoggian
Copy link

eliaoggian commented Nov 9, 2017

I am wondering if restarting the network service at every puppet run is a good idea.
What I mean is: in a production environment, could this cause some connection issues?

I am using the network module as it follows:

class profile::network::interfaces($interfaces = hiera('interfaces',false)) {
  if ($interfaces != false) {

    include '::network'
    create_resources(network_config, $interfaces)

  }
}

And in hiera:

interfaces:
  ens160:0:
    name: 'ens160:0'
    ensure: 'present'
    provider: 'interfaces'
    onboot: 'true'
    ipaddress: 'xxx.xxx.xxx.xxx'
    netmask: 'xxx.xxx.xxx.xxx'
    method: 'static'
    family: 'inet'
    hotplug: 'false'

How could I implement something that restarts the network service only when changes are made?

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

No branches or pull requests

4 participants