0

I need to install the Linux package ifupdown2 on a couple of remote Debian servers and want to use Ansible for this task. Since ifupdown2 replaces the standard Debian network tool ifupdown, no network connection is possible during the installation process. After installation, a restart of the network service is necessary to bring the interfaces up again. Currently I use this async Ansible command:

- name: Install ifupdown2
  shell: apt-get install -y ifupdown2 && systemctl restart networking
  async: 180
  poll: 5

However, the execution is quite unreliable and sometimes ends in a timeout. Do you know of a more reliable way to install ifupdown2 via Ansible?

  • Do you mean to say that Debian is actually killing the network while installing this package?! That's insane! Almost certainly worth making a bug report. – Michael Hampton Jul 08 '21 at 14:58
  • 1
    Before anything else I would simply try to use the [`apt` mordule](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html) to install and then the [`systemd` module](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_module.html) to restart the service and see the result. Because I'm almost sure it works out of the box. And since you did not mention you made that test, I suppose you didn't. – Zeitounator Jul 10 '21 at 14:05
  • @Zeitounator: Thank you for your suggestion! That was exactly my first approach. But since ifupdown2 doesn't restart the networt service after installation, no connection can be established afterwards. Therefore I have combined the two actions into one shell command. – Philipp Waller Jul 14 '21 at 07:58

0 Answers0