# Create list in playbook (Fortigate automation)

**URL:** <https://forum.ansible.com/t/create-list-in-playbook-fortigate-automation/32985>\
**Category:** Ansible Project\
**Created:** [May 20, 2020, 3:26pm UTC](https://forum.ansible.com/t/create-list-in-playbook-fortigate-automation/32985 "2020-05-20T15:26:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Arizaga](https://avatars.discourse-cdn.com/v4/letter/l/ecd19e/32.png) [@Luis\_Arizaga](https://forum.ansible.com/u/Luis_Arizaga)\
**Post date:** [May 20, 2020, 3:26pm UTC](https://forum.ansible.com/t/create-list-in-playbook-fortigate-automation/32985/1 "2020-05-20T15:26:01Z")

</div>

Hi everybody,

I’m using Ansible to automate Fortigate Firewalls provisioning and I’m having the following problems.

1. I have a playbook that first creates a couple of object addresses using one module (task Configure one fortinet address)
2. Then I want the playbook to pass a list with the name of the objects just created to another module in order to group the addresses I’ve just created. I tried to use Jinja2 within a playbook but I realized it doesn’t work (I’m a newbie don’t judge me lol)
3. I’m using the with\_item loop but this does not work as the module expects a list with all the objects included as one argument. With\_items command calls the module twice which does not work to group the objects 😢  
Is there a way to do that with Jinja2 or by using some other strategy? Any help or orientation would help me.

Thanks for you time, playbook is below =)

`
