Add patchman-client role; disable nightly update and reboot cron jobs
- roles/patchman_client + patchman-client.yaml: install patchman-client on ubuntu_servers and enroll with the Patchman server on patch.ki5bhv.com - crontab.txt: comment out the 2:00 update.yaml and 7:00 reboot.yaml jobs; updates are now tracked in Patchman and applied manually Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
fcaa1e9204
commit
6d5f532b2b
8 files changed
+1337
-2
No files matched your search
@@ -0,0 +1,54 @@
|
||||
---
|
||||
- name: Install client dependencies
|
||||
ansible.builtin.package:
|
||||
name: "{{ ['curl'] + (['jq'] if patchman_client_protocol | int == 2 else []) }}"
|
||||
state: present
|
||||
|
||||
- name: Install cron
|
||||
ansible.builtin.package:
|
||||
name: "{{ 'cron' if ansible_facts['os_family'] == 'Debian' else 'cronie' }}"
|
||||
state: present
|
||||
when: patchman_cron_enabled | bool
|
||||
|
||||
- name: Install patchman-client script
|
||||
ansible.builtin.copy:
|
||||
src: patchman-client
|
||||
dest: /usr/sbin/patchman-client
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
notify: Send patchman report
|
||||
|
||||
- name: Create /etc/patchman
|
||||
ansible.builtin.file:
|
||||
path: /etc/patchman
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: Configure patchman-client
|
||||
ansible.builtin.template:
|
||||
src: patchman-client.conf.j2
|
||||
dest: /etc/patchman/patchman-client.conf
|
||||
owner: root
|
||||
group: root
|
||||
# keep the file private when it holds an API key
|
||||
mode: "{{ '0600' if patchman_client_api_key else '0644' }}"
|
||||
notify: Send patchman report
|
||||
|
||||
# Writes the whole file so it replaces any hand-made /etc/cron.d/patchman-client
|
||||
- name: Schedule daily patchman report
|
||||
ansible.builtin.template:
|
||||
src: patchman-client.cron.j2
|
||||
dest: /etc/cron.d/patchman-client
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
when: patchman_cron_enabled | bool
|
||||
|
||||
- name: Remove daily patchman report schedule
|
||||
ansible.builtin.file:
|
||||
path: /etc/cron.d/patchman-client
|
||||
state: absent
|
||||
when: not patchman_cron_enabled | bool
|
||||
Reference in new issue
Block a user