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