<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 13 July 2016 at 06:52, Steven Holms <span dir="ltr"><<a href="mailto:superlinkx@gmail.com" target="_blank">superlinkx@gmail.com</a>></span> wrote:<br><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">Has anyone had success in setting up a postgresql server within a snap? I've been reading over the docs, and figured I'd try adding postgresql as a stage-package, but now I'm not sure how to get it up and running within my snap. I think I'm on the right track, I just don't know how to configure the "app" portion of it so that the daemon will run.<div><br></div><div>My app is pretty simple. It's a go server that needs access to postgresql for it's backend. I know I can communicate with an external postgresql database, but was hoping to get it all into one package.</div><div><br></div><div>Any help is appreciated.</div></div><span class=""><font color="#888888"><div dir="ltr"><br></div></font></span></blockquote><div><br></div><div>I've done something like this for a project that I'm working on, though the architecture is slightly different to what you are suggesting. I have a Go web service that uses the network and network-bind plugs and then I'm using the postgresql snap from the store. So, I use two separate snaps and then use a command on my web service snap to set the config file (so it knows how to connect to postgresql). After that, a simple restart of the web service snap and everything is connected.</div><div><br></div><div>Go web service: <a href="https://github.com/ubuntu-core/identity-vault">https://github.com/ubuntu-core/identity-vault</a></div><div>Web service snap files: <a href="https://github.com/ubuntu-core/serial-vault-snap">https://github.com/ubuntu-core/serial-vault-snap</a> (these files will soon be moved to the web service source repo)</div><div><br></div><div>As a bonus, there is also a juju 2.0 charm that deploys the web service:</div><div><a href="https://github.com/ubuntu-core/serial-vault-charm">https://github.com/ubuntu-core/serial-vault-charm</a><br></div><div><br></div><div>Even if you are not going to use the charm for deployment, it is helpful as it walks you through the commands that you need to get config file set up and pushed to the snap. Kudos to Evan Dandrea as I just copied his approach for config from the Jenkins Snap [1]. With this approach, it works just as well if the snaps are on the same machine or on separate juju units.</div><div><br></div><div>James</div><div><br></div><div>[1] <a href="https://github.com/evandandrea/jenkins-snap">https://github.com/evandandrea/jenkins-snap</a></div><div> </div></div></div></div>