Skip to content

Commit

Permalink
Add support for overriding default PHP version.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Jan 8, 2024
1 parent 4679e47 commit 0951af0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions roles/webserver/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ webserver__php_default_packages:
webserver__php_packages_extra: []
webserver__php_versions:
- '8.2'
webserver__php_versions_default: '{{ (webserver__php_versions | community.general.version_sort)[-1] }}'

# The following default PHP-FPM dynamic settings are tailored towards
# use on the smallest available DigitalOcean droplet. For more
Expand Down
4 changes: 2 additions & 2 deletions roles/webserver/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
rule: 'allow'
notify: 'Restart UFW'

- name: 'Ensure the default PHP executable is set to the latest available version of PHP ({{ (webserver__php_versions | community.general.version_sort)[-1] }})'
- name: 'Ensure the default PHP executable is set to PHP {{ webserver__php_versions_default }}'
community.general.alternatives:
name: 'php'
path: '/usr/bin/php{{ (webserver__php_versions | community.general.version_sort)[-1] }}'
path: '/usr/bin/php{{ webserver__php_versions_default }}'

- name: 'Include basic Apache and PHP-FPM configuration tasks'
ansible.builtin.include_tasks: 'base-configure.yml'
Expand Down

0 comments on commit 0951af0

Please sign in to comment.