Here is my variable file:

cat vars.yml
---

  layers:
    - name: APP
  layers:
    - name: WLS


Here is my playbook

cat varloop.yml
---

    hosts: localhost
    vars_files:
      - vars.yml



    tasks:
      - name: Create sublinks based of bad.txt files
        include_tasks: "{{ playbook_dir }}/inner.yml"
        loop: "{{ layers }}"
        loop_control:
          loop_var: my_result

inner.yml
- name: Generate JSON data
  block:
    - file: path="{{ playbook_dir }}/dashboard/{{ my_result.name }} 
state=directory recurse=yes"


However, I'm getting the following error running the code:

TASK [file] 
*************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "file 
(/tmp/dashboard/APP state=directory recurse=yes) is absent, cannot continue"
, "path": "/tmp/dashboard/APP state=directory recurse=yes"}

I was expecting the play to create the directory "/tmp/dashboard/APP", 
however it errors and fails.  Can you please suggest ? 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0fe8246b-1d71-44c4-baa0-6185815366a1%40googlegroups.com.

Reply via email to