ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
827 stars 1.52k forks source link

can't install logstash plugin #8650

Open arno4000 opened 3 months ago

arno4000 commented 3 months ago

Summary

When trying to install the logstash-output-loki plugin, I get the following error message: FAILED! => {"changed": false, "msg": "Using bundled JDK: /usr/share/logstash/jdk\nValidating logstash-output-loki\n"} Is there a way to get more detailed output (-vvv didn't help)?

Issue Type

Bug Report

Component Name

logstash_plugin

Ansible Version

$ ansible --version
ansible [core 2.17.1]
  config file = None
  configured module search path = ['/home/arno/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /home/arno/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.4 (main, Jun  7 2024, 06:33:07) [GCC 14.1.1 20240522] (/usr/bin/python)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /usr/lib/python3.12/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 9.1.0  

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None
EDITOR(env: EDITOR) = nvim
PAGER(env: PAGER) = less

OS / Environment

Endeavour OS on the client and Debian 11.10 (Bullseye) on the server

Steps to Reproduce

- name: Install logstash-output-loki plugin
  community.general.logstash_plugin:
    name: logstash-output-loki
    state: present
    proxy_host: http://proxy.example.com
    proxy_port: 8080
  tags: install_loki_plugin

Expected Results

Logstash plugins can be installed

Actual Results

BECOME password: 

PLAY [setting up logbroker] *****************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************

TASK [logstash : Install logstash-output-loki plugin] ***************************************************************************************************************************************************************************************
fatal: [server.example.com]: FAILED! => {"changed": false, "msg": "Using bundled JDK: /usr/share/logstash/jdk\nValidating logstash-output-loki\n"}

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
server.example.com     : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0 

Code of Conduct

ansibullbot commented 3 months ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 months ago

cc @nerzhul click here for bot help

arno4000 commented 3 months ago

I have fixed the issue by setting the proxy via environment variables. The problem is, that the java proxy arguments are apparently no longer respected by logstash. https://github.com/ansible-collections/community.general/blob/main/plugins/modules/logstash_plugin.py#L112

I would suggest to either remove the proxy settings and edit the docs that the environment method should be used, or change the code of the plugin that it sets the environment.

- name: Install logstash-output-loki plugin
  community.general.logstash_plugin:
    name: logstash-output-loki
    state: present
  tags: install_loki_plugin
  environment:
    http_proxy: "http://proxy.example.com:8080"
    https_proxy: "http://proxy.example.com:8080"