# check to see if network manager is running

**URL:** <https://forum.ansible.com/t/check-to-see-if-network-manager-is-running/22561>\
**Category:** Ansible Project\
**Created:** [September 15, 2016, 7:03pm UTC](https://forum.ansible.com/t/check-to-see-if-network-manager-is-running/22561 "2016-09-15T19:03:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John.1209](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@John.1209](https://forum.ansible.com/u/John.1209)\
**Post date:** [September 15, 2016, 7:03pm UTC](https://forum.ansible.com/t/check-to-see-if-network-manager-is-running/22561/1 "2016-09-15T19:03:01Z")

</div>

The following script is suppose to to check to see if Network Manager is running. The report status section is not working as I would expect:

---

<div class="post-metadata">

**Author:** ![Richard\_James\_Salts](https://avatars.discourse-cdn.com/v4/letter/r/3ab097/32.png) [@Richard\_James\_Salts](https://forum.ansible.com/u/Richard_James_Salts)\
**Post date:** [September 16, 2016, 1:01am UTC](https://forum.ansible.com/t/check-to-see-if-network-manager-is-running/22561/2 "2016-09-16T01:01:17Z")

</div>

> The following script is suppose to to check to see if Network Manager is running. The report status section is not working as I would expect:
> 
> * * *
> 
> - hosts: ‘{{ target }}’  
> sudo: yes  
> gather\_facts: yes  
> tasks:
> 
> - name: Network Manager Running  
> shell: systemctl status NetworkManager  
> when: ansible\_os\_family == “RedHat” and ansible\_distribution\_major\_version == “7”  
> register: service\_NetworkManager\_status
> 
> - name: Report status  
> shell: /bin/echo {{ ansbile\_hostname }} Network Manager is running  
> when: service\_NetworkManager\_status == True

You problably want to check service\_NetworkManager\_status.rc == 0 here.
