Commit Graph

33 Commits

Author SHA1 Message Date
Chris Roberts a16b6f84e3 Remove reload via cli and just restart the service 2017-05-09 09:13:40 -07:00
Chris Roberts c081916ce8 Always disconnect interface when controlled by NetworkManager 2017-05-08 19:30:35 -07:00
Chris Roberts 1df852c88a Reduce commands. Allow nm reload/restart to bring interfaces up.
Reduce the total number of commands run to configure interfaces. If
a service reload/restart is required, only execute it once instead
of once per device. When nm is managing a device, the explicit up
is not required.
2017-05-01 13:17:17 -07:00
Chris Roberts 414184b76b guests/rhel: Update network configuration
Properly detects NetworkManager on guest as well as devices controlled
by NetworkManager. Provides configuration option to enable/disbale
NetworkManager control on devices.
2017-04-26 13:15:33 -07:00
Michaël Faille 96611341a9 Revert "Fix `service network restart` on RHEL-7 / Fedora"
`/etc/init.d/network restart` already restart NM and shutdown interfaces.

In start() :
```
        if [ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ]; then
                nmcli connection reload
        fi

```

In stop() :

```
       for i in $vpninterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do
                unset DEVICE TYPE
                (. ./ifcfg-$i
                if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi

                if ! check_device_down $DEVICE; then
                   action $"Shutting down interface $i: " ./ifdown $i boot
                   [ $? -ne 0 ] && rc=1
                fi
                )
        done
```
Where $remaining include all "others" interfaces including eth*

This reverts commit 166d10d4e1.
2016-12-21 20:33:57 -05:00
Latchezar Tzvetkoff 166d10d4e1 Fix `service network restart` on RHEL-7 / Fedora
RHEL-7 / Current Fedora versions tend to use NetworkManager for
configuring the networks, and `service network restart` might fail.
If the `NetworkManager` service is running, we should restart it,
otherwise we try restarting `network`.
2016-11-29 15:40:48 +02:00
Chris Roberts 67f3c8b48c guests/redhat: Force NetworkManager to reload device configurations
When configuring network devices force NetworkManager to reload new
configuration files as they appear. This prevents NetworkManager from
attempting to continue managing devices on initial start up.
2016-10-25 07:45:38 -07:00
Chris Roberts d178631ff9 Generic white space strip from command strings 2016-10-07 17:30:27 -07:00
AJ 2e723ea308 added general restart for network - to prevent IP address dropping on interfaces 2016-08-23 21:02:11 +01:00
AJ 1c4e7ee068 assuming a scenario - vagrant up -> power off -> vagrant up
vagrant will stuck on the network configuration

DEBUG ssh: stdout: mv: overwrite '/etc/sysconfig/network-scripts/ifcfg-eth0'?
DEBUG ssh: Sending SSH keep-alive...
2016-08-23 20:58:15 +01:00
Seth Vargo 084d62b5a6
guests/fedora: Move as a child of redhat
Fedora should have been a child of redhat for awhile now...
2016-07-18 21:12:54 -04:00
Seth Vargo 8f3b6511f2
guests/linux: Add shared cap for listing network interfaces 2016-07-18 21:12:54 -04:00
Satoshi Matsumoto de9abc8f72
guests/redhat: fix network configuration in CentOS 5
ip command is not on PATH by default in CentOS 5 so call it with the full path.
2016-06-18 14:14:25 -04:00
James Wilson 358ad8f18f Use ip instead of deprecated ifconfig for Red Hat/CentOS guests 2016-06-16 10:06:58 +01:00
Seth Vargo cc26c46066
guests/redhat: Configure networks in one command
This commit also switches to using predictable network names.
2016-06-06 11:58:38 -04:00
Seth Vargo 49ce775b53
Prefix tempfiles with vagrant- 2016-05-31 00:18:16 -04:00
Seth Vargo 7014aa3bab
Remove custom tempfile class
This is not actually providing any additional utility and also causes
namespace conflicts with people trying to use the real Tempfile class.
2016-05-30 23:21:47 -04:00
Seth Vargo 5a4f345363
Use Util::Tempfile when configuring networks
This fixes a fairly large tempfile leak. Vagrant uses a template
renderer to write network configuration files locally to disk. Then,
that temporarily file is uploaded to the remote host and moved into
place. Since Vagrant is such a short-lived process, GC never came along
and cleaned up those tempfiles, resulting in many temporary files being
created through regular Vagrant usage.

The Util::Tempfile class uses a block to ensure the temporary file is
deleted when the block finishes. This API required small tweaks to the
usage, but provides more safety to ensure the files are deleted.
2016-05-28 23:22:34 -04:00
Andy Thompson 5c988b64b5 Fixes #4450, add another expand_path ../ to get back to the guests directory 2014-09-04 20:51:10 +01:00
Andy Thompson fb1d4adf87 Fixes #4438 typo missing sending networks param for rhel guest network 2014-09-03 16:09:30 +01:00
Mitchell Hashimoto f4ee4764bb guests/redhat: configure networks properly on EL7 [GH-4195] 2014-08-30 22:49:13 -07:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto e7a5dc4f8e Revert "Merge pull request #3643 from cammoraton/rhel7-plugin-fixes"
This reverts commit 919d0b9f4b, reversing
changes made to 924c47feb3.
2014-05-06 13:26:44 -07:00
cammoraton 6d6282f1be Finished up fixes. Removed some artifacts. 2014-05-06 08:48:01 -04:00
cammoraton 5345c1479a Fix configure networks and templates to work off polled interface names. 2014-05-06 08:44:36 -04:00
Mitchell Hashimoto cae4a1c554 guests/redhat: force remove files so it works with pty 2014-03-05 16:22:55 -08:00
Markus Kern c8a09b344b guests/redhat: Don't error if ifdown fails [GH-2614] 2013-12-10 20:04:36 +00:00
Mitchell Hashimoto 05b2e03586 guests/redhat: don't ifdown non-existent interfaces [GH-2614] 2013-12-10 09:04:20 -08:00
Jonathan Li 1ad756d52c ifdown ethN before munging ifcfg-ethN (i.e. removing previous vagrant config for network interface) 2013-11-02 12:35:37 -07:00
JP Rosevear 1029538b24 Set ARPCHECK=no as an environment variable with doing ifup #921 2013-06-09 14:14:33 -04:00
Mitchell Hashimoto 78d4d0a790 Networks come back up properly after reboot on RedHat [GH-921] 2013-04-08 11:02:03 -07:00
Mitchell Hashimoto fd157476b4 extend should be include for TemplateRenderer in caps 2013-04-08 10:47:19 -07:00
Mitchell Hashimoto 5e09577a76 Lots more guest capabilities converted 2013-04-04 12:09:40 -07:00