-
Notifications
You must be signed in to change notification settings - Fork 3
/
ocsinventory-agent.yml
51 lines (43 loc) · 1.7 KB
/
ocsinventory-agent.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- hosts: ocsinventoryagent
become: true
tasks:
- name: ocsinventory-agent | incluye role
include_role:
name: ocsinventory-agent
apply:
tags: [ ocsinventory-agent ]
when: ocs_server is defined and ocs_server|length
tags: [ always ]
# https://fossies.org/linux/Ocsinventory-Unix-Agent/postinst.pl#l_345
# instalador no es configurable con las opciones en el crontab
# 28 11 * * * root /usr/local/bin/ocsinventory-agent --lazy > /dev/null 2>&1
- name: ocsinventory-agent | asegura que no informa software
cron:
name: "OCS Inventory Agent"
cron_file: "/etc/cron.d/ocsinventory-agent"
minute: "{{ 59 |random(seed=inventory_hostname) }}"
hour: "8"
job: "/usr/local/bin/ocsinventory-agent --nosoftware --lazy > /dev/null 2>&1"
user: "root"
when: ocs_server is defined and ocs_server|length
tags: [ ocsinventory-agent ]
# Para desinstalar deshacer lo que hizo:
# https://fossies.org/linux/Ocsinventory-Unix-Agent/postinst.pl
# En roles/ocsinventory-agent/defaults/main.yml estan los directorios defaults a eliminar
# Los paquetes APT que fueron dependencias: FIXME los dejo instalados
- name: ocsinventory-agent | elimina el agente
file:
path: '{{ item }}'
state: absent
loop:
- '/etc/cron.d/ocsinventory-agent'
- '/usr/local/bin/ocsinventory-agent'
# "{{ ocs_configdir }}"
- '/etc/ocsinventory'
# "{{ ocs_logfile }}"
- '/var/log/ocsinventory-agent.log'
# "{{ ocs_basedir }}"
- '/var/lib/ocsinventory-agent'
when: not ( ocs_server is defined and ocs_server|length )
tags: [ ocsinventory-agent ]