Add update-patchmon
This commit is contained in:
23
update-patchmon
Normal file
23
update-patchmon
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
- name: Update Patchmon server port and report
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Update patchmon_server port in config
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /etc/patchmon/config.yml
|
||||||
|
regexp: 'patchmon_server:\s*http://192\.168\.1\.67:3399'
|
||||||
|
replace: 'patchmon_server: http://192.168.1.67:3001'
|
||||||
|
backup: yes
|
||||||
|
notify: Restart patchmon-agent
|
||||||
|
|
||||||
|
- name: Run patchmon-agent report
|
||||||
|
ansible.builtin.command: patchmon-agent report
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Restart patchmon-agent
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: patchmon-agent
|
||||||
|
state: restarted
|
||||||
Reference in New Issue
Block a user