Saltstack exploration-using pillar to improve VIM deployment
[[email protected] srv]# pwd/srv[[email protected] srv]# lspillar salt[[email protected] srv]# cat pillar/data.sls pkg/ top.sls users/ [[email protected] srv]# cat pillar/pkg/init.sls pkgs: {% if grains[' os_family '] == ' RedHat ' %} vim: vim-enhanced {% elif grains[' os_family '] == ' Debian ' %} vim: vim {% elif grains[' os '] == ' Arch ' %} vim: vim {% endif %}[[email protected] srv]# cat pillar/top.sls base: ' * ': - data - Users - pkg[[email protected] srv]# cat salt/edit/vim.sls vim: pkg: - installed - name: { { pillar[' pkgs ' [' Vim '] }} /root/.vimrc: file.managed: - source: salt://edit/conf/vimrc - mode: 644 - uesr: root - group: root - require: - pkg: vim execution:[[email protected] srv]# salt ' svr205-2 ' state.sls Edit.vimsvr205-2:---------- ID: vim Function: pkg.installed Name: Vim-enhAnced result: true comment: package vim-enhanced is already installed. Started: 18:05:24.707048 duration: 1808.3 ms changes: ----------          ID: /ROOT/.VIMRC Function: file.managed Result: True comment: file /root/.vimrc is in the correct state started: 18:05:26.515743 duration: 153.787 ms changes: summary------------succeeded: 2failed: 0------------total states run: 2
Saltstack exploration-using pillar to improve VIM deployment