-
Notifications
You must be signed in to change notification settings - Fork 116
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
Custom playbook can't find "task_src" lookup plugin #117
Comments
Hi, sorry for taking so long to respond. My development environment looks like this:
I just tried your setup by adding a wordpress playbook as So, let's try to recap - what's your Ansible Controller based on, MacOSX, Linux, Windows? Do you have DebOps roles and playbooks installed in Also, I'm developing all my roles by doing basically what you have done, haven't had any problems like that yet. |
I'm on MacOSX. I installed Debops using Here is the # Ansible configuration file generated by DebOps, all changes will be lost.
# You can manipulate the contents of this file via `.debops.cfg`.
[ssh_connection]
[paramiko]
[defaults]
filter_plugins = "/Users/carlalexander/Projects/carlalexander/debops/ansible/filter_plugins":"/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/filter_plugins":"/usr/share/ansible/filter_plugins"
hostfile = /Users/carlalexander/Projects/carlalexander/debops/ansible/inventory
roles_path = /Users/carlalexander/Projects/carlalexander/debops/roles:/Users/carlalexander/Projects/carlalexander/debops/ansible/roles:/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/../roles:/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/roles:/etc/ansible/roles
connection_plugins = "/Users/carlalexander/Projects/carlalexander/debops/ansible/connection_plugins":"/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/connection_plugins":"/usr/share/ansible/connection_plugins"
library = /Users/carlalexander/Projects/carlalexander/debops/ansible/library:/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/library:/usr/share/ansible/library
vars_plugins = "/Users/carlalexander/Projects/carlalexander/debops/ansible/vars_plugins":"/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/vars_plugins":"/usr/share/ansible/vars_plugins"
ansible_managed = This file is managed remotely, all changes will be lost
action_plugins = "/Users/carlalexander/Projects/carlalexander/debops/ansible/action_plugins":"/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/action_plugins":"/usr/share/ansible/action_plugins"
callback_plugins = "/Users/carlalexander/Projects/carlalexander/debops/ansible/callback_plugins":"/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/callback_plugins":"/usr/share/ansible/callback_plugins"
lookup_plugins = "/Users/carlalexander/Projects/carlalexander/debops/ansible/lookup_plugins":"/Users/carlalexander/Library/Application Support/debops/debops-playbooks/playbooks/lookup_plugins":"/usr/share/ansible/lookup_plugins" When I check the content of I'd clarify that the full command that I run is The only difference with the setup that you described is that my custom playbook is in the The whole thing is very odd. |
I remember that there were some problems with space in the path ("Application Support"), could you move the DebOps playbooks to a path without space and try it? Also, what happens when you run:
Basically, bypass the Could you try doing the same in a Linux VM? It looks to me like a MacOSX issue rather than DebOps scripts or Ansible. Ufortunately, I don't use Macs at the moment. :-) You could try coming over to #debops @ FreeNode, some users there use Macs, perhaps they could help with debugging. |
@carlalexander So this is Ansible issue after all? So that means that on MacOSX putting playbooks in current default (Application Support) will cause these sort of errors each time for everyone... I would change the default then, what do you think? |
I think you should. I'm no expert, but I think somewhere under |
No, I guess we could go with |
This clearly is a bug in Ansible, still present in 1.7.2, see ansible/ansible#8555. I suggest keeping the applications behaviour of debops, which means no change. But if you decide to change, I'm fine with it - it's your project :-) |
Wait, why should the playbooks/roles be per-user account? Custom ones, sure and inventory sure... but the debops stuff should be global in nature, unless I am missing the question here. I personally dislike much of the ~/Library stuff for OSX and instead use the underlying unixy layout. |
DebOps scripts sure, they can be in |
This issue is not about this question. This issue is about spaces in paths on OSX. They may happen even in global directories. |
Regarding spaces in paths, yeah that is an ansible issue. Regarding where the playbooks/roles are at, I believe a far better solution would be to rely on the global /etc/debops.cfg file to indicate where they should be installed. I, for one, do not want per-user roles/playbooks. |
I think |
Re: debops/debops#117 (comment)
|
Same thing happening to me right now on OS X, while I saw no issue on Linux. ansible.cfg
I call
Playbook execution:
|
edit: actually changing the ansible.cfg
The error still shows up after copying the DebOps |
Please note that the You'll have to add this into
This will be prepended to the paths debos generates automatically. For more details, please see the manual. |
@htgoebel yes, that's what I did, but on OS X the space in the path doesn't seem to be the issue anymore (I'm using Ansible 2.1.1.0). I'm suspecting an issue when including DebOps roles in custom playbooks, since No issue on Linux. |
I can confirm that the playbook location is the issue. Check this out: playbook in local project tree (
same playbook moved to DebOps tree (
|
@htgoebel @drybjed Aha! The issue on OS X is actually caused by the quotes inside the This fails: While this works: I'm using the zsh v5.2 shell and Ansible 2.1.1.0. |
Well, the raw value is taken from .debops.cfg and prepended uninterpreted into ansible.cfg. So I consider this solved. |
@htgoebel my |
using: zsh 5.2, ansible 2.1.2.0 |
@SatWiz you have to
This works well as long as you're the only user executing the playbooks. If not it might get trickier to manage because the path to the local DebOps playbooks is user specific. |
Thanks @antoineco for your explanations but it did not work out for me. At the end my ansible.cfg files is back again quoted with all of .debops.cf added in front of the variables. A bit strange is than some variables are generated without quotes like hostfile, roles_path and library. |
The quotes are added for ansible >= 1.7 since fe61193 "Add work-around for ansible's buggy handling of paths containing spaces." |
@SatWiz I actually edited my I have a feeling this issue is specific to the Zshell though (which I am also using) but I can't confirm right now. Have you tried from a Bash shell? |
@antoineco, bash is having the same issue. @htgoebel it works for me without complaining about the plugin when reverting the changes in fe61193.
|
@htgoebel is there a simple test to check the plugins is loaded correctly? |
runs smoothly with osx now by reinstall ansible with pip install ansible. |
Fixed by reinstalling ansible with pip as @SatWiz suggested and adding this to [defaults]
lookup_plugins = ~/Library/Application Support/debops/debops-playbooks/playbooks/lookup_plugins:/usr/share/ansible/lookup_plugins |
@drybjed looks like some roles depend on the task_src plugin but do not list it as a dependency. For example, running ansible-nginx requires installing the full debops package. It seams reasonable to me to explicitly state this dependency. Also, is there a way to obtain the lookup plugins without installing debops? I've looked through the debops-tools and debops-playbooks but with no success. |
The lookup plugins can be found in the I suppose that this could be explained briefly in the documentation of each role that uses the custom lookups. |
@drybjed thanks, I see it now. What is the right way to install |
You could just clone it somewhere, it's just a |
I ran into the same issue and I fixed it by setting [paths]
data-home = ~/.local/share/debops Now |
I'm trying to build a
wordpress
application role in a separate role/playbook. I'm using thephpmyadmin
role as a base. So you get dependencies that look like:The role is in its own playbook called
wordpress.yml
that follows theapplication.yml
standard.I get this error when I run
debops wordpress
:It finds the plugin if I just assign the host to the group
debops_nginx
and rundebops
. It only happens if I use a custom role/playbook where I usedebops.nginx
as a dependency. The playbook runs fine without it.I tried copying the
task_src.py
plugin into my debops project, but it's still not picked up. I also tried overwriting thelookup_plugins
in.debops.cfg
to point to it. That didn't work either. It doesn't seem likelookup_plugins
is picked up at all with a custom playbook.The text was updated successfully, but these errors were encountered: