On 16/09/16 05:03, John.1209 wrote:

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.

~

Any help would be much appreciated.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/520d58bd-29f6-4897-838e-4b66b44a30e2%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/520d58bd-29f6-4897-838e-4b66b44a30e2%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1a0d56d4-79ca-3a8e-7e2a-fcc32cce5666%40spectralmud.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to