talas-group/04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_template_payloads
senke 66471934af Initial commit: Talas Group project management & documentation
Knowledge base of ~80+ markdown files across 14 domains (00-13),
Logseq graph, hardware design files (KiCAD), infrastructure configs,
and talas-wiki static site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 20:10:41 +02:00
..
handlers Initial commit: Talas Group project management & documentation 2026-04-04 20:10:41 +02:00
tasks Initial commit: Talas Group project management & documentation 2026-04-04 20:10:41 +02:00
readme.md Initial commit: Talas Group project management & documentation 2026-04-04 20:10:41 +02:00

zabbix_template_payloads role

This role allows you to store user parameters and scripts and monitor systemd units.

Be careful: if you call this role directly, it will only install the user parameters, scripts, and the systemd unit without linking directly to Zabbix. It is better to refer to the zabbix_template_assignment role.

Variable reference

Optional variables

Variable Description Type of variable Default value Other value
zabbix_template_payloads_list list of templates dict none see bellow
zabbix_template_payloads_script_list list of scripts dict none see bellow
zabbix_template_payloads_systemd_list list of monitoring systemd unit list none see bellow

Example

In most cases (if the file is not a template) you can call the role via the meta of another role:

dependencies:
  - role: zabbix_template_payloads
    zabbix_template_payloads_list:
      - zabbix_name: OpenZFS
        user_parameter: openzfs
    zabbix_template_payloads_script_list:
      - zabbix_name: warp
        file: warp.sh
    zabbix_template_payloads_systemd_list:
      - soketie.service

In some cases, for example when defining a variable dynamically in a role, you'll need to add this step to the end of your role to call that role. Here's an example:

- name: "[zabbix_agent] manage userparameter"
  block:
  - name: "set fact zabbix_template_payloads_list"
    set_fact:
      zabbix_template_payloads_list:
        - name: OpenZFS
          user_parameter: openzfs
      zabbix_template_payloads_script_list:
        - zabbix_name: warp
          file: warp.sh
      zabbix_template_payloads_systemd_list:
        - soketie.service

  - name: "import role zabbix_template_payloads"
    import_role:
      name: zabbix_template_payloads

  - name: "unset facts"
    set_fact:
      zabbix_template_payloads_list: []
      zabbix_template_payloads_script_list: []
      zabbix_template_payloads_systemd_list: []
  tags:
    - zfs
    - zabbix
    - zabbix_template_payloads

Why create a role for this?

  • Only one step to copy and paste for multiple functionnality
  • No code duplication (task, handlers)
  • Separation between a role and Zabbix functionalities
  • The file containing the user parameters stays within the role
  • Support for agent 1 or agent 2