Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined icinga_objects crashes playbook #332

Open
C0rn3j opened this issue Oct 16, 2024 · 0 comments
Open

Undefined icinga_objects crashes playbook #332

C0rn3j opened this issue Oct 16, 2024 · 0 comments

Comments

@C0rn3j
Copy link

C0rn3j commented Oct 16, 2024

Worked around/fixed by changing

  when: vars['icinga2_objects'][icinga2_config_host] is not defined

to

  when: vars['icinga2_objects'] is defined and vars['icinga2_objects'][icinga2_config_host] is not defined
TASK [icinga.icinga.icinga2 : collect all config objects in play vars] *****************************************************************************************************************************************************************************************************************************************************
fatal: [agent]: FAILED! => 
    msg: |-
        The task includes an option with an undefined variable. The error was: 'icinga2_objects' is undefined. 'icinga2_objects' is undefined

        The error appears to be in '/root/.ansible/collections/ansible_collections/icinga/icinga/roles/icinga2/tasks/objects.yml': line 8, column 3, but may
        be elsewhere in the file depending on the exact syntax problem.

        The offending line appears to be:


        - name: collect all config objects in play vars
          ^ here

Playbook:

- name: Install icinga agent 
  hosts: "agent"
  roles:
    - add_repo
    - icinga.icinga.icinga2
  vars:
    repository: icinga  # add_repo
    icinga2_confd: false
    icinga2_purge_features: yes
    icinga2_delegate_host: 'master.example.com'
    icinga2_features:
      - name: api
        ca_host: '123.123.123.123'
        ca_host_port: '5665'
        endpoints:
          - name: NodeName
        zones:
          - name: ZoneName
            endpoints:
              - NodeName
      - name: notification
        state: absent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant