Git Product home page Git Product logo

Comments (5)

iscsrwm avatar iscsrwm commented on September 23, 2024 1

Yes, it's working.

from ansible-collection-checkmk.general.

robin-checkmk avatar robin-checkmk commented on September 23, 2024

Hi @iscsrwm and thanks for the report.
I cannot reproduce the issue and your proposed solution is equivalent to the current implementation.
Can you provide a minimal reproduction example, so I can understand how the error comes about for you?

from ansible-collection-checkmk.general.

iscsrwm avatar iscsrwm commented on September 23, 2024

I just ran on a newly installed Ubuntu 20.04 instance:

root@ansible-test-inst:/home/ubuntu/repos/ansible-collection-tribe29.checkmk# ansible --version
ansible [core 2.12.7]
config file = /home/ubuntu/repos/ansible-collection-tribe29.checkmk/ansible.cfg
configured module search path = ['/home/ubuntu/repos/ansible-collection-tribe29.checkmk/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
jinja version = 2.10.1
libyaml = True

Playbook:


  • hosts: all
    vars_files:

    • vars/checkmk_agent.yml

    roles:

    • agent

Vars:

checkmk_agent_version: "2.1.0p8"
checkmk_agent_edition: cee
checkmk_agent_protocol: https
checkmk_agent_site: "my-site"
checkmk_agent_server: "my-server.example.com"
checkmk_agent_update: 'true'
checkmk_agent_tls: 'true'
checkmk_agent_host_name: "{{ inventory_hostname_short }}"
checkmk_agent_add_host: 'true'
checkmk_agent_discover: 'true'
checkmk_agent_folder: "/my-folder"
automation_user: "automation"
automation_secret: "SECRET"

Output:

TASK [agent : Create host on server.] **********************************************************************************************************
fatal: [ph-5qhfc42 -> localhost]: FAILED! => {"changed": true, "failed_when_result": "The conditional check 'checkmk_agent_create_result.failed is true and "The host is already part of the specified target folder" not in checkmk_agent_create_result.msg' failed. The error was: template error while templating string: no test named 'true'. String: {% if checkmk_agent_create_result.failed is true and "The host is already part of the specified target folder" not in checkmk_agent_create_result.msg %} True {% else %} False {% endif %}", "msg": "Host created."}

But if I take the "is true" part out of the test, which I agree should be semantically equivalent it works.

from ansible-collection-checkmk.general.

iscsrwm avatar iscsrwm commented on September 23, 2024

It also runs fine when I kick it off via Rundeck in a container. So maybe this is an issue with Ansible 2.12.7 on Ubuntu 20.04. Anyhow I'll close this for now.

from ansible-collection-checkmk.general.

robin-checkmk avatar robin-checkmk commented on September 23, 2024

Thanks for the diagnosis @iscsrwm!
We had other issues with particular Ansible versions in the past, but our tests should have picked this one up.
I am quite restricted on time these days, if I can make some time, I will investigate a little more and see, if I can reproduce the issue.
But if I got you right, it works for you now?

from ansible-collection-checkmk.general.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.