diff --git a/changelogs/fragments/1179-composer_require_v2_idempotence_fix.yml b/changelogs/fragments/1179-composer_require_v2_idempotence_fix.yml new file mode 100644 index 0000000000..03874b6775 --- /dev/null +++ b/changelogs/fragments/1179-composer_require_v2_idempotence_fix.yml @@ -0,0 +1,4 @@ +--- +bugfixes: + - composer - fix bug in command idempotence with composer v2 + (https://github.com/ansible-collections/community.general/issues/1179). diff --git a/plugins/modules/packaging/language/composer.py b/plugins/modules/packaging/language/composer.py index 6fe6ade6e2..dc564932d2 100644 --- a/plugins/modules/packaging/language/composer.py +++ b/plugins/modules/packaging/language/composer.py @@ -145,7 +145,11 @@ def parse_out(string): def has_changed(string): - return "Nothing to install or update" not in string + for no_change in ["Nothing to install or update", "Nothing to install, update or remove"]: + if no_change in string: + return False + + return True def get_available_options(module, command='install'):