role-php/tasks/main.yml

17 lines
429 B
YAML
Raw Normal View History

2022-12-19 18:39:12 +00:00
---
- name: "Check PHP version"
ansible.builtin.shell: "php --version | cut -d' ' -f 2 | cut -d'.' -f 1-2 | head -1"
args:
executable: /bin/bash
register: php_active_version_sout
changed_when: false
failed_when: false
when: php_version_check|bool
- name: "Set active version"
set_fact:
php_active_version: "{{ php_active_version_sout.stdout }}"
when: php_version_check|bool
- include_tasks: install.yml