From d73f54e7e56f689fa3dc69e5a54f078c9680c337 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Wed, 3 Oct 2018 15:31:49 +0200 Subject: debian: add basic Debian role --- roles/debian/tasks/networkd.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 roles/debian/tasks/networkd.yml (limited to 'roles/debian/tasks/networkd.yml') diff --git a/roles/debian/tasks/networkd.yml b/roles/debian/tasks/networkd.yml new file mode 100644 index 0000000..4dac677 --- /dev/null +++ b/roles/debian/tasks/networkd.yml @@ -0,0 +1,27 @@ +--- +- name: Enable/disable systemd-networkd + systemd: + name: systemd-networkd.service + enabled: "{{ use_networkd|ternary('yes','no') }}" + masked: "{{ use_networkd|ternary('no',omit) }}" + # let the current network daemons run undisturbed until reboot + # aka. don't cut the pipe we're connected through + #state: "{{ use_networkd|ternary('started','stopped') }}" + when: not chroot +- name: '- when in chroot' + command: "systemctl {{ use_networkd|ternary('enable','disable') }} systemd-networkd.service" + when: chroot + +- name: Mask Debian networking.service + systemd: + name: networking.service + enabled: no + masked: yes + when: use_networkd and not chroot +- name: '- when in chroot' + block: + - command: systemctl disable networking.service + - command: systemctl mask networking.service + when: use_networkd and chroot + +# vim: set ts=2 sw=2 et: -- cgit v1.2.1