一、Ansible自动化部署Zabbix
1、项目目录准备
[automan@control ~]$ mkdir zabbix -p
[automan@control zabbix]$ cat ansible.cfg
[defaults]
remote_user=automan
inventory=./hosts
[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=False
[automan@control zabbix]$ cat hosts
[zabbix-db]
node1
[zabbix-web]
node1
[zabbix-server]
node1
2、playbook
[automan@control zabbix]$ cat zabbix.yml
---
- name: zabbix基础配置
hosts: all
tasks:
- name: 关闭selinux
selinux:
policy: targeted
state: permissive
- name: 关闭防火墙服务
service:
name: firewalld
state: stopped
enabled: no
- name: 清空旧的软件仓库文件
shell: 'rm -rf /etc/yum.re