Score:0

What is the most reliable way to install ifupdown2 via Ansible?

tg flag

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?

Michael Hampton avatar
cz flag
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.
Zeitounator avatar
fr flag
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.
tg flag
@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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.