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

Add missing "php_bin" var into Ubuntu-20.04's #18

Closed egypcio closed 1 year ago

egypcio commented 1 year ago

Description

Add missing php_bin var into Ubuntu-20.04's

Motivation and Context

Ubuntu 20.04 is mentioned to be one of the recommended systems to run MISP on top of, so we setup variables used to configure recent Ubuntu 20 and 22 LTS systems to be present in both of the YAML var files.

How Has This Been Tested?

Minor change, ran regular lint checks against YAML files and applied the role to a fresh installed VM.

Types of changes

Checklist:

juju4 commented 1 year ago

Valid but seems working without. Did you find edge cases where issues? can you develop them?

egypcio commented 1 year ago

Valid but seems working without. Did you find edge cases where issues? can you develop them?

so far, for this minor fix, no edge cases to consider.

edge cases can be avoided too, should other versions of PHP land into recent Ubuntu releases.

maybe you would like to check it out yourself:

e.g.: the installation of composer works, but the code defaults like "{{ php_bin | default('php') }}" on one of its tasks, while the default value for php_bin would be omitted on others; the same happens with background-jobs.yml tasks where we see "{{ php_bin | default(omit) }}".

$ grep --color -r -E 'php_.*defa.*php.)' *
tasks/composer.yml:  ansible.builtin.command: "{{ php_bin | default('php') }} -q /tmp/composer-installer.php --install-dir=/usr/local/bin --filename=composer"
$ grep -r -E 'php_.*omit' * 
tasks/background-jobs.yml:    executable: "{{ php_bin | default(omit) }}"
tasks/background-jobs.yml:    executable: "{{ php_bin | default(omit) }}"
tasks/composer.yml:        executable: "{{ php_bin | default(omit) }}"
tasks/composer.yml:        executable: "{{ php_bin | default(omit) }}"
tasks/composer.yml:        executable: "{{ php_bin | default(omit) }}"
tasks/composer.yml:        executable: "{{ php_bin | default(omit) }}"
tasks/composer.yml:        executable: "{{ php_bin | default(omit) }}"

shall we "flip the switch" and take this PR into something that fixes all those "omit" cases, please let me know (or just commit the changes on top of it).

_PS: php_bin is also missing on Ubuntu 18.04, but as it would be soon reaching its EOL, we ignored. it should be set to /usr/bin/php7.2 for that particular release._

juju4 commented 1 year ago

I found edge case on recent releases with php8 conflicting with legacy php7.4. I believe I cleaned them out and only 7.4 should be left

Merging this and adding for 18.04 too just in case.

Thanks