Skip to content

Commit

Permalink
fix: restore pecl libraries install, fail message for 2.5 php/distrib…
Browse files Browse the repository at this point in the history
… compatibility
  • Loading branch information
juju4 committed Nov 10, 2024
1 parent 75a5f6a commit b2379fb
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
- name: Include webserver+distribution-specific variables
ansible.builtin.include_vars: "{{ misp_webserver }}-{{ ansible_distribution }}.yml"

- name: Import debian
ansible.builtin.fail:
msg: "MISP 2.5 requires PHP 8 which starts with Ubuntu 24.04 and Debian 12"
when:
- misp_version == '2.5'
- not (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version >= 24)
- not (ansible_distribution == 'Debian' and ansible_distribution_major_version >= 12)

- name: Import debian
ansible.builtin.import_tasks: debian.yml
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
Expand Down Expand Up @@ -261,16 +269,19 @@
- name: Import composer
ansible.builtin.import_tasks: composer.yml

### https://github.com/geerlingguy/ansible-role-php-pecl/blob/master/tasks/main.yml
### FIXME! pecl/redis requires PHP (version >= 7.0.0, version <= 7.1.0, excluded versions: 6.0.0)
# - name: Install PECL libraries.
# ansible.builtin.shell: "yes \"\" | pecl install {{ item }}"
# register: pecl_result
# changed_when: "pecl_result.rc == 0"
# failed_when: "not (('already installed' in pecl_result.stdout) or ('install ok:' in pecl_result.stdout))"
# with_items:
# - redis
# when: ansible_os_family == "RedHat"
- name: Install PECL libraries.
ansible.builtin.command: "{{ item }}"
loop:
- pecl channel-update pecl.php.net
- pecl install brotli
- pecl install simdjson
- pecl install zstd
register: pecl_result
changed_when: "pecl_result.rc == 0"
failed_when: "not (('already installed' in pecl_result.stdout) or ('install ok:' in pecl_result.stdout))"
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_major_version >= 24

- name: Setup MISP Cake config
ansible.builtin.copy:
Expand Down

0 comments on commit b2379fb

Please sign in to comment.