1

I'm trying to imbricate 2 with_item.

At the moment I tried this but it doesn't work:

- name: Create log folder file: dest={{ item.dest }} # item from first with_item state=directory mode=0755 with_items: { dest: "{{ item.path_logs }}/gunicorn" } # item from flask apps { dest: "{{ item.path_logs }}/nginx" } # item from flask apps { dest: "{{ item.path_logs }}/supervisor" } # item from flask apps with_items: "{{ flask_apps }}" 

Is it possible to do it or should I make 3 tasks ?

1
  • Still not clear what you are asking. Commented Nov 19, 2016 at 20:26

1 Answer 1

2

There is an example of nested loops in the documentation.
For your case:

- name: Create log folder file: dest: "{{ item.0.path }}/{{ item.1 }}" state: directory mode: 0755 with_nested: - "{{ flask_apps }}" - ['gunicorn','nginx','supervisor'] 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.