首页 > 代码库 > Saltstack配置管理(2)

Saltstack配置管理(2)

1.SaltStack安装zabbix_agent端.

vim /etc/salt/states/init/zabbix_agnet.sls

zabbix_agnet:
  pkg.installed:
  #pkg.removed:

    - names:
      - zabbix22-agent

  file.managed:
    - name: /etc/zabbix_agent.conf
    - source: salt://init/files/zabbix_agentd.conf
    - user: root
    - group: root
    - mode: 644

  service.running:
    - name: zabbix-agentd
    - enable: True
    #- reload: True
    - watch:
      - file: zabbix_agnet

2.vim /etc/salt/states/top.sls

base:
  ‘*‘:

    - init.zabbix_agnet

  

 

 

 

  

Saltstack配置管理(2)