Skip to content

Commit

Permalink
Fix permanently enabling systemd-networkd
Browse files Browse the repository at this point in the history
Work around the service module not yet handling "enabled-runtime"
properly. This patch should be reverted when the following can be used:
ansible/ansible#77754
  • Loading branch information
MoteHue committed Jul 15, 2024
1 parent 0286a36 commit 4cd13dc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions roles/systemd_networkd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@

- name: Enable systemd-networkd
become: true
ansible.builtin.service:
name: systemd-networkd
enabled: true
when: systemd_networkd_network or systemd_networkd_link or systemd_networkd_netdev
block:
# TODO(mattcrees): Remove once this gets into a versioned release:
# https://github.com/ansible/ansible/pull/77754
- name: Temporarily disable systemd-networkd
ansible.builtin.service:
name: systemd-networkd
enabled: false

- name: Enable systemd-networkd
ansible.builtin.service:
name: systemd-networkd
enabled: true

- name: Start and enable systemd-resolved
become: true
Expand Down

0 comments on commit 4cd13dc

Please sign in to comment.