ansible-collection-php_roles
ansible-collection-php_roles copied to clipboard
how to use the collection
trafficstars
Hey there! I'm trying to use the collection but all time it returns this error:
ERROR! the role 'php-versions' was not found in /etc/ansible/roles:/etc/ansible/roles:/etc/ansible
The error appears to be in '/etc/ansible/node.yml': line 8, column 6, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- php
- role: php-versions
^ here
And this is the playbook file
---
- name: Collections
hosts: all
collections:
- geerlingguy.php_roles
roles:
- php
- role: php-versions
vars:
php_version: '7.3'
Which is the example configuration. And this the path to collections, to make sure it is installed:
root@DESKTOP-WASBETTER:/etc/ansible# ll collections/ansible_collections/geerlingguy/php_roles/ total 72
drwxr-xr-x 1 root root 512 Dec 28 18:08 ./
drwxr-xr-x 1 root root 512 Dec 28 18:08 ../
-rw------- 1 root root 21 Dec 28 18:08 .gitignore
-rw------- 1 root root 1321 Dec 28 18:08 .gitmodules
-rw------- 1 root root 660 Dec 28 18:08 .travis.yml
-rw------- 1 root root 53799 Dec 28 18:08 FILES.json
-rw------- 1 root root 1036 Dec 28 18:08 MANIFEST.json
-rw------- 1 root root 3650 Dec 28 18:08 README.md
drwxr-xr-x 1 root root 512 Dec 28 18:08 roles/
drwxr-xr-x 1 root root 512 Dec 28 18:08 tests/
Thanks
Can you test if a task like the following works?
- name: Run the PHP Versions role.
include_role:
name: geerlingguy.php_roles.php_versions
And also, what version of Ansible are you running?
- role: php-versions -> - role: php_versions (with an underscore versus a hyphen) worked for me.
it took me an hour to understand that there was an error. Right: - role: php_versions