I am looking to create a multitude of directories on my given server by passing in vars from an ansible .yml vars file. I am currently trying to use Jinja templating to pass the directory names in. The vars file looks like this;
BTG-VELOCITY:
type: PBSTP
accept: 1010
GFAM:
type: PBSTP
connect: 1010
ONEZERO2:
type: TRADESTREAM
GUANFABANK:
type: FXSIM
MAINBANK:
type: FXSIM
TYPOBANK:
type: TRADESTREAM
TEST-BANK:
type: PBSTP
connect: 32620
accept: 33620
And I wish to create a directory for each customer name listed. So ideally I will end up with a directory in a given folder for each 'TYPOBANK','MAINBANK' etc. The way I am trying to this at the minute is as follows in my playbook;
- include_vars:
file: /home/vagrant/stunnelSimAnsPractice/roles/ns16/vars/customers.yml
name: customers
- file:
path: /home/vagrant/stunnelSimAnsPractice/roles/ns16/sessions/{%for cust, config in customers.items() %}{{cust}}{% endfor %}
state: directory
But this outputs one directory with all the customer names combinded, as shown below. Any suggestions on how to create individual directories for each customer? Thank you
├── sessions
│ └── GFAMTEST-BANKBTG-VELOCITYTYPOBANKMAINBANKGUANFABANKONEZERO2