Ansible 运维自动化 ( 配置管理工具 )(7)

shell > vim /etc/ansible/delete_zabbix_agent.yml --- - hosts: mini roles: - delete_zabbix_agent shell > vim /etc/ansible/roles/delete_zabbix_agent/tasks/main.yml --- - name: Stop Zabbix_agent shell: pgrep zabbix_agentd | xargs kill ignore_errors: yes - name: Delete Boot Start shell: chkconfig --del zabbix_agentd - name: Delete Start Script shell: rm -rf /etc/init.d/zabbix_agentd - name: Delete Install Dir shell: rm -rf {{ zabbix_dir }}/zabbix - name: Delete Software shell: rm -rf {{ zabbix_dir }}/src/zabbix-{{ zabbix_version }}.tar.gz - name: Delete Log File shell: rm -rf /tmp/zabbix_agentd.log - name: Delete Zabbix User user: name={{ zabbix_user }} state=absent remove=yes shell > vim /etc/ansible/roles/delete_zabbix_agent/vars/main.yml zabbix_dir: /usr/local zabbix_version: 2.4.5 zabbix_user: zabbix

 

# End

使用 Ansible 高效交付 Docker 容器 

使用Ansible批量管理远程服务器 

Ansible安装配置与简单使用 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ecc5f7b71fa0e7d81abac665544a7427.html