telekom-mms / ansible-collection-icinga-director

An Ansible collection that contains modules to change objects in Icinga 2 using the director API.
GNU General Public License v3.0
81 stars 30 forks source link

Add Icinga notification template imports #267

Closed gianmarco-mameli closed 3 days ago

gianmarco-mameli commented 6 days ago

Closes #266, Icinga notification template imports bug Let me know if it's ok, I already tried on my Icinga install

schurzi commented 5 days ago

could you pelase run hacking/update_examples_and_tests.sh to update tests? :)

gianmarco-mameli commented 5 days ago

Yes, of course. The run give me errors with YQ Error: unknown shorthand flag: 'a' in -a=append. I'm on MacOS Arm64, yq installed via Brew version 4.44.5, maybe it's too recent?

schurzi commented 5 days ago

Well, the process seems a bit broken, please give me a few days to fix it and clean some stuff up. Then we will need to rebase your branch on that.

BTW: The linter has picked up some problems with our changes that need to be adressed.

schurzi commented 5 days ago

I'm on MacOS Arm64, yq installed via Brew version 4.44.5, maybe it's too recent?

Not only is it too recent, our script needs a very exakt version of 3.4.1, everything else will not work 🎊

schurzi commented 4 days ago

@gianmarco-mameli that changes from #269 are merged now, can you please rebase and fix the linting errors. If you want to try you can also try to update the tests. For this you need to use yq in version 3.4.1, nothing else will work at the moment.

gianmarco-mameli commented 4 days ago

I installed the yq version 3.4.1 on a debian container, because via Brew on mac it's only available the latest version. I launched the script but I think something is not right: I received an error and 5 files modified, but all empty (only the yaml --- on top)

Screenshot 2024-11-19 at 17 35 44 Screenshot 2024-11-19 at 17 35 53

schurzi commented 4 days ago

nice! The errors you get are actually expected, because you have some minor problems with the code. ;) see: https://github.com/telekom-mms/ansible-collection-icinga-director/actions/runs/11880503521/job/33129443662#step:3:987

gianmarco-mameli commented 4 days ago

My bad sorry! Now seems to be ok, thanks for the support

schurzi commented 4 days ago

My bad sorry!

No worries! In the end this is what tests are for. ;)

Now we have a problem with our tests. you added the import for footemplatein the task that adds footemplate this is not deployable :D

The easy solution might be to leave the added imports out of the example. This way it will only be shown in docs, which should be enoug.

gianmarco-mameli commented 4 days ago

yep, I see the errors. I'm going to fix it now

gianmarco-mameli commented 4 days ago

yeah, checks passed

schurzi commented 3 days ago

Thank you! It was a nice experience working with you on that.