- name: Restart NetworkManager services
  service:
    name: NetworkManager
    enabled: yes
    state: stopped

- service:
    name: NetworkManager-dispatcher
    enabled: yes
    state: stopped

- wait_for:
    path: /etc/passwd
    delay: 4
    timeout: 5

- service:
    name: NetworkManager
    enabled: yes
    state: started

- wait_for:
    path: /etc/passwd
    delay: 4
    timeout: 5

- service:
    name: NetworkManager-dispatcher
    enabled: yes
    state: started

- debug:
    msg: "hopefully now NM is restarted"
