Skip to content

Commit

Permalink
fix(php-conflict): check and fix update-alternatives php for 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
juju4 committed Dec 14, 2024
1 parent d43ea77 commit a90d2ff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
ansible.builtin.import_tasks: nginx.yml
when: misp_webserver is defined and misp_webserver == 'nginx'

- name: Import php-conflict
ansible.builtin.import_tasks: php-conflict.yml

- name: Ensure Random source is configured
ansible.builtin.lineinfile:
dest: /etc/default/rng-tools
Expand Down
24 changes: 24 additions & 0 deletions tasks/php-conflict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---

- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto

- name: List installed php packages
ansible.builtin.debug:
msg: "{{ item }}"
loop: "{{ ansible_facts.packages | select('match', '^php-*') | list }}"

- name: Check debian alternatives
ansible.builtin.command:
cmd: update-alternatives --config php
become: yes
changed_when: false

- name: Set debian alternatives
ansible.builtin.command:
cmd: update-alternatives --set php /usr/bin/php7.4
become: yes
changed_when: false
when:
- (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version | int == 22)

0 comments on commit a90d2ff

Please sign in to comment.