You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
I wanted to select only specific information from the systemd.SystemdStatus fact result (dictionary).
I.e. get only info on a subset of systemd-Services, by service name.
Describe the solution you'd like
SystemdStatus returns a dictionary {server: {service_name: service_active, ...}}, e.g.:
I'd like to only show information for a selected subset of services. Since the ad-hoc facts command invocation allows for arguments for the fact gathering, how about to add some mechanism to do that, e.g.
# Possibility 1: restrict service names to gather info about with an additional fact arg e.g.
pyinfra myserver fact systemd.SystemdStatus service_names="sshd-keygen.service, sendmail.service"
# Or maybe list each name separately(?)
pyinfra myserver fact systemd.SystemdStatus service_name="sshd-keygen.service" service_name="sendmail.service"
# Possibility 2: general possibility to restrict dictionary fact return values.
# This could then also work for other facts with dict results.
pyinfra myserver fact systemd.SystemdStatus --select-result-keys="sshd-keygen.service, sendmail.service"
# Or maybe allow for a regex selection - might be overkill(?)
pyinfra myserver fact systemd.SystemdStatus --select-result-keys="(sshd-keygen|sendmail)\.service"
Variations possible, example arg names debatable, of course.
I'm aware there's other possibilities to get at the information already, like
pyinfra myserver exec -- systemctl status goferd.service
pyinfra myserver -- systemctl show goferd.service --property=StatusErrno
Still, it feels like this would complement existing functionality nicely/naturally.
Best regards
Holger
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe
I wanted to select only specific information from the systemd.SystemdStatus fact result (dictionary).
I.e. get only info on a subset of systemd-Services, by service name.
Describe the solution you'd like
SystemdStatus returns a dictionary {server: {service_name: service_active, ...}}, e.g.:
I'd like to only show information for a selected subset of services. Since the ad-hoc facts command invocation allows for arguments for the fact gathering, how about to add some mechanism to do that, e.g.
Variations possible, example arg names debatable, of course.
I'm aware there's other possibilities to get at the information already, like
Still, it feels like this would complement existing functionality nicely/naturally.
Best regards
Holger
The text was updated successfully, but these errors were encountered: