mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 08:15:54 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
17
roles/fusioninventory_agent/defaults/main.yml
Normal file
17
roles/fusioninventory_agent/defaults/main.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
|
||||
fusinv_uri: []
|
||||
fusinv_user: user
|
||||
fusinv_pass: secret
|
||||
fusinv_disabled_tasks:
|
||||
- ESX
|
||||
- WakeOnLan
|
||||
- NetDiscovery
|
||||
- Deploy
|
||||
- NetInventory
|
||||
|
||||
# Not included in debian repo
|
||||
# so we need to manually down and install it
|
||||
fusinv_deb_version: 2.4.2-1
|
||||
|
||||
...
|
3
roles/fusioninventory_agent/handlers/main.yml
Normal file
3
roles/fusioninventory_agent/handlers/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: restart fusioninventory-agent
|
||||
service: name=fusioninventory-agent state=restarted enabled=yes
|
45
roles/fusioninventory_agent/tasks/install_Debian.yml
Normal file
45
roles/fusioninventory_agent/tasks/install_Debian.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
|
||||
- when: >
|
||||
(ansible_distribution == 'Debian' and ansible_distribution_major_version is version('11', '<')) or
|
||||
(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('20', '<'))
|
||||
block:
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
name:
|
||||
- dmidecode
|
||||
- hwdata
|
||||
- ucf
|
||||
- hdparm
|
||||
- perl
|
||||
- libuniversal-require-perl
|
||||
- libwww-perl
|
||||
- libparse-edid-perl
|
||||
- libproc-daemon-perl
|
||||
- libproc-pid-file-perl
|
||||
- libfile-which-perl
|
||||
- libxml-treepp-perl
|
||||
- libyaml-perl
|
||||
- libnet-cups-perl
|
||||
- libnet-ip-perl
|
||||
- libdigest-sha-perl
|
||||
- libsocket-getaddrinfo-perl
|
||||
- libtext-template-perl
|
||||
|
||||
- name: Install fusioninventory
|
||||
apt: deb=http://ftp.fr.debian.org/debian/pool/main/f/fusioninventory-agent/fusioninventory-agent_{{ fusinv_deb_version }}_all.deb
|
||||
environment:
|
||||
- http_proxy: "{{ system_proxy | default('') }}"
|
||||
|
||||
tags: inventory
|
||||
|
||||
- when: >
|
||||
(ansible_distribution == 'Debian' and ansible_distribution_major_version is version('11', '>=')) or
|
||||
(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('20', '>='))
|
||||
block:
|
||||
- name: Install FusionInventory Agent
|
||||
apt:
|
||||
name:
|
||||
- fusioninventory-agent
|
||||
tags: inventory
|
||||
|
6
roles/fusioninventory_agent/tasks/install_RedHat.yml
Normal file
6
roles/fusioninventory_agent/tasks/install_RedHat.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
- name: Install FusionInventory Agent
|
||||
yum: name=fusioninventory-agent
|
||||
tags: inventory
|
||||
|
24
roles/fusioninventory_agent/tasks/main.yml
Normal file
24
roles/fusioninventory_agent/tasks/main.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
|
||||
- include: install_{{ ansible_os_family }}.yml
|
||||
|
||||
- name: Deploy FusionInventory Agent config
|
||||
template: src=agent.cfg.j2 dest=/etc/fusioninventory/agent.cfg mode=640
|
||||
notify: restart fusioninventory-agent
|
||||
tags: inventory
|
||||
|
||||
- name: Check if the first inventory has been done
|
||||
stat: path=/var/lib/fusioninventory-agent/FusionInventory-Agent.dump
|
||||
register: first_inventory
|
||||
tags: inventory
|
||||
|
||||
- name: First Fusion Inventory report
|
||||
command: /usr/bin/fusioninventory-agent
|
||||
when: not first_inventory.stat.exists
|
||||
tags: inventory
|
||||
|
||||
- name: Start FusionInventory Agent
|
||||
service: name=fusioninventory-agent state=started enabled=yes
|
||||
tags: inventory
|
||||
|
||||
...
|
7
roles/fusioninventory_agent/templates/agent.cfg.j2
Normal file
7
roles/fusioninventory_agent/templates/agent.cfg.j2
Normal file
@@ -0,0 +1,7 @@
|
||||
server={{ fusinv_uri | join(',') | quote }}
|
||||
user={{ fusinv_user | quote }}
|
||||
password={{ fusinv_pass | quote }}
|
||||
no-p2p
|
||||
no-httpd
|
||||
httpd-ip="127.0.0.1"
|
||||
no-task={{ fusinv_disabled_tasks | join(',') | quote }}
|
Reference in New Issue
Block a user