94 Commits

Author SHA1 Message Date
sophia
b6aebeacae Use '-r' xargs argument
This will pervent running sed if there are no results
passed to xargs
2020-09-16 10:36:55 -05:00
sophia
7370f24318 Check for existence of network files before trying to update them 2020-09-14 11:10:52 -05:00
sophia
91ac0681cf Update RHEL cap for setting hostname 2020-07-20 15:19:50 -05:00
Sophia Castellarin
ee87596a77
Merge pull request #11462 from soapy1/docker-provision-centos8
Docker provision centos8
2020-04-13 09:42:37 -04:00
sophia
5104d075bd Add CentOS guest plugin 2020-04-06 13:48:39 -04:00
sophia
d500daea03 Support centos flavors of redhat 2020-04-03 14:27:44 -04:00
sophia
987ab17f4d Add suport for SMB on redhat 2020-03-25 12:27:04 -04:00
sophia
9d53e8ccab Recognize rhel8 flavor 2020-03-25 10:36:02 -04:00
Brian Cain
fb7a9d5582
Remove trailing whitespace 2019-11-21 13:44:28 -08:00
Tomas Krizek
3519f82b24
guest/redhat: fix nfs client installation
CentOS 8+ and Fedora 30+ no longer have the alias "nfs" for "nfs-server"
systemd service.

This shouldn't break backward compatibility, since "nfs-server" service
is available on all supported redhat systems that have systemctl binary.

Fixes #10838
2019-11-21 13:11:29 -08:00
Chris Roberts
9f1e7d9895 Prevent nil dup as unsupported in 2.3 2018-12-20 07:43:43 -08:00
Chris Roberts
a4a98d97fc Fix guest network configuration by properly extracting extra options
Extra options are extracted from the machine configuration for the
network being configured to allow for customized network manager
behavior. The network entries must be filtered to remove non-network
entries (like port forwards) before accessing by index.

Fixes #9546
2018-12-19 16:08:47 -08:00
Chris Roberts
11b0d58fa0 Include communicator on call 2018-10-01 08:43:49 -07:00
Chris Roberts
1797798760 Fix module name 2018-09-28 07:59:39 -07:00
Chris Roberts
ff021fcab4 Update redhat change host name capability to support systemd
Update capability to use guest inspection module for determining
correct actions to execute. When systemd is in use restart the
correct active service, either NetworkManager or networkd. Default
to using the original service restart when systemd service is not
found.
2018-09-20 16:44:08 -07:00
Joe Doss
19aa9578c7 Exit 1 if we cannot set the hostname. 2018-09-20 15:28:37 -07:00
Joe Doss
c14a4a09f7 Switch if statements, check for systemctl, and switch to is-active. 2018-09-20 15:28:37 -07:00
Joe Doss
94954739b5 Simplified if statements. 2018-09-20 15:28:37 -07:00
Joe Doss
80006251f4 Add in logic to restart NetworkManager if it is enabled. 2018-09-20 15:28:36 -07:00
langdon
f0b9d025e4 Fixes the change in packaging for nfs in f28 (#9878). However, removed part of the unit test which will be very difficult to fix (I expect). The unit test is still doing a good test that nfs and rpcbind work though. If you go far enough back, you need to bury the error out too. 2018-06-18 12:16:23 -04:00
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
Chris Roberts
e62d71b645 Remove comment removal from /etc/hosts file on guests
Fixes: #7794
2017-04-20 17:07:56 -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 166d10d4e16836e908be0bd94c2f671cac2b38b4.
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
9d61d7c61b Merge pull request #7818 from rswarts/vz7flavor
Add Virtuozzo Linux 7 to list of RHEL flavors
2016-10-11 10:35:20 -07:00
Chris Roberts
d178631ff9 Generic white space strip from command strings 2016-10-07 17:30:27 -07:00
Rutger Swarts
2ecbc241c3 Add Virtuozzo Linux 7 to list of RHEL flavors 2016-09-23 10:45:16 +02: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
cf91bcf029
guests: Always search for FQDN without sudo 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
Seth Vargo
b29864f450
Use symbols for defining guest capabilities 2016-06-17 19:55:04 -04:00
James Wilson
358ad8f18f Use ip instead of deprecated ifconfig for Red Hat/CentOS guests 2016-06-16 10:06:58 +01:00
Eugene Zamriy
eaa4e11c62 Add CloudLinux 7 to RHEL 7 flavors. 2016-06-12 16:51:55 +03:00
Seth Vargo
c12b413c2e
guests/redhat: Use require_relative in redhat plugin 2016-06-06 11:58:39 -04:00
Seth Vargo
aaedc48425
guests/redhat: Do not require vagrant in guest 2016-06-06 11:58:39 -04:00
Seth Vargo
60d2f4e1b4
guests/redhat: Install RedHat in one command 2016-06-06 11:58:39 -04:00
Seth Vargo
3098c13869
guests/redhat: Configure NFS in one command
Previously this was very complicated trying to flip between Ruby and
bash. This commit uses a single bash command that decides between yum
and dnf in the script itself.
2016-06-06 11:58:38 -04:00
Seth Vargo
e09d342284
guests/redhat: Add tests for flavor 2016-06-06 11:58:38 -04: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
b91c167b19
guests/redhat: Change host name in one command 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