Keeping ansible code and app code in sync?

59 views
Skip to first unread message

Guy Matz

unread,
Oct 14, 2016, 5:15:03 PM10/14/16
to ansible...@googlegroups.com
Hi!  I have some ansible code that deploys an app . . .  some structure of the app has changed which is reflected in the ansible code . . .  I'm wondering if anyone has some good techniques for keeping versions of app code and deployment code "married"

Thanks!!
Guy

Rénald Casagraude

unread,
Oct 14, 2016, 6:34:18 PM10/14/16
to ansible...@googlegroups.com
Hi!

The best mariage I see is to make them live in the same repository. Any reason why they are kind of separated for you ?

R.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CABnTgtUMcR95gsETei1t_5xbqkx7tR_uhAYUabSmvZtTc4QsMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Felix Fontein

unread,
Oct 14, 2016, 7:36:55 PM10/14/16
to ansible...@googlegroups.com
Hi,

> The best mariage I see is to make them live in the same repository.
> Any reason why they are kind of separated for you ?

a very good reason to have them in separate repositories is that your
deployment repository contain secret things like database passwords,
private TLS keys etc. which are required for deployment, but should not
be included in your app's source repository.

In case you use git, you could make your app's source a git submodule
of your ansible scripts git repo.

Another way is to keep track of your app builds in a YAML file which is
checked into your ansible scripts repo; then your ansible scripts can
deploy the current version mentioned in the YAML file. If you use the
app repo's commit as the deployment tags in the YAML file you get your
"marriage".

Best,
Felix



>
> R.
>
> Le vendredi 14 octobre 2016, Guy Matz <guy...@gmail.com> a écrit :
>
> > Hi! I have some ansible code that deploys an app . . . some
> > structure of the app has changed which is reflected in the ansible
> > code . . . I'm wondering if anyone has some good techniques for
> > keeping versions of app code and deployment code "married"
> >
> > Thanks!!
> > Guy
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to ansible-proje...@googlegroups.com
> > <javascript:_e(%7B%7D,'cvml','ansible-project%2Bunsu...@googlegroups.com');>
> > .
> > To post to this group, send email to
> > ansible...@googlegroups.com
> > <javascript:_e(%7B%7D,'cvml','ansible...@googlegroups.com');>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/ansible-project/CABnTgtUMcR95gsETei1t_5xbqkx7tR_uhAYUabSmvZtTc4QsMw%
> > 40mail.gmail.com
> > <https://groups.google.com/d/msgid/ansible-project/CABnTgtUMcR95gsETei1t_5xbqkx7tR_uhAYUabSmvZtTc4QsMw%40mail.gmail.com?utm_medium=email&utm_source=footer> .

Dick Davies

unread,
Oct 15, 2016, 6:04:40 AM10/15/16
to ansible list
On 15 October 2016 at 00:36, 'Felix Fontein' via Ansible Project
<ansible...@googlegroups.com> wrote:
> Hi,
>
>> The best mariage I see is to make them live in the same repository.
>> Any reason why they are kind of separated for you ?
>
> a very good reason to have them in separate repositories is that your
> deployment repository contain secret things like database passwords,
> private TLS keys etc. which are required for deployment, but should not
> be included in your app's source repository.
>
> In case you use git, you could make your app's source a git submodule
> of your ansible scripts git repo.

Maybe it's just me but git submodules cause no end of grief every time
I've worked somewhere that used them.

How about just using ansible-vault and a single repo?

http://docs.ansible.com/ansible/playbooks_vault.html


> Another way is to keep track of your app builds in a YAML file which is
> checked into your ansible scripts repo; then your ansible scripts can
> deploy the current version mentioned in the YAML file. If you use the
> app repo's commit as the deployment tags in the YAML file you get your
> "marriage".

We used that model successfully before now, except in our case a
'deployment' would consist of 2 tags; one for the config repo and one for the
app repo.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20161015013644.402d64d6%40fontein.de.
Reply all
Reply to author
Forward
0 new messages