Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
622325f210 | ||
|
|
ef7047f6bc |
No files matched your search
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
# Remove the PatchMon agent (server patch.ki5bhv.com / 192.168.1.8 was retired).
|
||||||
|
- name: Remove PatchMon agent
|
||||||
|
hosts: linux
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: Check for PatchMon unit
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /etc/systemd/system/patchmon-agent.service
|
||||||
|
register: patchmon_unit
|
||||||
|
|
||||||
|
- name: Stop and disable patchmon-agent
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: patchmon-agent
|
||||||
|
state: stopped
|
||||||
|
enabled: false
|
||||||
|
when: patchmon_unit.stat.exists
|
||||||
|
|
||||||
|
- name: Find PatchMon cron entries
|
||||||
|
ansible.builtin.find:
|
||||||
|
paths: /etc/cron.d
|
||||||
|
patterns: "patchmon*"
|
||||||
|
register: patchmon_cron
|
||||||
|
|
||||||
|
- name: Remove PatchMon files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ ['/etc/systemd/system/patchmon-agent.service', '/usr/local/bin/patchmon-agent', '/etc/patchmon']
|
||||||
|
+ (patchmon_cron.files | map(attribute='path') | list) }}"
|
||||||
|
register: patchmon_removed
|
||||||
|
|
||||||
|
- name: Reload systemd
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
daemon_reload: true
|
||||||
|
when: patchmon_removed is changed
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
# Remove the PatchMon agent (server patch.ki5bhv.com / 192.168.1.8 was retired).
|
||||||
|
- name: Remove PatchMon agent (Windows)
|
||||||
|
hosts: windows
|
||||||
|
tasks:
|
||||||
|
- name: Stop and delete PatchMonAgent service
|
||||||
|
ansible.windows.win_service:
|
||||||
|
name: PatchMonAgent
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Remove PatchMon folders
|
||||||
|
ansible.windows.win_file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- C:\Program Files\PatchMon
|
||||||
|
- C:\ProgramData\PatchMon
|
||||||
Reference in new issue
Block a user