Icinga / ansible-collection-icinga

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

icinga.repos not supporting setting a proxy for RedHat systems #167

Closed MarcusCaepio closed 9 months ago

MarcusCaepio commented 1 year ago

Hi all, For RedHat systems: If you have to use a proxy for the icinga repository, it is currently not possible to set one, although the ansible module yum_repository allows to set a proxy: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/yum_repository_module.html#parameter-proxy

Cheers, Marcus

martialblog commented 1 year ago

Hi, thanks for the hint. We'll have a look, shoud be fairly simple to add this

mkayontour commented 1 year ago

I need to check how to implement the feature. If it's not easy maintainable i suggest to use module defaults. I guess you will use the proxy for other repo tasks too.

- hosts: localhost
  module_defaults:
    ansible.builtin.yum_repository:
      proxy: my.proxy:port
      proxy_username: proxy
      proxy_password: proxypass
MarcusCaepio commented 1 year ago

The workaround with the defaults is working. Maybe the role should use a template instead of the ansible.builtin.yum_repository? I also got a problem with installing the monitoring plugins: The role is enabling repos based on an if-clause. But I have special repos, which have to be set / enabled. So I got an No package nagios-plugins-users available. See https://github.com/Icinga/ansible-collection-icinga/blob/main/roles/monitoring_plugins/tasks/install_on_RedHat.yml#L30

mkayontour commented 1 year ago

I guess the yum_repository is fine to use, otherwise I need to manage everything which the module will do automatically. And in addition you can easily define your own defaults which is convenient.

To your second question, please open a another issue. And with a bit more detail, which plugins/variables you are using and whats happening upon that.