Hi Rakesh,

I create the following play for you with a variable that you can loop
and access the src and dest for the links.

---
- name: create softlink
  hosts: servers
  gather_facts: off
  vars:
    sf_links:
      - src: /tmp/Test_10.0.0
        dest: /tmp/Test
      - src: /tmp/Test_11.0.0
        dest: /tmp/Prod
      - src: /tmp/Test_13.0.0
        dest: /tmp/Dev
  tasks:
    - name: create softlinks
      file:
        src: "{{item.src}}"
        dest: "{{item.dest}}"
        state: link
      loop: "{{sf_links}}"


On Thu, Mar 19, 2020 at 1:34 AM Rakesh Parida <[email protected]>
wrote:

> Hi ,
>
> I have 3 directories in /tmp as follows:
> Test_10.0.0
> Test_11.0.0
> Test_13.0.0
>
> other directories in /tmp
> Test
>  Prod
>  Dev
>
> Now i want to create soft link of
>
> Test_10.0.0 - Test
> Test_11.0.0 - Prod
> Test_13.0.0 - Dev
>
> I want to create a playbook which does it.
> Can anybody help in this regard
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7fe98ae3-4fc6-452f-bd2b-79121dd651e2%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/7fe98ae3-4fc6-452f-bd2b-79121dd651e2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFFkYJJ1piBSiTN0Qn1MZteBM5wwpfQGEvsRK-66dSy9arW4KA%40mail.gmail.com.

Reply via email to