Unable to symlink directory from role files

Hello list,

I have a role with the following structure:

$ tree
.
├── files
│ └── powerline
│ └── […]
└── tasks
└── main.yml

And my tasks file has, among other tasks, the following one:

  • name: symlink custom config files
    file: src=powerline dest=~/.config/powerline state=link force=yes

When I execute this task, my ~/.config/powerline becomes:

ls -l ~/.config/powerline
lrwxrwxrwx. 1 borges borges 9 Apr 20 14:45 /home/borges/.config/powerline → powerline

As you can see, it doesn’t resolve to the correct place (apparently it’s using a relative smylink). How can I specify file to use absolute paths to role files without hardcode the entire path? Or there is another solution to this problem?

Thank you,
Paulo