Ansible批量安装zabbix-agent
1、更新客户端列表
Vim /etc/ansible/hosts
Ansible批量安装zabbix-agent
2、客户端获取zabbix源及其他yum源
ansible basis -m shell -a “rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm”
ansible basis -m shell -a “wget -O /etc/yum.repos.d/Alicloud.repo http://mirrors.aliyun.com/repo/Centos-7.repo”

3、编写playbook
[[email protected] playbook]# cat zabbix_agent.yaml
#this playbook for zabbix-agent

  • hosts: basis
    tasks:
    • name: install agent
      yum: name=zabbix-agent state=installed

    • name: modify configration file
      copy: src=/root/playbook/zabbix_agentd.conf dest=/etc/zabbix/zabbix_agentd.conf

    • name: enable services
      systemd: name=zabbix-agent state=started enabled=yes

    • name: reload firewall
      firewalld: port=10050/tcp permanent=true state=enabled
      Ansible批量安装zabbix-agent
      配置文件内容:
      Ansible批量安装zabbix-agent

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2021-05-22
  • 2021-10-14
  • 2021-08-19
  • 2021-06-04
  • 2021-12-24
猜你喜欢
  • 2021-06-26
  • 2021-06-10
  • 2021-07-26
  • 2021-08-18
  • 2021-11-12
  • 2021-10-15
  • 2021-06-19
相关资源
相似解决方案