I want to create symbolic link only if its not present
I have written below recipe
link '/home/user1/veera' do
to '/usr/local/veera-10.0'
only_if {test -L /home/user1/veera}
end
I tried below condition in recipe
only_if {test -L /home/user1/veera}
But it updates the symlink next time when chef runs next time(if it its changed).But i don't want that.
I want to skip this if symlink exist and create only when symlink it doesn't exists.
Also tried this
link '/home/user1/veera' do
to '/usr/local/veera-10.0'
not_if { File.symlink?('/home/user1/veera') }
end
But its still updating the symlink when changed on next chef run