mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Example clarifies how regexp's extract PHP version #
This commit is contained in:
parent
f40589c86d
commit
6364fa4dad
1 changed files with 1 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
||||||
# INSPIRED BY: github.com/iiab/iiab/blob/master/roles/nodejs/tasks/main.yml#L10-L54
|
# INSPIRED BY: github.com/iiab/iiab/blob/master/roles/nodejs/tasks/main.yml#L10-L54
|
||||||
|
|
||||||
- name: Try to run 'php -v' to get PHP version
|
- name: Try to run 'php -v' to get PHP version
|
||||||
|
# e.g. converts multi-line "PHP 7.0.33-0ubuntu0.16.04.5 (cli) ( NTS ) ..." to "7.0.33"
|
||||||
shell: php -v | head -1 | sed 's/^[^0-9.]*//' | sed 's/[^0-9.].*//'
|
shell: php -v | head -1 | sed 's/^[^0-9.]*//' | sed 's/[^0-9.].*//'
|
||||||
register: php_version_installed
|
register: php_version_installed
|
||||||
#ignore_errors: yes # NOT NEC: if php is not installed, php_version_installed.stdout will get set to ""
|
#ignore_errors: yes # NOT NEC: if php is not installed, php_version_installed.stdout will get set to ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue