天天看点

salt ext_pillar

参考 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,如需转载请自行联系原作者