Giacomo, the single quote is terminating the argument to -execute.

When running

influx  -execute 'CREATE USER "test2" WITH PASSWORD 'secret''


influx sees

 influx  -execute 'CREATE USER "test2" WITH PASSWORD '

Use double quotes around the whole query to remove the ambiguity

influx  -execute "CREATE USER "test2" WITH PASSWORD 'secret'"

On Wed, Oct 26, 2016 at 3:10 AM, <giacomo.tart...@gmail.com> wrote:

> Hi,
> I am quite new to InfluxDB, but I could not find any reference to my
> problem in the docs.
>
> Some context first, I am setting up an ansible playbook to install
> influxdb with authentication and authorization.
> As I understood it, this implies I need to create a user.
>
>
> So in my playbook i have this:
> - name: Create useer
>   command: influx -ssl -unsafeSsl -execute 'CREATE USER "test" WITH
> PASSWORD 'secret''
>
> But that fails with this error:
> "ERR: error parsing query: found secret, expected string at line 1, char
> 36", "Warning: It is possible this error is due to not setting a
> database.", "Please set a database with the command \"use <database>\"."
>
> The same thing happens if I do it on the command line"
> $ influx  -execute 'CREATE USER "test2" WITH PASSWORD 'secret''
> ERR: error parsing query: found secret, expected string at line 1, char 35
> Warning: It is possible this error is due to not setting a database.
> Please set a database with the command "use <database>".
> error parsing query: found secret, expected string at line 1, char 35
>
> But the same query succeeds if doit interactively:
> $ influx
> Visit https://enterprise.influxdata.com to register for updates, InfluxDB
> server management, and monitoring.
> Connected to http://localhost:8086 version v1.0.2
> InfluxDB shell version: v1.0.2
> > show users
> user    admin
> test    false
> test1   false
>
> > CREATE USER "test3" WITH PASSWORD 'secret'
> >
> > show users
> user    admin
> test    false
> test1   false
> test3   false
>
>
> Am I doing something wrong?
> Any help  or pointer to solutions is much appreciated.
>
> Thanks.
>
>
>
> Giacomo
>
> --
> Remember to include the version number!
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxData" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to influxdb+unsubscr...@googlegroups.com.
> To post to this group, send email to influxdb@googlegroups.com.
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/97f230f4-0d3c-4018-99be-f4d52dac0383%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvPCh3GwmiEbORGgDSCgmBUM-uhx%2BQ0Z8cXRwrxOOtuTMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to