Skip to content

Add scope parameter to systemd_info module #10930

@antonc42

Description

@antonc42

Summary

The ansible.builtin.systemd_service module has a scope parameter that accepts the options system (default), user, and global. I think adding a similar parameter to the community.general.systemd_info module would be useful so that information could be gathered about user units. Although less common, user units are sometimes used for things like Podman rootless containers (Quadlets or the older podman generate systemd). As far as I can tell, there is no Ansible module that gathers this information. Like the community.general.systemd_info module, the ansible.builtin.service_facts module only gathers facts about system services.

Issue Type

Feature Idea

Component Name

systemd_info

Additional Information

# Gather info for all systemd services, targets, sockets, mounts and timers for the user
- name: Gather all systemd unit info for the user
  community.general.systemd_info:
    scope: user
  register: results
  become: true
  become_user: username

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis issue/PR relates to a feature requestmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions