diff --git a/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py b/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py index 20b0c0a659c..2993c1107cc 100644 --- a/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py +++ b/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py @@ -140,6 +140,9 @@ def set_publisher(module, params): def unset_publisher(module, publisher): + if not publisher in get_publishers(module): + module.exit_json() + rc, out, err = module.run_command( ["pkg", "unset-publisher", publisher], check_rc=True