Setting a static-ip with network.managed
and am getting command not found for ip-down.
Given that ifupdown is no longer installed by default, the commands: ifup and ifdown are also unavailable. Please use the ip command to achieve similar functionality, specifically ip link set $device up and ip link set $device down.
Ubuntu Release Notes
salt code that I beleive to be in question:
network.sls
eth0:
network.managed:
- enabled: True
- type: eth
- proto: static
- ipaddr: 192.168.1.10
- netmask: 255.255.255.0
- gateway: 192.168.1.1
Running the above state that
salt 'minion
state.apply network`
----------
Function: network.managed
Result: False
Comment: Unable to run command '[u'ifdown', u'ens160']' with the context '{u'timeout': None, u'with_communicate': True, u'shell': False, u'bg': False, u'stderr': -2, u'env': {'LANG': 'en_US.UTF-8', 'LC_NUMERIC': 'C', 'NOTIFY_SOCKET': '/run/systemd/notify', 'LC_MESSAGES': 'C', 'JOURNAL_STREAM': '9:38838', 'LC_IDENTIFICATION': 'C', 'LC_ADDRESS': 'C', 'LC_NAME': 'C', 'LC_COLLATE': 'C', 'LC_MEASUREMENT': 'C', 'LC_CTYPE': 'C', 'LC_TELEPHONE': 'C', 'LC_MONETARY': 'C', 'LC_PAPER': 'C', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'LC_TIME': 'C', 'INVOCATION_ID': 'c736b3c72d224be28d6090a94f7ebb42'}, u'stdout': -1, u'close_fds': True, u'stdin': None, u'cwd': u'/root'}', reason: command not found
Started: 15:35:08.626458
Duration: 121.57 ms
Changes:
----------
interface:
Added network interface.
Salt Version:
Salt: 2018.3.0
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.27.0
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5
System Versions:
dist: Ubuntu 18.04 bionic
locale: ANSI_X3.4-1968
machine: x86_64
release: 4.15.0-23-generic
system: Linux
version: Ubuntu 18.04 bionic
For the record, you can still install the ifupdown
package, even though it does not come with ubuntu 18 by default.
If we're relying on it in the code, it should probably be a requirement for the package. /cc @dmurphy18
a check should be added in the __virtual__
This also affects places in debian_ip.py
where systemd networking.service
is used, since this is also added by the ifupdown
package - e.g.:
@garethgreenaway So should add a dependency on package ifupdown for Ubuntu 18.04 LTS untill the Salt code has been updated to utilize netstat.io or ip set link etc. ?
Will add package ifupdown for Ubuntu 18.04 LTS. Also need to check if this is required for Buster
Updated packaging to add dependency for ifupdown for an immediate fix, until code changes have been applied.
see https://github.com/saltstack/salt-pack/pull/683 and https://github.com/saltstack/salt-pack-py3/pull/132
PR https://github.com/saltstack/salt/pull/52670 submitted
@worlvlhole This will appear in a future point release, unfortunately it has missed the cut off for 2019.2.1, but I shall see what I can do.
If this is sufficient, please consider closing this issue.
Per https://github.com/saltstack/salt-pack/issues/682#issuecomment-535210585 and https://github.com/saltstack/salt-pack/issues/702#issuecomment-536347725, I'd suggest that it'd perhaps be better to Recommends:
or Suggests:
ifupdown
on Ubuntu 18.04 systems, rather than Depends:
, until the salt
network code can be made more portable.
Because salt-common
/ salt-minion
/ salt-master
can function fine without ifupdown
, for all features, except for this one specific (not yet updated 18 months after Ubuntu 18.04 release) feature. And several of us do not want surprise installs of ifupdown
on our netplan
managed systems causing confusion (either to the people managing the systems, or to the booting and IP addressing).
Ewen
@garethgreenaway Any comments on the the suggestion by @ewenmcneill as to affecting Salt's operation
reopened https://github.com/saltstack/salt-pack/issues/682 and shall make it Suggests:
saltstack/salt-pack-py3#162
This should appear in the next point release which should be soon due a number of other issues in Salt 2019.2.1.
FYI -- I just hit an issue WRT to this change to add a dependency on ifupdown
. Adding this package causes any AWS AMI that has it installed to fail to launch. After upgrading to salt 2019.2.1 in our Packer builds, the subsequent EC2 instances that used the new AMIs were unreachable after launch.
Looks like the version with Suggests: ifupdown
got released (2019.2.2):
ewen@naosr620:~$ dpkg -l | grep salt
ii salt-common 2019.2.2+ds-1 all shared libraries that salt requires for all packages
ii salt-minion 2019.2.2+ds-1 all client package for salt, the distributed remote execution system
ewen@naosr620:~$ apt-cache show salt-common | grep ifupdown
Suggests: ifupdown
ewen@naosr620:~$
So this issue could probably be closed again now.
Ewen
Ubuntu 18.04 is absolutely crap. Removed all the working stuff. Dont know why.
@worlvlhole @ewenmcneill Closing this since fixed in Salt v2019.2.2, and Salt 3000 just released.
Please reopen if you have additional fixes required for this issue
@dmurphy18 the actual fix never got released before it was accidentally reverted: #57637
I am still having this issue. Shouldn't the dependency be on the ip command instead of ifupdown for the maximum compatibility?
ip link set <interface> down
ip link set <interface> up
@allyunion yes, that's the fix that got accidentally reverted.
Most helpful comment
If we're relying on it in the code, it should probably be a requirement for the package. /cc @dmurphy18