juju4 / ansible-MISP

ansible role to setup MISP, Malware Information Sharing Platform & Threat Sharing
BSD 2-Clause "Simplified" License
51 stars 21 forks source link

Fix automation for task "Install PHP composer dependencies for background-jobs" #19

Closed egypcio closed 1 year ago

egypcio commented 1 year ago

Description

Fix automation for task "Install PHP composer dependencies for background-jobs"

Motivation and Context

The goal here is to have the closest as possible to a fully automated role being applied, instead of dealing with timeouts and multiple executions of playbooks (which apply the role itself).

This patch's changes make use of parameters provided by the Ansible composer module instead of populating all options as extra arguments to the module inside the task we want to automate.

For more information, please read the official composer documentation and a thread on StackOverflow linked below.

How Has This Been Tested?

root@misp:/var/www/_MISP/MISP/app# sudo -H -u www-data composer require --with-all-dependencies \
       supervisorphp/supervisor:^4.0 \
       guzzlehttp/guzzle \
       php-http/message \
       lstrojny/fxmlrpc
The root-cause for this timeout (see first screenshot) is triggered by the following:

Do you trust "php-http/discovery" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] ?

Screenshots

BEFORE (broken)

001_broken

AFTER (fixed)

002_fixed

Types of changes

Checklist:

juju4 commented 1 year ago

good points. I added some of those recently but yeah, not explored all the composer options