I have googled this, and found I am not the first to ask. I have the following:
`
- name: Check if NetworkManager is running
shell: “systemctl status NetworkManager”
register: nm_status
changed_when: false
ignore_errors: yes
when: ansible_distribution_major_version == ‘7’
`
When it errors out, thanks to systemd, there is a whole bunch of garbage. I would like the following instead
msg: “NetworkManager not enabled”
I haven’t been able to get this to work yet with what I have googled… anyone else been able to do something like this?