1
I have a SQL command that I would like to use as the value of a JSON node, which is a part of an index definition. All of this is passed as a command in a puppet manifest. I would like to externalize the sql script so it can be edited independently but can't figure out how to make it all play well.
Puppet Manifest:
...
exec { 'create_index':
command => 'curl -XPUT http://localhost:9200/_river/my_jdbc_river/_meta -d "{ \"type\": \"jdbc\", \"jdbc\": \"sql\": \"`cat /vagrant/puppet/scripts/data.sql`\" } }"
}
...
The problem is, in order to increase readability, I have newlines and to structure the index, I use quotes like this:
SQL Script (data.sql):
SELECT
name as "data.name",
description as "data.description"
FROM
data
Is there any way I can pull this off?
Could you elaborate on your question? I'm not sure what you mean by externalize the sql script so it can be edited independently. – spuder – 2014-12-23T02:22:20.467