Icinga / ansible-collection-icinga

Collection to setup and manage components of the Icinga software stack
Apache License 2.0
43 stars 35 forks source link

Issue with rendering variable value `")"` #300

Closed lucagubler closed 2 months ago

lucagubler commented 2 months ago

I have an issue when I want to render the value ")" in my Icinga2 configuration. The value is incorrectly rendered as ""), which is obviously not valid in the Icinga2 DSL.

When I try to use double quote it usingsingle quotes like this '")"', it renders as "")"

Do you have any suggestions on how this can be fixed or a workaround that I can use?

Here's my full object definition. The issue is in vars.delimiter:


  - name: Check Uptime
    type: Service
    file: zones.d/main/services/services.conf
    apply: true
    imports:
      - generic-service
    check_command: check_snmp
    assign:
      - host.vars.nb.platform == NetApp
    vars:
      OID: .1.3.6.1.2.1.1.3.0
      delimiter: ")"
      label: "Uptime is"
mkayontour commented 2 months ago

Hi,

we have something to ignore any rules and just put the value in quotes.

attr: -:"unparsed quoted string"

https://github.com/Icinga/ansible-collection-icinga/blob/main/doc/role-icinga2/objects.md#basic-syntax

lucagubler commented 2 months ago

Awesome, thank worked! Thank you very much for your help :)