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

Installation guidelines will break all other modules/playbooks #142

Closed
spikedrba opened this issue Nov 30, 2016 · 5 comments
Closed

Installation guidelines will break all other modules/playbooks #142

spikedrba opened this issue Nov 30, 2016 · 5 comments

Comments

@spikedrba
Copy link

Hi,

I just installed ntc, worked with it for a while and then went back working with other playbooks. When I ran one I got back this error:

fatal: [vbox-pxe]: FAILED! => {"failed": true, "msg": "module (setup) is missing interpreter line"}

soon after that I realized that none of my playbook was working anymore. Since installing ntc was the lat change I made I undid it and everything started working again.

Eventually I tracked down the problem to the fact that the installation guidelines from git also includes a setup.py in the module dir. When working with ntc gather_facts is false so everything works, but when gather_facts is true and setup is ran, because ntc is in the library path, its setup.py gets loaded instead of ansible's setup module, producing the error above.

I can confirm this by deleting setup.py both in ntc-ansible and ntc-templates. When both are gone all my standard playbooks that gather_facts worked again.

I don't know what an appropriate fix is but for now it may be worth to point this out in the installation guidelines.

best,

@GGabriele
Copy link
Contributor

Hi @spikedrba , sorry for the delay in coming back to you!
Thanks for having got deep into this, I've personally never met this issue and it's definitely something good to be aware of.

Do you know if this happen with both pip and source installation?

@bdowling
Copy link
Contributor

bdowling commented Jan 4, 2017

Ah, I had forgotten about this issue, it stopped me from trying ntc-ansible for a while when I encountered this. I think it is probably more an issue in ansible than ntc, but if you try to use the repo folder directly, the setup.py (in both ntc and ntc-templates) and even the setup.cfg file would get loaded by execute_module. Renaming those files works around this (DISABLE-), but I think the real fix would be in ansible to rename the setup module to something less generic or perhaps have a tighter search path for core modules :(

@jasonbarbee
Copy link

Ran into this also today. I had to rename the files as mentioned ntc-ansible/setup.py, setup.cfg and ntc-templates/ setup.cfg so that ansible would work. I wasn't even calling any of the ntc-ansible modules in my playbooks at the time.

@spikedrba
Copy link
Author

hey @GGabriele , was away for a month, thanks for your patience. I don't understand the question about pip Vs clone. The git clone in ansible's module path is a requirement as far as I understand per your installation/setup instructions in the README, which is what I did when I set it up. Pip is only to install dependencies etc, but it won't change that doing the git pull will populate the ntc-ansible dir inside the ansible's module path with a setup.py file.
I don't know what the guidelines are to release ansible's modules, but the approach you're taking seems doomed to fail as far as I can see for as long as ansible will look for a setup.py. I agree with @bdowling that a good solution may be for ansible to use more specific names, but there may be others, not sure.

hope that helps,

Spike

@itdependsnetworks
Copy link
Contributor

Updated Readme to note this issue (and work around), and have been attempting to get ansible to change their setup.py to gather_facts.py.

@GGabriele should be able to close this since it is a known issue and workaround is documented.

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

5 participants