I have my symlink and want to create new symlink, that points to the same location that first symlink points. I know I can use cp -d /path/to/symlink /new/path/to/symlink
. But how do it with ansible module?
I was trying copy: src=/path/to/symlink dest=/new/path/to/symlink follow=yes
but it makes a copy of symlink instead create new symlink. Any ideas?
You have two option here.
1) Create New Symlink using file module.
- name: Create symlink
file: src=/path/to/symlink dest=/new/path/to/symlink state=link
2) Run your working command to copy symlink using shell it will do the same.
- name: Create symlink
shell: cp -d /path/to/symlink /new/path/to/symlink
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With