Hello all,
I have a playbook which creates sftp user accounts based on information
passed during playbook execution. I would like to create multiple
directories based on what the user running the playbook enters.
- name: Create subdirectories
file:
path: /storage/{{ prod_or_test }}/sftp/{{ obfusicatedusername }}/{{
dirs }}
state: directory
recurse: yes
owner: '{{ obfusicatedusername }}'
group: sftp_admins
I pass the information via: --extra-vars: obfusicatedusername=testy123
password=mypassword prod_or_test=TEST_SFTP dirs=Inbound
The issue is some sftp users want more than 1 directory, while others want
2 or more....
I know I could do something like:
with_items:
- /srv/www
- /dir/foo
- /dir/bar
Just not sure how to handle that if sometimes it could be one, other
times 2 or more. Any help or guidance would be appreciated.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CA%2B1bNWt%2B1biA8qC8a2Qf_SLHjHPDMOhe7XTmxK%2B6Xxh6K_0Afw%40mail.gmail.com.