1.SaltStack批量安装zabbix_agent端.

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

zabbix_install.conf:
  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_install.conf

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

base:
  '*':

    - init.zabbix_agnet

3.执行命令

salt '*' state.highstate test=Ture 	#测试,只是在minion端去运行,会列出改变,但实际不会执行.

salt '*' state.highstate

  

  

 

 

 

  

相关文章:

  • 2021-12-30
  • 2021-11-14
  • 2022-01-09
  • 2022-01-17
  • 2021-07-23
  • 2022-12-23
  • 2022-02-20
  • 2022-02-27
猜你喜欢
  • 2021-11-30
  • 2021-07-23
  • 2021-07-08
  • 2021-05-22
  • 2022-12-23
相关资源
相似解决方案