Closed mariuspana closed 1 year ago
Hi Marius!
There are a few too many dashes in your checkmk_server_sites
variable. Only prefix the name
with one and remove the other three.
I get the point with the documentation however. Do have something specific in mind that would have helped you?
Oh boy do I feel silly now :-{
The examples are actually ok (no extra dashes), for some reason I ended up putting those on my own. Not sure if more examples/documentation would have helped here other than for copy/pasting things.
I am afraid to say I dropped the ball here and it is more a paying attention and some basic ansible experience, than anything you could have done.
I owe you a beer :)
Thanks for your help.
Thanks for the feedback and I am glad I could help!
Looking forward to meeting you and getting that beer one day. ;)
Cheers!
Describe the bug Using the "server" role does not create a site. Rather we get an error.
Component Name server role
Ansible Version
Checkmk Version
Collection Version
Environment MacOS Monterey 12.6 Darwin imac.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64
Python 3.10.7
To Reproduce Define a playbook to trigger site creation, for example:
Also create a config file with something like:
Run those with ansible-playbook:
Expected behavior The server would also get a running checkmk site as defined in the configuration file/role.
Actual behavior TASK [tribe29.checkmk.server : Include Site Management Playbook.] ** task path: /Users/mpana/.ansible/collections/ansible_collections/tribe29/checkmk/roles/server/tasks/main.yml:85 included: /Users/mpana/.ansible/collections/ansible_collections/tribe29/checkmk/roles/server/tasks/sites.yml for teacher
TASK [tribe29.checkmk.server : Create Sites.] **
task path: /Users/mpana/.ansible/collections/ansible_collections/tribe29/checkmk/roles/server/tasks/sites.yml:2 fatal: [teacher]: FAILED! => {"msg": "The conditional check 'item.state != \"absent\"' failed. The error was: error while evaluating conditional (item.state != \"absent\"): 'dict object' has no attribute 'state'\n\nThe error appears to be in '/Users/mpana/.ansible/collections/ansible_collections/tribe29/checkmk/roles/server/tasks/sites.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: \"Create Sites.\"\n ^ here\n"}
Am I doing something wrong? I missed examples in the docs/elsewhere here for creating sites using plays however the role clearly defines tasks for creating sites.
Thanks! Marius