master端配置:web
vim /etc/salt/mastervim
ext_pillar:
- svn: trunk http://10.19.251.26/svn/salt_pillar #其中trunk为你正式使用的pillar的根目录缓存
也可写branches下具体的目录svn
ext_pillar:
- svn: V_1.0.4 http://10.19.251.26/svn/salt_pillarspa
在master安装pysvn,master本地缓存svnadmin的帐号密码debug
调用salt/pillar/svn_pillar.py检出svn代码到/var/cache/salt/master/pillar_svnfs3d
[root@deletedevweb01 pillar_svnfs]# tree
.
├── 27f84b5606cc8af977b1a947e394607f
│ ├── branches
│ │ ├── V_1.0.0
│ │ │ └── test.txt
│ │ ├── V_1.0.2
│ │ │ ├── lala.txt
│ │ │ └── test.txt
│ │ ├── V_1.0.3
│ │ │ ├── do.txt
│ │ │ ├── lala.txt
│ │ │ └── tets.txt
│ │ └── V_1.0.4
│ │ ├── lala.txt
│ │ └── testdy.txt
│ ├── tags
│ └── trunk
│ ├── do.sls
│ ├── do.txt
│ ├── lala.txt
│ ├── tets.txt
│ └── top.sls
└── b78262f6e39783dd05a8c1b379a767db
9 directories, 13 filesorm
代码片断以下:server
if not os.path.isdir(repo_dir):
os.makedirs(repo_dir)
log.debug('Checking out fileserver for svn_pillar module')
try:
CLIENT.checkout(repo_location, repo_dir)
except pysvn.ClientError:
log.error('Failed to initialize svn_pillar {0} {1}'.format(repo_location, repo_dir))get
debug log以下:
2015-04-23 16:24:13,070 [salt.loaded.int.pillar.svn_pillar ][INFO ] =========ext_pillar_sources========[{'svn': 'trunk http://10.19.251.26/svn/salt_pillar'}]2015-04-23 16:24:13,071 [salt.loaded.int.pillar.svn_pillar ][INFO ] +++++++repo_dir+++++++++/var/cache/salt/master/pillar_svnfs/27f84b5606cc8af977b1a947e394607f2015-04-23 16:24:13,071 [salt.loaded.int.pillar.svn_pillar ][INFO ] ========repo_location=========http://10.19.251.26/svn/salt_pillar2015-04-23 16:24:13,071 [salt.loaded.int.pillar.svn_pillar ][DEBUG ] Checking out fileserver for svn_pillar module2015-04-23 16:24:13,433 [salt.loaded.int.pillar.svn_pillar ][INFO ] --------working_dir----------/var/cache/salt/master/pillar_svnfs/27f84b5606cc8af977b1a947e394607f/trunk/