You'd have to manually split that and trim the results so you can use it in a loop. Where does that "user1, user2, user3" string come from?
On Mon, 27 Jan 2020 at 15:57, Anand Solomon <[email protected]> wrote: > > Hi, > I want to create users in the database using Ansible. I need ansible to run > the task (creating user) for all the users mentioned in the vars: schemaname. > How do I do that in loop ? > > var: > schemaname: user1, user2, user3 > > tasks: > - name: This playbook will create the user. > oracle_user: > oracle_home: /home/ansible/instantclient_12_2 > user: "{{user}}" > password: "{{password}}" > service_name: "{{sname}}" > port: "{{prt}}" > hostname: "{{hostname}}" > schema: "{{schemaname}}" > schema_password: > default_tablespace: USERS > state: present > update_password: on_create > grants: "DBA" > environment: "{{oracle_env}}" > register: user_create > delegate_to: localhost > > > -- > 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/d8a7aad1-7272-44b7-b982-3673ec88190b%40googlegroups.com. -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- 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/CAL8fbwO-%2B6YQstoJnJerkComHwRAyPDxT4samYpfRxWW3PuZ_g%40mail.gmail.com.
