gpt4 book ai didi

git - Ansible repo 结构

转载 作者:太空狗 更新时间:2023-10-29 14:22:41 25 4
gpt4 key购买 nike

可以在以下位置查看 Ansible 建议的存储库:- http://docs.ansible.com/ansible/playbooks_best_practices.html

production                # inventory file for production servers
staging # inventory file for staging environment

group_vars/
group1 # here we assign variables to particular groups
group2 # ""
host_vars/
hostname1 # if systems need specific variables, put them here
hostname2 # ""

library/ # if any custom modules, put them here (optional)
filter_plugins/ # if any custom filter plugins, put them here (optional)

site.yml # master playbook
webservers.yml # playbook for webserver tier
dbservers.yml # playbook for dbserver tier

roles/
common/ # this hierarchy represents a "role"
tasks/ #
main.yml # <-- tasks file can include smaller files if warranted
handlers/ #
main.yml # <-- handlers file
templates/ # <-- files for use with the template resource
ntp.conf.j2 # <------- templates end in .j2
files/ #
bar.txt # <-- files for use with the copy resource
foo.sh # <-- script files for use with the script resource
vars/ #
main.yml # <-- variables associated with this role
defaults/ #
main.yml # <-- default lower priority variables for this role
meta/ #
main.yml # <-- role dependencies

webtier/ # same kind of structure as "common" was above, done for the webtier role
monitoring/ # ""
fooapp/ # ""

我的问题是这个存储库处于什么级别 - 每个项目/应用程序都有这些格式之一,还是整个 Assets ?

干杯

最佳答案

我采用混合方法。每个团队/项目都有自己的空间,但我维护了一个全局 list 和一组与网络和数据中心基础设施相关的 group_vars。

Ansible 非常灵活,所以从简单开始,然后根据您的特定团队和公司的工作方式进行塑造。

关于git - Ansible repo 结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35180708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com