[#454] codify CMDB drift report as AWX job template (runs on workstation, su to reachableceo)
ci / audit (push) Successful in 47s
ci / audit (push) Successful in 47s
https://projects.knownelement.com/issues/454
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# cmdb_drift_report.yml — run the nightly GLPI drift reconcile on demand [#801/#705]
|
||||
# Runs as root on the workstation, then as reachableceo (HOME + creds live there).
|
||||
- name: CMDB drift report (inventory seed vs live GLPI)
|
||||
hosts: ultix-streaming
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: run reconcile report as reachableceo
|
||||
ansible.builtin.command:
|
||||
cmd: >
|
||||
bash {{ ansible_env.HOME }}/projects/KNEL/OAM/inventory/scripts/reconcile-report.sh
|
||||
--out /var/log/glpi-reconcile/report-manual-latest.md
|
||||
become: true
|
||||
become_user: reachableceo
|
||||
become_method: su
|
||||
register: drift
|
||||
failed_when: drift.rc not in [0, 3]
|
||||
changed_when: false
|
||||
|
||||
- name: show drift summary
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ drift.stdout_lines[:6] }}"
|
||||
Reference in New Issue
Block a user