diff --git a/tasks/main.yml b/tasks/main.yml index 3092770..d80ef6a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/php-conflict.yml b/tasks/php-conflict.yml new file mode 100644 index 0000000..b3203ad --- /dev/null +++ b/tasks/php-conflict.yml @@ -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)