-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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: state=link should provide ability to create symlinks relative target dir #7515
Comments
Thanks for filing a ticket! I am the friendly GitHub Ansibot. I see you did not fill out your issue description based on our new issue template. Please copy the contents of this template and paste it into the description of your ticket. Our system will automatically close tickets that do not have an issue template filled out within 7 days. Please note that due to large interest in Ansible, humans may not comment on your ticket if you ask them questions. Don't worry, you're still in the queue and the robots are looking after you. |
I believe it is a regression, this feature worked a few days ago and just stopped working now. |
It must be a regression, I remember using the same syntax earlier and it used to work fine:
|
this works for me ansible -m file -a "state=link src=../test.yml |
It's not working for me on ansible 1.7 git 2014-05-25. Just tried (kernel_ver = 3.14.4, src_main_dir = /usr/src) :
Output:
|
I believe this recent patch created the issue:
|
so my example worked because of force=yes, but both should have worked w/o it, the relative path was calculated incorrectly from recent patch. force=yes should have worked for you but it should not have been required. PR I submitted should solve all current issues, there is still at least a corner case I need to flush out. |
Great, looking forward to the fix thanks! For now using a shell task with " rm -f link ; ln -s source target " In my case per the error message above, force=yes would have targeted /root/linux-3.14.4 which is wrong. |
no, that is only the error message from the incorrect relative source, the |
FYI, a eselect module would be a better fix for symlinking the kernel |
I’m using Slackware, no eselect there :) Regards, On May 25, 2014, at 16:07, Brian Coca notifications@github.com wrote:
|
my bad, I'm used to all 'build latest kernel' crowed to be on |
Thanks for the fix @bcoca! I just ran into this issue when symlinking an Apache configuration on a Debian machine. |
Got the same problem with 1.6.2. I'd work around it by specifying |
The above commit has been merged in, and should resolve this. Please let us know if you continue seeing any problems related to this issue, thanks! |
Thanks for the changes! This works fine for me as long as I use 'force=yes.' I'm perfectly happy with 'force=yes' for now but given the scenario below Existing symlink (in /usr/src):
Ansible task to modify symlink:
|
Issue Type:
Bug Report
Ansible Version:
ansible 1.7
git 2014-05-23
Environment:
Running on Mac OSX 10.9.3 managing Slackware64 14.1
Summary:
Currently it appears there is no way to create a symlink relative to the directory of the target.
For ex, would like to be able to achieve the following:
but Ansible only provides the ability to create fully specified links (i.e. ln -s /usr/src/linux-3.10.40 /usr/src/linux
The functionality is important to have because relative symlinks continue to function when an entire directory containing them is moved, while fully specified symlinks would break in such a scenario.
Steps To Reproduce:
Create task:
The symlink creation will fail, it is targeting the wrong 'src'
Expected Results:
Would expect a new link /usr/src/linux with target "linux-3.14.4"
Actual Results:
Task error, attempted to create a symlink targeting /root/linux-3.14.4 (wrong)
but the target obviously doesn't exist.
The text was updated successfully, but these errors were encountered: