Comments (10)
This was fixed today in PR #64 — thanks!
from ansible-role-php-versions.
I stumbled upon this issue when trying to use php-versions role in conjunction with the php role. I tried setting the variable php_packages: ["php8.0"]
of the php role to get around installing php8.0-json. The problem is that the php_packages is only set in that role if it was not defined before (line 20 task of geerlingguy.php/tasks/main.yml), thus it gets the default __php_packages. And the php_packages variable is defined (conditionally to hostvars) in the php-versions role (line 8 taks of geerlingguy.php-versions/tasks/main.yml).
I circumvent the problem by setting the php_packages between the roles execution:
---
- hosts: all
tasks:
- name: import php-versions role
import_role:
name: geerlingguy.php-versions
- name: "set php_packages fact to circumvent issue #57"
set_fact:
php_packages:
- php8.0
- name: import php installation role
import_role:
name: geerlingguy.php
After that the installation proceeded. Maybe using hostvars is another way to make it work.
I don't have a good proposal to fix. Perhaps the same pattern of the php version role can be used in the php-versions role and set php_packages to __php_packages only if it is not defined before.
from ansible-role-php-versions.
On a second thought, these are two different problems. One is php8.0-json on a Debian as reported (which release?) or Ubuntu Focal, which I'm using, system and the other is the usage of the two roles with the php_packages variable.
from ansible-role-php-versions.
One is php8.0-json on a Debian as reported (which release?)
Debian 9
from ansible-role-php-versions.
I've also ran into this issue. Didn't find a way around except commenting the php-json line in the vars file.
I'd be happy to contribute a fix on this, however not sure what a good approach would be.
Do you have any suggestions here @geerlingguy?
from ansible-role-php-versions.
Hi there, in debian 10 it is still failing:
fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "The conditional check 'php_version is version('8.0', '>=')' failed. The error was: template error while templating string: no test named 'version'. String: {% if php_version is version('8.0', '>=') %} True {% else %} False {% endif %}\n\nThe error appears to have been in '/tmp/packer-provisioner-ansible-local/6068f2d6-4802-f5b4-976d-d2fb215b759d/roles-galaxy/php-versions/tasks/main.yml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Remove missing JSON extension for PHP 8.0 (included by default)\n ^ here\n"}
I've override php_version var with '7.4'
from ansible-role-php-versions.
@federicoaaguirre - What version of Ansible are you running? It looks like the version you're running is missing the version()
jinja2 test plugin.
from ansible-role-php-versions.
Hi @geerlingguy thanks for your quick response.! I'm try it with 2.4.4 and also i've tried it with 2.9.
from ansible-role-php-versions.
Ansible 2.4 is extremely out of date (it's been out of support for a couple years).
2.9 or later should work perfectly fine though. If you can confirm that you have installed Ansible 2.9 and you're still getting that error, please consider opening a new bug report.
from ansible-role-php-versions.
@geerlingguy thansk again it works perfect with 2.9.
from ansible-role-php-versions.
Related Issues (20)
- Task adding the Ondrej Sury's apt key tries to download it every time HOT 5
- It would be nice for upgrades, if you could note PHP versions that no longer need to be installed HOT 2
- Role is not present in the Ansible Galaxy HOT 3
- ansible-lint still sees errors HOT 1
- using php_version: '7.4' installs php 8.0 HOT 4
- The goal of this role!? HOT 1
- php8.0-json is part of PHP HOT 6
- [ERROR] Could not find the requested service php7.4-fpm HOT 4
- Fails on RHEL 8 when attempting to enable the PowerTools repo HOT 6
- Question: Is it possible to install 2 or more PHP versions at the same time? HOT 2
- please add dnf module reset -y php HOT 2
- The `php_install_recommends` value is created and not honoured. HOT 3
- Ensure dnf-plugins are installed on CentOS 8+. HOT 1
- Using 7.1 as php_version installs 8.2 and some 7.1 HOT 2
- Debian 12 php8.1-yaml unavailble HOT 2
- keep php versions already installed HOT 2
- adding modules HOT 3
- Failed to update apt cache
- Fault enabling CRB on AlmaLinux 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-php-versions.