ansible: Mask networking.service on Debian when starting to manage netplan
authorKienan Stewart <kstewart@efficios.com>
Wed, 30 Aug 2023 18:01:35 +0000 (14:01 -0400)
committerKienan Stewart <kstewart@efficios.com>
Wed, 30 Aug 2023 19:11:29 +0000 (15:11 -0400)
Change-Id: I59bb6d399b274bcb7f35ab777d776d7bdef7407d

automation/ansible/roles/netplan/tasks/main.yml

index b9b68967764f15e6d98da022bfa22c3b0f9ad1f5..2bef5d8e22faf06003cfaba9305d6b3f1eadfb71 100644 (file)
         group: root
         mode: '0640'
       register: netplan_default_yaml
+    - name: Disable ifupdown on Debian
+      when: ansible_distribution == "Debian"
+      block:
+        - name: Disable ifupdown networking
+          ansible.builtin.systemd:
+            name: networking.service
+            masked: true
+        - name: Enable systemd-networkd
+          ansible.builtin.systemd:
+            name: systemd-networkd
+            enabled: true
+            state: started
     - name: Apply netplan
       when: netplan_default_yaml.changed and netplan_apply
       ansible.builtin.command:
This page took 0.031542 seconds and 4 git commands to generate.