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
file module: symlink error #7627
Comments
In queue for reproduction. I suspect most people are creating symlinks with full paths, rather than relative symlinks, or there's another scenario afoot. However, it should be noted that there ARE integration tests for symlink creation in Ansible What would probably be most helpful is to add a test that duplicates your problem here: https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_file/tasks/main.yml |
This appears to be your problem
Not sure how this is expected to work when both the source and dest are relative. |
Hm, there's always a basedir that handles relative paths. As showed, in 1.5.5 that does work. failed: [vega] => {"failed": true, "item": "", "path": "/home/seafile/ginsys/ccnet/mykey.peer", "src": "/home/seafile/ginsys/lib/ccnet/mykey.peer", "state": "absent"} And, yes, "/home/seafile/ginsys/lib/ccnet/mykey.peer" existed. |
Here is the updated play with absolute paths, same error:
Notice the |
what version? this was broken for a while but we fixed it. i just tested in latest dev:
and got this:
and i checked:
|
Sounds related to #7515 Solution that works for me at the moment - note force must be set to 'yes' otherwise an error will be generated and the symlink will not be created.
Example:
|
I ran into this today too. |
Absolute and relative path links do not work for me on devel, unless force=true is used |
I have created the above patch to resolve this, if you'd like to test it. I've run it against the sample play you've included and it resolves the issue there. |
@bcoca I had problems to reproduce it myself, until I noticed, the fault is over SSH only, not with connection local (must have been a paste error in my example playbook.) Now I can confirm the bug triggers
Between 1.6.0 and 1.6.2 it was introduced by 1248d2c, which is a cherry pick of 062e829 in 1.7-devel, after which the bug existed in devel too. But that was fixed by 202ac68 I see now. By now I'm not sure what James` latest patch solved, but I could reproduce an error with this playbook:
On devel, this fails both with -c ssh and -c local. Though, that is normal, as my test files live in ~/tmp. If I move them to ~, it also works with -c ssh! So this seems very OK with me :) |
my testing is always with -c local, so this shows the flaw with that. This |
I've gone ahead and merged this in. Please let us know if you continue seeing any problems regarding this issue. Thanks! |
Issue Type:
Bug Report: file module, state link got broken some time ago.
I'm not sure what more exactly triggers this. As this seems such intrusive, I'm flabbergasted it didn't got discovered or mentioned earlier.
Ansible Version:
Environment:
Ubuntu 13.10 but probably N/A
Summary:
Making a basic symlink without any extra options got broken in 1.6
Steps To Reproduce:
Expected Results:
with ansible/release1.6.0
Actual Results:
with ansible/release1.5.5:
The text was updated successfully, but these errors were encountered: