aboutsummaryrefslogtreecommitdiffstats
path: root/roles/debian/tasks/networkd.yml
blob: 4dac677459883f72a4ae6b7c376fd054098bd1ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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: