apt:upgrade=safe 刪除eth0

apt:upgrade=safe 刪除eth0

我有一個包含以下任務的 ansible 劇本

- name: Get aptitude for upgrade
  apt: pkg=aptitude state=present

- name: Update APT package cache
  apt: update_cache=yes cache_valid_time=3600

當我添加

- name: Upgrade APT to the latest packages
  apt: upgrade=safe

eth0接口神奇地消失了。

貓/etc/網路/介面:

auto lo
iface lo inet loopback

auto etho0 
iface eth0 inet dhcp

如果配置在 apt: 升級=安全之前:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:9e:16:fd  
          inet addr:192.168.1.161  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe9e:16fd/64 Scope:Link
          inet6 addr: 2002:5e4f:b23c:1234:ba27:ebff:fe9e:16fd/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:95254 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30815 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:136917073 (136.9 MB)  TX bytes:2880058 (2.8 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)

之後:

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)

我正在運行一個新的 Ubuntu 伺服器 16.04 LTS。知道為什麼 eth0 消失了嗎?顯然 apt:upgrade=safe 是問題所在,但為什麼呢?

ifconfig-a令人驚訝的是給出了不同的輸出,但是 eth0 仍然丟失:

在此輸入影像描述

答案1

安裝網路管理員後問題消失

- name: Get network-manager
  apt: state=installed pkg=network-manager

相關內容