Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre/post hook tasks do not process included tasks #383

Open
gabor-udvari opened this issue Jul 25, 2017 · 1 comment
Open

Pre/post hook tasks do not process included tasks #383

gabor-udvari opened this issue Jul 25, 2017 · 1 comment

Comments

@gabor-udvari
Copy link

I have a set of existing tasks which I would like to run during the DebOps playbooks with pre/post hooks. When I include my own tasks into the pre/post hook tasks, then the steps inside the included task will not be processed:

example nginx/pre_main.yml:

---
- debug:
    msg: "Pre hook executed"

- include: tasks/custom.yml

The debug message (and any other steps) are correctly executed, but the include is ignored. If I simply make the nginx/pre_main.yml a symbolic link to the nginx/task/custom.yml then everything is working as expected. But I can only reference a single file that way.

$ ls -l nginx/pre_main.yml
lrwxrwxrwx 1 udi udi 17 2017-07-24 21:37 nginx/pre_main.yml -> tasks/parking.yml

I tried the include with every possible relative path and absolute path, not finding the file is not the issue.

@drybjed
Copy link
Member

drybjed commented Jul 25, 2017

The lookup module does not support includes - this is not an Ansible mechanism, but a custom DebOps lookup plugin. You need to put your tasks in the nginx/pre_main.yml file directly. Or, create a custom playbook that includes the debops.nginx role and its dependencies, and your own custom role.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants