do positive seelction

pull/83192/head
Brian Coca 4 weeks ago
parent 486a66c712
commit 882816ce43

@ -49,7 +49,7 @@ EXAMPLES = r'''
- name: show only existing systemd services
debug: msg={{existing_systemd_services}}
vars:
existing_systemd_services: "{{ ansible_facts['services'].values() | selectattr('status', 'defined') | rejectattr('status', 'equalto', 'not-found') }}"
existing_systemd_services: "{{ ansible_facts['services'].values() | selectattr('source', 'equalsto', 'systemd') | rejectattr('status', 'equalto', 'not-found') }}"
- name: restart systemd service if it exists
service:

Loading…
Cancel
Save