Ansible +centos7 Batch Installation zabbix3.2.1 Agent

Source: Internet
Author: User
Tags vars

Ansible +centos7 Zabbix agent is not in bulk

Deploying Machine 192.168.4.100-116

Zabbix Server ip192.168.4.117

Ansible Structure Description

.├── hosts #  Deploying client Machines ├── roles│   └──  zabbix_agent│       ├── defaults│        ├── files│       ├── handlers│        ├── meta│       ├── tasks│        │   └── main.yml # ansible  Deployment Zabbix_agent   Script │       ├── templates│        │   └── zabbix_agentd.conf.j2 # zabbix_agent  Configuration Files  │        └── vars└── zabbix_agent.yml # ansible   Control Script 
zabbix_agent.yml  content description- hosts: code  user:  Root  vars:     zabbix_serverip: 192.168.4.117 # zabbix   Server ip     zabbix_activeip: 192.168.4.117 # zabbix  Server IP      agent_ip:  ' {{ ansible_eth0.ipv4.address } '  #  client IP   Change your network card name eth0  to your own server   roles:    - zabbix_agent 
main.yml  Content Description- name: yum epel-release #  installation zabbix yum  source must be    yum: name=epel-release state=present- name: zabbix-release-3.2-1.el7.noarch.rpm   get_url:    url:   #下载zabbix  yum  Source Configuration       dest: /tmp/zabbix-release-3.2-1.el7.noarch.rpm- name: rpm -qi  zabbix-release-3.2-1.el7.noarch  shell: rpm -qi zabbix-release-3.2-1.el7.noarch  #  to see if the server is installing Zabbix3.2  register: result  ignore_errors: true- name:  zabbix-release-3.2-1.el7.noarch.rpm  shell: rpm -uvh /tmp/ zabbix-release-3.2-1.el7.noarch.rpm #  installation zabbix  Source code   when: result.rc ==  1 - name: yum install zabbix-agent  yum: name={{ item }}  state=present #  installation Zabbix-agent  with_items:       - zabbix-agent      - zabbix-get       - zabbix-sender- lineinfile: dest=/etc/services line= " Zabbix-agent 10050/tcp zabbix agent "- lineinfile: dest=/etc/services line=" Zabbix-agent 10050/udp zabbix agent " #  add zabbix  port to services   file-  name: up zabbix-agent file client  #  Uploading configuration Files   template: src= zabbix_agentd.conf.j2 dest=/etc/zabbix/zabbix_agentd.conf- name: enabled service  zabbix-agent #  Open zabbix-agent  Boot   service: name=zabbix-agent.service  enabled=yes- name: start  service zabbix-agent #  Start zabbix-agent   service: name=zabbix-agent  state=started

Other instructions:

Ansible-playbook-i hosts Zabbix_agent.yml-verbose


This article is from the "Growth record" blog, so be sure to keep this source http://juestnow.blog.51cto.com/1515305/1878420

Ansible +centos7 Batch Installation zabbix3.2.1 Agent

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.