Saltstack exploration-using pillar to improve VIM deployment

Source: Internet
Author: User
Tags saltstack

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.