Git Product home page Git Product logo

Comments (9)

ansibot avatar ansibot commented on July 18, 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.

ansibot avatar ansibot commented on July 18, 2024

@tux-o-matic ansible-core 2.14 is not supported and no longer receives bug fixes. Please test against one of the supported versions of ansible-core, preferably the most recent one, to see whether the bug has been fixed.

click here for bot help

from ansible.

tux-o-matic avatar tux-o-matic commented on July 18, 2024

Problem is still present in newer Ansible.

ansible [core 2.17.0]
  config file = None
  configured module search path = ['/Users/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/xxx/Library/Python/3.11/lib/python/site-packages/ansible
  ansible collection location = /Users/xxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/xxx/Library/Python/3.11/bin/ansible
  python version = 3.11.9 (main, Apr  4 2024, 13:30:03) [Clang 15.0.0 (clang-1500.3.9.4)] (/Users/xxx/macports/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

from ansible.

bcoca avatar bcoca commented on July 18, 2024

The generator issue is not the same as the service itself, the service is running and enabled, the generator error seems to be an aside. As such the module is reporting correctly about the service itself, since the generator failure does not seem to affect it directly, i believe the status shown is correct. The action is scoped towards managing the services themselves, not generators, not timers, nor anything else.

I'm not against adding this information as a warning, which seems to be what systemd is doing. But, I don't know if the way we interface with systemd even produces this output.

from ansible.

tux-o-matic avatar tux-o-matic commented on July 18, 2024

If I list the enabled services in systemd, the services created via generators and “enabled” in Ansible do not show up. So Ansible says one thing but the target host gives no proof that the service is enabled.

The RHEL documentation for Podman and systemd mentions that the generated unit file needs to be copied to /etc/systemd/system in order to enable the service.

from ansible.

bcoca avatar bcoca commented on July 18, 2024

generators are not services, they are helpers, mostly there to get the prerequisites for services, like mounting drives.

from ansible.

tux-o-matic avatar tux-o-matic commented on July 18, 2024

@bcoca, the issue isn't so much about generators but about Ansible not reporting an error and giving an incorrect feedback about the state of a systemd service. Yes in the case the systemd unit file was produced by a generator but if systemctl says something, Ansible should say the same thing.

from ansible.

bcoca avatar bcoca commented on July 18, 2024

So, our is-enabled check takes generated and transient as 'valid enabled state', this will result in an 'OK' as there is no need to change to enable such service. The module never gets to the point of trying to enable a generated service, this seems correct behavior.

            valid_enabled_states = [
                "enabled",
                "enabled-runtime",
                "linked",
                "linked-runtime",
                "masked",
                "masked-runtime",
                "static",
                "indirect",
                "disabled",
                "generated",
                "transient"]

from ansible.

tux-o-matic avatar tux-o-matic commented on July 18, 2024

It seems somebody also asked to have that aspect clarified on systemd.
Having for example:

[Install]
WantedBy=multi-user.target default.target

Will lead generator to create a symlink in /run/systemd/generator/default.target.wants/.

But that is not reflected in generated and generated doesn't guarantee that a link workaround was implemented.

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.