-name: SFTP | inbox
file: path="{{ item.home }}/{{ item.username }}{{ item.suffix1 }}/{{ item.inbox }}" mode=0775 owner="{{ item.username }}" group="{{ web_user }}" state=directory
with_items: "{{ clients }}"
when: suffix1 is defined
-name: SFTP | outbox
file: path="{{ item.home }}/{{ item.username }}{{ item.suffix1 }}/{{ item.outbox }}" mode=0775 owner="{{ item.username }}" group="{{ web_user }}" state=directory
with_items: "{{ clients }}"
when: suffix1 is defined
TASK [sftp-user : SFTP | inbox ****************************
skipping: [server1] => (item={u'username': u'test1', u'home': u'/home/test1', u'inbox': u'Inbox', u'outbox': u'Outbox'})
skipping: [server1] => (item={u'username': u'test2', u'inbox': u'Inbox', u'outbox': u'Outbox', u'home': u'/home/test2', u'suffix2': u'_right', u'suffix1': u'_left'})
skipping: [server1] => (item={u'username': u'test3', u'home': u'/home/test3', u'inbox': u'Inbox', u'outbox': u'Outbox'})
TASK [sftp-user : SFTP | outbox ****************************
skipping: [server1] => (item={u'username': u'test2', u'inbox': u'Inbox', u'outbox': u'Outbox', u'home': u'/home/test2', u'suffix2': u'_right', u'suffix1': u'_left'})
skipping: [server1] => (item={u'username': u'test1', u'home': u'/home/test1', u'inbox': u'Inbox', u'outbox': u'Outbox'})
skipping: [server1] => (item={u'username': u'test3', u'home': u'/home/test3', u'inbox': u'Inbox', u'outbox': u'Outbox'})
clients:
- username: test1
home: /home/test1
outbox: Outbox
inbox: Inbox
- username: test2
home: /home/test2
outbox: Outbox
inbox: Inbox
suffix1: _left
suffix2: _right
- username: test3
home: /home/test3
outbox: Outbox
inbox: Inbox
There is an array with clients, some clients have a suffix for a folder, some do not. Example: all clients have suffixes - folders are created if the first client does not have a suffix, and the second has suffix - folders creation is skipped. Skipped the first client and create the second client. How to solve this problem,since all clients in this code are skipped, please tell me?