liujjun 发表于 2018-8-1 08:20:26

SaltStack源码分析之pkg状态模块

'''  
Installation of packages using OS package managers such as yum or apt-get
  
=========================================================================
  

  
Salt can manage software packages via the pkg state module, packages can be
  
set up to be installed, latest, removed and purged. Package management
  
declarations are typically rather simple:
  

  
.. code-block:: yaml
  

  
    vim:
  
      pkg.installed
  

  
A more involved example involves pulling from a custom repository.
  
Note that the pkgrepo has a require_in clause.
  
This is necessary and can not be replaced by a require clause in the pkg.
  

  
.. code-block:: yaml
  

  
    base:
  
      pkgrepo.managed:
  
      - humanname: Logstash PPA
  
      - name: ppa:wolfnet/logstash
  
      - dist: precise
  
      - file: /etc/apt/sources.list.d/logstash.list
  
      - keyid: 28B04E4A
  
      - keyserver: keyserver.ubuntu.com
  
      - require_in:
  
          - pkg: logstash
  

  
    logstash:
  
      pkg.installed
  
'''
页: [1]
查看完整版本: SaltStack源码分析之pkg状态模块