Feature: Automatic rollout of agents via API with Ansible
I would find it extremely practical if you already had an existing host list in the Ansible inventory and could simply roll out the PatchMon agent automatically on all existing systems. That would significantly simplify the work involved with a large number of hosts.
4 Comments
Okay, that would be great. Where can I find it?
Hi :)
We have implemented Auto-enrolment scripts that can be used but we just need to document how to use it within ansible environment as an example.
I'm going to keep this open and leave it under the documentation tag.
I've been working on an updated PatchMon-ansible fork for a possible v2.0.0 -- or at a minimum one that works for me :-). https://github.com/mrjoshuap/PatchMon-ansible One of the roles I plan to support is the agent which does auto-enrollment along with agent installation and management:
---
# Thin AAP wrapper around patchmon.core.agent (install / lifecycle on targets).
# Limit hosts at launch. Survey var: agent_state (use report for a one-shot report).
- name: Manage PatchMon agent
hosts: all:!status_stopped:!unmanaged_guests:!network:!localhost
gather_facts: true
become: true
tasks:
- name: Run PatchMon agent role
ansible.builtin.import_role:
name: patchmon.core.agent
@rtulke you'll find it when you add a new Host in Patchmon
The install link will be shown there