#283 F28 Vagrant fails to set network correctly
Closed: fixed 6 years ago Opened 6 years ago by jdoss.

When starting the F28 vagrant image it fails with the error below due to /etc/sysconfig/network-scripts/ifcfg-enp0s3 being kept by the build process. Removing this file fixes the issue.

==> f28: Setting hostname...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

# Update sysconfig
sed -i 's/\(HOSTNAME=\).*/\1f28.example.com/' /etc/sysconfig/network

# Update DNS
sed -i 's/\(DHCP_HOSTNAME=\).*/\1"f28"/' /etc/sysconfig/network-scripts/ifcfg-*

# Set the hostname - use hostnamectl if available
echo 'f28.example.com' > /etc/hostname
if command -v hostnamectl; then
  hostnamectl set-hostname --static 'f28.example.com'
  hostnamectl set-hostname --transient 'f28.example.com'
else
  hostname -F /etc/hostname
fi

# Prepend ourselves to /etc/hosts
grep -w 'f28.example.com' /etc/hosts || {
  sed -i'' '1i 127.0.0.1\tf28.example.com\tf28' /etc/hosts
}

# Restart network
service network restart


Stdout from the command:

/usr/bin/hostnamectl
Restarting network (via systemctl):  [FAILED]


Stderr from the command:

Job for network.service failed because the control process exited with error code.
See "systemctl status network.service" and "journalctl -xe" for details.

Thanks for reporting. I'll look into this tomorrow.

Metadata Update from @dustymabe:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata