Updated systemd networkd role to fix hangs

Sometime systems will hang when executing many systemd options at the
same time. This change breaks up the systemd enabled/start/daemon_reload
tasks so that we're only enabling and starting when "systemd_run_networkd"
is set to true.

Change-Id: I3572337edc87b5753f9d4a9b480fdba76e98e8ef
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-05-13 15:30:18 -05:00 committed by Kevin Carter (cloudnull)
parent 12ae3acd6e
commit 955e445969

View File

@ -123,11 +123,26 @@
tags:
- systemd-networkd
- name: Set systemd-networkd service state
- name: Reload systemd daemon
systemd:
name: "systemd-networkd"
daemon_reload: yes
enabled: "{{ (systemd_run_networkd | bool) | ternary('yes', 'no') }}"
state: "{{ (systemd_run_networkd | bool) | ternary('started', 'stopped') }}"
tags:
- systemd-networkd
- name: Enable systemd-networkd
systemd:
name: "systemd-networkd"
enabled: "yes"
when:
- systemd_run_networkd | bool
tags:
- systemd-networkd
- name: Start systemd daemon
systemd:
name: "systemd-networkd"
state: "started"
when:
- systemd_run_networkd | bool
tags:
- systemd-networkd