diff --git a/changelogs/fragments/2960-launchd-validation-check.yaml b/changelogs/fragments/2960-launchd-validation-check.yaml new file mode 100644 index 0000000000..15cb3c3fa5 --- /dev/null +++ b/changelogs/fragments/2960-launchd-validation-check.yaml @@ -0,0 +1,2 @@ +bugfixes: + - launchd - fixed sanity check in the module's code (https://github.com/ansible-collections/community.general/pull/2960). diff --git a/plugins/modules/system/launchd.py b/plugins/modules/system/launchd.py index 30a5ed02b2..e8d82ff318 100644 --- a/plugins/modules/system/launchd.py +++ b/plugins/modules/system/launchd.py @@ -159,7 +159,7 @@ class Plist: """Finds the plist file associated with a service""" launchd_paths = [ - os.path.expanduser('~/Library/LaunchAgents'), + os.path.join(os.getenv('HOME'), 'Library/LaunchAgents'), '/Library/LaunchAgents', '/Library/LaunchDaemons', '/System/Library/LaunchAgents', diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 6c60a4c6f8..f313df3620 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -41,7 +41,6 @@ plugins/modules/remote_management/manageiq/manageiq_tags.py validate-modules:par plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/launchd.py use-argspec-type-path # False positive plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice plugins/modules/system/puppet.py use-argspec-type-path diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index e3785767b1..6858d92104 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -40,7 +40,6 @@ plugins/modules/remote_management/manageiq/manageiq_tags.py validate-modules:par plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/launchd.py use-argspec-type-path # False positive plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice plugins/modules/system/puppet.py use-argspec-type-path diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 197868474b..9b0e047d57 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -40,7 +40,6 @@ plugins/modules/remote_management/manageiq/manageiq_tags.py validate-modules:par plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/launchd.py use-argspec-type-path # False positive plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice plugins/modules/system/puppet.py use-argspec-type-path diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index e21faf2ce3..65611001b1 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -62,7 +62,6 @@ plugins/modules/net_tools/nios/nios_zone.py validate-modules:deprecation-mismatc plugins/modules/net_tools/nios/nios_zone.py validate-modules:invalid-documentation plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/launchd.py use-argspec-type-path # False positive plugins/modules/system/puppet.py use-argspec-type-path plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc plugins/modules/system/runit.py validate-modules:parameter-type-not-in-doc # deprecated param - removed in 4.0.0