geerlingguy / ansible-role-drupal

Ansible Role - Drupal
https://galaxy.ansible.com/geerlingguy/drupal/
MIT License
92 stars 51 forks source link

Role breaks when executed with include_role #57

Closed popstas closed 4 years ago

popstas commented 7 years ago

Hello, I have role site, it executes other roles with include_role. When I added tasks/drupal.yml:

- name: Setup drupal
  include_role:
    name: drupal
  vars:
    ...

It fails at task files include:

TASK [drupal : include] **************************************************************************************
fatal: [localhost]: FAILED! => {"failed": true, "reason": "the file_name '/home/popstas/projects/ansible/viasite-ansible/ansible-server/playbooks/roles/tasks/build-makefile.yml' does not exist, or is not readable"}

When I replaced:

- include: tasks/build-makefile.yml

to:

- include: build-makefile.yml

Do you want to merge PR with fix?

geerlingguy commented 7 years ago

@popstas - That seems like it would be a bug upstream in Ansible. Also, are you saying that - include: tasks/build-makefile.yml worked, and - include: build-makefile.yml didn't? Or vice-versa?

See: https://github.com/ansible/ansible/issues/21328 — I'm inclined to close this since I don't want to change (and potentially break) how this role works on a modular level. Instead, I'd recommend posting in that upstream Ansible issue and testing any potential fixes that result from that thread.

popstas commented 7 years ago

- include: tasks/build-makefile.yml - not worked

- include: build-makefile.yml - worked

Thank you, agreed, ansible/ansible#21328 seems same bug.

Anyway, I'm using about 10 your roles and don't seen - include: tasks/... in other your main.yml.

korzh-nick commented 7 years ago

I confirm

  • include: tasks/build-makefile.yml - not worked
  • include: build-makefile.yml - worked

ansible 2.4.1 ansible-lint 3.4.15

[kalebas@mate drupal-vm]$ ansible-lint provisioning/playbook.yml
WARNING: Couldn't open /home/kalebas/Desktop/staff/ansible/drupal-vm/provisioning/roles/geerlingguy.drupal/tasks/tasks/deploy.yml - No such file or directory
WARNING: Couldn't open /home/kalebas/Desktop/staff/ansible/drupal-vm/provisioning/roles/geerlingguy.drupal/tasks/tasks/update.yml - No such file or directory
WARNING: Couldn't open /home/kalebas/Desktop/staff/ansible/drupal-vm/provisioning/roles/geerlingguy.drupal/tasks/tasks/build-makefile.yml - No such file or directory
WARNING: Couldn't open /home/kalebas/Desktop/staff/ansible/drupal-vm/provisioning/roles/geerlingguy.drupal/tasks/tasks/build-composer.yml - No such file or directory
WARNING: Couldn't open /home/kalebas/Desktop/staff/ansible/drupal-vm/provisioning/roles/geerlingguy.drupal/tasks/tasks/build-composer-project.yml - No such file or directory
WARNING: Couldn't open /home/kalebas/Desktop/staff/ansible/drupal-vm/provisioning/roles/geerlingguy.drupal/tasks/tasks/install-site.yml - No such file or directory
stale[bot] commented 4 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 4 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.