是否有可能“遥控"使用“遥控"功能?用于基于git的连续部署的剧本? [英] Is it possible to have ansible use a "remote" playbook for git-based continuous deployment?

查看:47
本文介绍了是否有可能“遥控"使用“遥控"功能?用于基于git的连续部署的剧本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要管理一些运行代码的服务器,这些代码当前正在作为几个git存储库部署在该服务器上.我希望能够在项目的存储库中存储与存储库相关的剧本的各个部分(如果不是全部).例如,软件包依赖关系,virtualenv要求,配置模板的列表.这也将允许那些以每个分支/提交方式进行更改.这意味着我可以确定,如果我需要部署特定的分支/提交,则可以使用与该提交正确的剧本,例如,如果所使用的配置模板已更改.

I need to manage a few servers that run code that is currently being deployed there as a couple of git repositories. I would like to be able to store in the project's repository the parts (if not all) of the playbook that is relevant for the repository. For example, the list of package dependencies, virtualenv requirements, configuration templates. This will also allow those to change in a per branch/commit way. Meaning I can make sure that if I need to deploy a specific branch/commit, playbook that is correct for that commit is being used, if, say, the configuration template being used changed.

似乎唯一的解决方案是在本地检出git存储库.是否有可能告诉它运行远程剧本(从服务器上正在检出的git存储库中)?我当时想让ansible在远程主机上使用本地连接运行ansible,但我还没有尝试过看看它是否真的可以解决.

It seems like the only solution is to checkout the git repository locally. Is it possible in ansible to tell it to run a remote play book (from the git repository that is being checked out on the server)? I was thinking of having ansible run a ansible using a local connection on the remote host, I haven't tried it to see if this will actually work out.

人们如何在没有某些运行远程剧本的机制的情况下使用ansible进行基于git的连续部署?

How do people manage to use ansible for continuous deployment based on git without some mechanisms for running a remote playbook?

推荐答案

看看

Take a look at ansible-pull. It pulls the repo and executes playbook.

这篇关于是否有可能“遥控"使用“遥控"功能?用于基于git的连续部署的剧本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆