Installs the OCS Inventory NG Agent.
After the role is run, a ocsinventory-agent will be available on the server. You can use ocsinventory-agent run an manual inventory.
None.
Available variables are listed below, along with default values (see defaults/main.yml):
ocs_server: http://ocsinventory-ng/ocsinventoryThe full URL of the OCS Inventory NG server where the agent should report. This usually ends in /ocsinventory.
ocs_basedir: /var/lib/ocsinventory-agentThe working directory where the agent stores temporary or state files.
ocs_configdir: /etc/ocsinventoryThe configuration directory for the agent. Configuration files and certificates will be placed here.
ocs_logfile: /var/log/ocsinventory-agent.logThe log file path where the agent will write logs.
ocs_ssl: falseWhether to use SSL Verification when communicating with the OCS server. Set to true to enable SSL.
Requires ocs_ca_file to be set!
ocs_ca_file: ""Path to a CA certificate file used for server verification.
ocs_ca: "{{ ocs_configdir }}/cacert.pem"Default location where the CA certificate will be copied to on the target system. Only used if ocs_ca_file is set.
ocs_tag: ""Optional tag to assign to the machine in OCS Inventory. Can be used for grouping or classification.
ocs_nosoftware: 0Set to 1 to disable software inventory. By default, all installed software is reported.
ocs_no_ssl_verify: falseSet to true to disable SSL certificate verification. Not recommended for production unless using a trusted internal CA and skipping verification intentionally.
ocs_prolog_freq: 4Defines how often the agent should contact the server, in hours.
Setting this value to 0 will disable the cron Job.
The minute when this job will be executes is randomized to lower the strain on the network.
ocs_now: trueSet to true executes an inventory task immediately after installation.
ocs_apt_release: stableThe APT release channel to use for the OCS Inventory repository (e.g., stable, oldstable).
ocs_apt_repository: "deb http://deb.ocsinventory-ng.org/{{ ansible_distribution | lower }} {{ ocs_apt_release }} main"The full APT repository URL used to install the OCS Inventory agent.
ocs_apt_gpg_key: https://deb.ocsinventory-ng.org/pubkey.gpgURL to the GPG key used to verify the APT repository.
None.
- hosts: server
vars_files:
- vars/main.yml
roles:
- role: niklaszerozero.ocsinventory_agentInside vars/main.yml:
ocs_server: http://ocsinventory-ng/ocsinventory
ocs_ssl: true
ocs_ca_file: "files/cacert.pem"
ocs_prolog_freq: 6MIT
This role was created in 2025 by Niklas Vlach.