Giter Club home page Giter Club logo

Comments (4)

ansibot avatar ansibot commented on June 6, 2024

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

from ansible.

flowerysong avatar flowerysong commented on June 6, 2024

The module returns detailed information about all of the services, not just a simple list.

    - service:
        state: stopped
        name: ntpd.service
      when: ansible_facts['services']['ntpd.service']['status'] | default('not-found') != 'not-found'

from ansible.

bcoca avatar bcoca commented on June 6, 2024

As flowerysong already stated (while i was about to post this), you have all the info to filter it already:

vars:
     existing_systemd_services: '{{ ansible_facts['services'].values()|selectattr('status', 'equalto', 'systemd')|rejectattr('status', 'equalto', 'not-found')}'

from ansible.

myllynen avatar myllynen commented on June 6, 2024

Yes, but why force all users and every playbook to do that kind of filtering? What are the use cases where these non-existent services would be needed?

I would at the very least make an option available to either include or exclude non-existent services. Thanks.

from ansible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.