Ansible Script 추가
This commit is contained in:
25
ansible/zabbix_agent/roles/zabbix-agent/tasks/remove.yml
Normal file
25
ansible/zabbix_agent/roles/zabbix-agent/tasks/remove.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Pull service facts
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: 'Remove | Make sure the "old" zabbix-agent service stopped'
|
||||
ansible.builtin.service:
|
||||
name: "zabbix-agent"
|
||||
state: stopped
|
||||
enabled: false
|
||||
become: true
|
||||
when: |
|
||||
ansible_facts.services["zabbix-agent.service"] is defined or
|
||||
ansible_facts.services["zabbix-agent"] is defined
|
||||
|
||||
- name: "Remove | Package removal"
|
||||
ansible.builtin.package:
|
||||
name: "zabbix-agent"
|
||||
state: absent
|
||||
become: true
|
||||
|
||||
- name: "Remove | Remove the agent-include-dir"
|
||||
ansible.builtin.file:
|
||||
path: "{{ zabbix_agent_include }}"
|
||||
state: absent
|
||||
become: true
|
||||
Reference in New Issue
Block a user