Creating Soft Links Using Ansible - Playbook Error

After executing the yaml I am getting the attached error(screenshot). Can some tell me what is wrong with the following:


  • hosts: stapp01
    gather_facts: false
    become: true
    tasks:

    • name: Create empty file
      file:
      path: /opt/devops/blog.txt
      state: touch
      owner: tony
      group: tony
    • name: Create Symbolic link
      file:
      src: /opt/devops
      dest: /var/www/html
      state: link
  • hosts: stapp02
    gather_facts: false
    become: true
    tasks:

    • name: Create empty file
      file:
      path: /opt/devops/story.txt
      state: touch
      owner: steve
      group: steve
    • name: Create Symbolic link
      file:
      src: /opt/devops
      dest: /var/www/html
      state: link
  • hosts: stapp03
    gather_facts: false
    become: true
    tasks:

    • name: Create empty file
      file:
      path: /opt/devops/media.txt
      state: touch
      owner: banner
      group: banner
    • name: Create Symbolic link
      file:
      src: /opt/devops
      dest: /var/www/html
      state: link

@Tej-Singh-Rana any idea on that?

- hosts: stapp01
  gather_facts: false
  become: true
  tasks:
  - name: Create empty file
    file:
      path: /opt/devops/blog.txt
      state: touch
      owner: tony
      group: tony
  - name: Create Symbolic link
    file:
      src: /opt/devops
      dest: /var/www/html
      state: link