[PR #11689/a4bba992 backport][stable-12] composer - make create-project idempotent, add force parameter (#11700)

composer - make `create-project` idempotent, add `force` parameter (#11689)

* composer - make create-project idempotent, add force parameter

Adds a check for an existing composer.json in working_dir before running
create-project, so the task is skipped rather than failing on second run.
A new force parameter allows bypassing this check when needed.

Fixes #725.



* changelog fragment: rename to PR number, add PR URL



---------


(cherry picked from commit a4bba99203)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
patchback[bot]
2026-03-27 21:34:35 +01:00
committed by GitHub
parent 1a1056099c
commit de180d01e0
4 changed files with 97 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
minor_changes:
- composer - add ``force`` parameter; when ``command=create-project``, the module now checks
whether a ``composer.json`` already exists in ``working_dir`` and skips the command if so,
making the task idempotent. Set ``force=true`` to always run the command regardless
(https://github.com/ansible-collections/community.general/issues/725,
https://github.com/ansible-collections/community.general/pull/11689).