<div dir="ltr"><div dir="ltr">Oooh, salt can query sqlite3 (and mysql) natively: <a href="https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.sqlite3.html">https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.sqlite3.html</a></div><div>Does that do what I think it does (namely, return info in a tuple and allow iteration internally)?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 23, 2019 at 12:55 PM Jeff Frontz &lt;<a href="mailto:jeff.frontz@gmail.com">jeff.frontz@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>[I&#39;m skipping the delivery/enforcement stuff since that&#39;s being solved in Other Ways; I&#39;m focused on the data population problem.]</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 23, 2019 at 12:12 PM Rick Hornsby &lt;<a href="mailto:richardjhornsby@gmail.com" target="_blank">richardjhornsby@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="font-family:Helvetica,Arial;font-size:13px"><br></div><p>On September 23, 2019 at 9:20:16 AM, Jeff Frontz (<a href="mailto:jeff.frontz@gmail.com" target="_blank">jeff.frontz@gmail.com</a>) wrote:</p> <div><blockquote type="cite" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span><div></div><div><div dir="ltr">I have a need to generate configuration files for a bunch of different (some open-source, some semi-proprietary) applications that run on a bunch of different systems. </div></div></span></blockquote></div><p>For configuration files, (this is just one way to do it) I can create a template file that looks like the final config format - be that JSON, TOML, yaml, whatever. I put placeholders (variable) where I want to dynamically set a value. Then in the Chef/Puppet code, I say something like</p><p><span style="white-space:pre-wrap">        </span>template ‘/opt/someapp/config/urmom.json’<br><span style="white-space:pre-wrap">                </span>source ‘template_source.json.erb&#39;<br><span style="white-space:pre-wrap">                </span>variables( pancakes: ‘yes’ )</p><p><br></p></blockquote><div><br></div>OK, so the problem space is more like<br><br>          template &#39;/CI/src/***SPECIFIC-NODE-NAME***/BFT.json&#39;<br>                   source `BFT-template.json`<br>                   variables(iterator:serviceTuple: &#39;select peerID, service-identifier-node, service identifier-port from mondo-table where node != ***SPECIFIC-NODE-NAME***&#39;)<br>           <br>where BFT-template.json might be something like (please pardon my JSON ignorance):<br><br>            ...yada yada yada...</div><div class="gmail_quote">          CommonItems {</div><div class="gmail_quote">                  &quot;lotsa&quot;:&quot;stuff&quot;,</div><div class="gmail_quote">               },</div><div class="gmail_quote">            PeerItems {<br>                   [foreach:serviceTuple]</div><div class="gmail_quote">                        {</div><div class="gmail_quote">                         &quot;peerName&quot;:&quot;**peerID**&quot;,</div><div class="gmail_quote">                         &quot;peerNode&quot;:&quot;**service-identifier-node**&quot;,<br>                         &quot;peerPort&quot;:&quot;**peer-service-1-field**&quot;,</div><div class="gmail_quote">                        },</div><div class="gmail_quote">                   [endfor]</div><div class="gmail_quote"><br></div><div class="gmail_quote">               ... yada yada yada...</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Do any of these tools/solutions support complex operations like &quot;run a select from a table and iterate over the results to add/populate fields to the template&quot;?</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><blockquote type="cite"><div dir="ltr">I need to configure the applications on the other hosts to use the each of the destination hosts&#39; services.</div></blockquote><p>One thing you may be looking for is service discovery.</p></div></blockquote><div> For more Reasons, it needs to be deterministic/stable at config distribution time (and beyond) so having peers advertise (and be dynamically discovered) isn&#39;t in the cards.</div><div><br></div><div><br></div><div>Thanks,</div><div>Jeff</div><div><br></div></div></div></div></div>
</blockquote></div>