Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launchd: Add plist option #9102

Merged
merged 1 commit into from
Nov 16, 2024
Merged

Conversation

moreati
Copy link
Contributor

@moreati moreati commented Nov 6, 2024

SUMMARY

This allows the module to be used with services such as com.openssh.sshd, when the name of the plist file doesn't match the service name.

fixes #5932

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

launchd

ADDITIONAL INFORMATION

Before

$ ansible -m community.general.launchd -a "name=org.openssh.sshd state=stopped" localhost 
localhost | FAILED! => {
    "changed": false,
    "msg": "Unable to infer the path of org.openssh.sshd service plist file"
}
$ echo $?
2

After

$ ansible -m community.general.launchd -a "name=org.openssh.sshd plist=ssh.plist state=stopped" localhost
localhost | SUCCESS => {
    "changed": false,
    "name": "org.openssh.sshd",
    "status": {
        "current_pid": "-",
        "current_state": "unloaded",
        "error": "",
        "previous_pid": "-",
        "previous_state": "unloaded",
        "status_code": null
    }
}

This allows the module to be used with services such as com.openssh.sshd, when
the name of the plist file doesn't match the service name.

fixes ansible-collections#5932
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) labels Nov 6, 2024
- Name of the V(.plist) file for the service.
- Defaults to V({name}.plist).
type: str
version_added: 10.1.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimistic concurrency: that the PR will be merged within the right window.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10.1.0 should be fine!

@felixfontein felixfontein added backport-10 Automatically create a backport for the stable-10 branch check-before-release PR will be looked at again shortly before release and merged if possible. labels Nov 6, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! If nobody objects, I'll merge this once it's clear there will be no 10.0.x bugfix release.

@ansibullbot ansibullbot added stale_ci CI is older than 7 days, rerun before merging has_issue labels Nov 14, 2024
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Nov 16, 2024
@felixfontein felixfontein merged commit 737717d into ansible-collections:main Nov 16, 2024
126 checks passed
Copy link

patchback bot commented Nov 16, 2024

Backport to stable-10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-10/737717d015f5e8ab6878662cacfa82cd39cd0e07/pr-9102

Backported as #9137

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Nov 16, 2024
This allows the module to be used with services such as com.openssh.sshd, when
the name of the plist file doesn't match the service name.

fixes #5932

(cherry picked from commit 737717d)
@felixfontein
Copy link
Collaborator

@moreati thanks for your contribution!

felixfontein pushed a commit that referenced this pull request Nov 16, 2024
)

launchd: Add plist option (#9102)

This allows the module to be used with services such as com.openssh.sshd, when
the name of the plist file doesn't match the service name.

fixes #5932

(cherry picked from commit 737717d)

Co-authored-by: Alex Willmer <alex@moreati.org.uk>
@moreati moreati deleted the issue5932 branch November 17, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-10 Automatically create a backport for the stable-10 branch feature This issue/PR relates to a feature request has_issue module module new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

launchd: Unable to restart ssh service in Macos
3 participants