How to separate values in textbox in CloudForms Dialog to be used in Ansible Playbook

automate

#1

Hi everyone,
I’m trying to figure out how to separate my input values for Cloudforms to be used in an Ansible Playbook. I have a textbox where I need to specify multiple usernames to be created for MariaDB. The problem is I tried separating them with ‘,’ and ’ '. but I end up getting this: 05%20AM

This is my ansible code in case needed:

   mysql_user:
       name: "{{ item }}"
       password: "{{ user_passwd }}"
       host: 'localhost'
       login_user: root
       login_password: "{{ root_passwd }}"
       state: present
     with_items: "{{ mariadb_users }}"

I don’t know if the issue is in my textbox or I should try another ansible method when trying to create multiple users at the same time.


#2

Did you try with the YAML list syntax [userone, usertwo] ?


#3

yes, but somehow it did not work for me but I ended up using .split() and seperating my users with a space. the ‘,’ did not work :thinking:


#4

Are you using embedded ansible or an external ansible tower?


#5

I’m actually working with both.


#6

For embedded ansible you can have an Automate Method with Input Parameters, we support array type for parameters. You would set the type to array and values would be comma delimited
I have an example playbook that is invoked from automate here