Skip to content

harden service_facts states and add new output variable load_states#76667

Open
jameslivulpi wants to merge 7 commits intoansible:develfrom
jameslivulpi:servicefacts
Open

harden service_facts states and add new output variable load_states#76667
jameslivulpi wants to merge 7 commits intoansible:develfrom
jameslivulpi:servicefacts

Conversation

@jameslivulpi
Copy link
Contributor

SUMMARY

#76629

  • Better handling of the correct states across systemd
  • Added a load_state field as this is easily accessible in the calls so shouldn't require much overhead. This allows user to see if unit is not-found, static, loaded, etc.
  • Added integration tests including failed service test.
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

service_facts

@jameslivulpi
Copy link
Contributor Author

I added some comments on the rationale behind some of changes in code, will remove those later and lint code further.

@ansibot

This comment has been minimized.

@ansibot ansibot added affects_2.13 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jan 6, 2022
@bcoca bcoca self-requested a review January 11, 2022 15:21
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Jan 11, 2022
@jameslivulpi
Copy link
Contributor Author

Reason I changed run_command to list style was to make linter happy :-)

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 12, 2022
@jameslivulpi jameslivulpi requested a review from bcoca January 12, 2022 02:52
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Jan 12, 2022
Co-authored-by: justin-f-perez <justin.f.perez@gmail.com>
@jameslivulpi jameslivulpi requested a review from bcoca January 19, 2022 22:06
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Jan 20, 2022
- Revert state description
- Add version_added to load_state
@ansibot ansibot removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Jan 20, 2022
@dirks dirks mentioned this pull request Jan 28, 2022
1 task
@ansibot ansibot added has_issue stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Jan 29, 2022
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed stale_review Updates were made after the last review and the last review is more than 7 days old. labels Mar 2, 2022
@bcoca
Copy link
Member

bcoca commented Apr 26, 2023

sorry for the delay on getting back, can you rebase the PR?

@ansibot ansibot added stale_review Updates were made after the last review and the last review is more than 7 days old. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. has_issue labels Jul 12, 2023
@opoplawski
Copy link
Contributor

Nice to see --no-legend being added.

@bcoca
Copy link
Member

bcoca commented Mar 21, 2024

note (not for immediate action): i've been thinking about this and more general PRs, adding a 'extended_info' for the plugin and then allow for each 'service system' to attach all 'extra' information seems a better approach than adding piece by piece the information to solve one problem at a time.

i.e service_facts: attach_extra_info=true would return ALL the fields that are not already part of the 'standard' return for a service under a extras/expanded: key.

@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects_2.15 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_pr This PR has not been pushed to for more than one year. stale_review Updates were made after the last review and the last review is more than 7 days old. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants