File tree Expand file tree Collapse file tree 1 file changed +55
-3
lines changed
Expand file tree Collapse file tree 1 file changed +55
-3
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,67 @@ docker run --rm \
1717## 在 Coding-CI 上使用
1818
1919``` yml
20+ # .coding.yml
2021master :
2122 push :
2223 - stages :
23- - name : use
24+ - name : use ansible
2425 image : plugins/ansible
2526 settings :
2627 private_key : $PRIVATE_KEY
27- playbook : deployment/playbook.yml
28- inventory : deployment/hosts.yml
28+ inventory : hosts.conf
29+ playbook : playbook.yml
30+ ` ` `
31+
32+ ` ` ` conf
33+ # hosts.conf
34+ [custom]
35+ 127.0.0.1
36+ 127.0.0.2
37+ 127.0.0.3
38+ ```
39+
40+ ``` yml
41+ # playbook.yml
42+ ---
43+ - hosts :
44+ - custom
45+ remote_user : root
46+ vars :
47+ ansible_ssh_port : 36000
48+ tasks :
49+
50+ # 执行脚本
51+ - name : hello
52+ shell : echo hello
53+
54+ # 复制文件
55+ - name : copy
56+ copy :
57+ src : /dir/from/
58+ dest : /dir/to/
59+ owner : root
60+ group : root
61+ mode : 0644
62+ ` ` `
63+
64+ ## 常见问题
65+
66+ ### RSA 加密算法提示不支持时
67+
68+ 建议使用 3.0 版本,即:` plugins/ansible:3`,示例如下
69+
70+ ` ` ` yml
71+ # .coding.yml
72+ master:
73+ push:
74+ - stages:
75+ - name: use ansible
76+ image: plugins/ansible:3
77+ settings:
78+ private_key: $PRIVATE_KEY
79+ inventory: hosts.conf
80+ playbook: playbook.yml
2981` ` `
3082
3183# # 更多用法
You can’t perform that action at this time.
0 commit comments