michaelrigart / ansible-role-interfaces

An ansible role for configuring different network interfaces
GNU General Public License v3.0
83 stars 61 forks source link

Failed to bring up eth1 - ifdown: interface eth1 not configured #72

Open trompx opened 4 years ago

trompx commented 4 years ago

Hello,

I am using Linux Mint 19.3. I try to setup a eth1/eth2 interfaces with the following:

interfaces_ether_interfaces:
  - device: eth1
    bootproto: static
    address: 192.168.33.15
    netmask: 255.255.255.0
    gateway: 192.168.0.254
    dnsnameservers: 8.8.8.8 8.8.4.4
    mtu: 9000
  - device: eth2
    bootproto: dhcp

The [workstation/network : Bounce network devices] task triggers the following error:

fatal: [workstation]: FAILED! => {
    "changed": true,
    "cmd": [
        "nohup",
        "bash",
        "-c",
        " returncode=0  ifdown --allow auto eth1;  ifdown --allow auto eth2;  if ! ifup --allow auto eth2; then\necho \"Failed to bring up interface eth2\";\nreturncode=1\nfi;  if ! ifup --allow auto eth1; then\necho \"Failed to bring up interface eth1\";\nreturncode=1\nfi; exit $returncode"
    ],
    "delta": "0:00:00.062514",
    "end": "2020-06-16 14:30:19.033546",
    "rc": 1,
    "start": "2020-06-16 14:30:18.971032"
}

STDOUT:

Failed to bring up eth2.
Failed to bring up interface eth2
Failed to bring up eth1.
Failed to bring up interface eth1

STDERR:

ifdown: interface eth1 not configured
ifdown: interface eth2 not configured
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Cannot find device "eth2"
Error getting hardware address for "eth2": No such device

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging..

exiting.
Cannot find device "eth1"

I think it may come from missing entries in /run/network/ifstate which outputs:

lo=lo

Do I need to create a task to add my interfaces or your role is already supposed to do it and there is a bug?

trompx commented 4 years ago

Just found out Ubuntu 18.04 uses NetPlan now...