Updated the role to include optional tests after running it, ensuring that DNS resolution is correctly configured. The code has been refactored to improve readability and maintainability.
12 lines
246 B
YAML
12 lines
246 B
YAML
# handlers/main.yml
|
|
- name: Restart networking if required
|
|
service:
|
|
name: networking
|
|
state: restarted
|
|
when: ansible_service_mgr == "systemd"
|
|
|
|
- name: Restart systemd-resolved
|
|
service:
|
|
name: systemd-resolved
|
|
state: restarted
|