參考 https://github.com/shencan/saltpillar
書中247頁
#GitPython and pygit2
1.master
python2.6.6
yum install GitPython
2.有個bug,用最新的gitdb替換掉就的gitdb
<a href="https://github.com/gitpython-developers/gitdb/tree/master/gitdb" target="_blank">https://github.com/gitpython-developers/gitdb/tree/master/gitdb</a>
<a href="https://s1.51cto.com/wyfs02/M01/A4/33/wKioL1mmXwGwng3tAAAwgl4zXaA397.png" target="_blank"></a>
3.修改master
ext_pillar:
- git: base https://github.com/shencan/saltpillar.git
- git: stage https://github.com/shencan/saltpillar.git
4.salt-run git_pillar.update branch='stage' repo='http://自己的git位址/shencan/saltpillar.git' -l debug
salt-run git_pillar.update branch='base' repo='http://自己的git位址/shencan/saltpillar.git' -l debug
5.[root@node src]# salt '*' pillar.items
122:
----------
pkgs:
----------
pip:
----------
ansible:
1.9.1
awscli:
1.3.0
users:
shencan:
fullname:
shencan
shell:
/bin/bash
慚愧,搞了好幾天。沒耐心啊。
這個具體有什麼用,比如你可以在git存放資料庫密碼,然後git pillar更新裝有mysql的用戶端,之後可以對mysql進行操作。
salt感覺很快。
本文轉自 liqius 51CTO部落格,原文連結:http://blog.51cto.com/szgb17/1961084,如需轉載請自行聯系原作者