Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAILED! => {"argument_errors": ["Invalid type dict for option '{'cert_file': #54

Closed
job-so opened this issue Mar 7, 2023 · 2 comments
Closed

Comments

@job-so
Copy link

job-so commented Mar 7, 2023

Dear community,

Migrating from cloudalchemy.node_exporter and a previous ansible version, my playbook fails to validate node_exporter_tls_server_config.

Regards

Olivier

ogrosjeanne@bastion:~/ansible$ ansible --version
ansible [core 2.14.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ogrosjeanne/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/ogrosjeanne/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
ogrosjeanne@bastion:~/ansible$ more prometheus-test.yml 
- hosts: localhost
  connection: local 
  roles:
    - prometheus.prometheus.node_exporter
  vars:
    node_exporter_tls_server_config:
      cert_file: /etc/node_exporter/certificate.cer
      key_file: /etc/node_exporter/privateKey.pem
ogrosjeanne@bastion:~/ansible$ ansible-playbook prometheus-test.yml 

PLAY [localhost] *********************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [prometheus.prometheus.node_exporter : Validating arguments against arg spec 'main' - Prometheus Node Exporter] *****************************************************************************************************
fatal: [localhost]: FAILED! => {"argument_errors": ["Invalid type dict for option '{'cert_file': '/etc/node_exporter/certificate.cer', 'key_file': '/etc/node_exporter/privateKey.pem'}', elements value check is supported only with 'list' type", "Invalid type dict for option '{}', elements value check is supported only with 'list' type", "Invalid type dict for option '{}', elements value check is supported only with 'list' type"], "argument_spec_data": {"node_exporter_basic_auth_users": {"description": "Dictionary of users and password for basic authentication. Passwords are automatically hashed with bcrypt.", "elements": "str", "type": "dict"}, "node_exporter_binary_local_dir": {"description": ["Enables the use of local packages instead of those distributed on github.", "The parameter may be set to a directory where the C(node_exporter) binary is stored on the host where ansible is run.", "This overrides the I(node_exporter_version) parameter"]}, "node_exporter_disabled_collectors": {"description": ["List of disabled collectors.", "By default node_exporter disables collectors listed L(here,https://github.com/prometheus/node_exporter#disabled-by-default)."], "elements": "str", "type": "list"}, "node_exporter_enabled_collectors": {"default": ["systemd", {"textfile": {"directory": "/var/lib/node_exporter"}}], "description": ["List of dicts defining additionally enabled collectors and their configuration.", "It adds collectors to L(those enabled by default,https://github.com/prometheus/node_exporter#enabled-by-default)."], "type": "list"}, "node_exporter_http_server_config": {"description": ["Config for HTTP/2 support.", "Keys and values are the same as in L(node_exporter docs,https://github.com/prometheus/node_exporter/blob/master/https/README.md#sample-config)."], "elements": "str", "type": "dict"}, "node_exporter_textfile_dir": {"default": "/var/lib/node_exporter", "description": ["Directory used by the L(Textfile Collector,https://github.com/prometheus/node_exporter#textfile-collector).", "To get permissions to write metrics in this directory, users must be in C(node-exp) system group.", "B(Note:) More information in TROUBLESHOOTING.md guide."]}, "node_exporter_tls_server_config": {"description": ["Configuration for TLS authentication.", "Keys and values are the same as in L(node_exporter docs,https://github.com/prometheus/node_exporter/blob/master/https/README.md#sample-config)."], "elements": "str", "type": "dict"}, "node_exporter_version": {"default": "1.1.2", "description": "Node exporter package version. Also accepts latest as parameter."}, "node_exporter_web_listen_address": {"default": "0.0.0.0:9100", "description": "Address on which node exporter will listen"}, "node_exporter_web_telemetry_path": {"default": "/metrics", "description": "Path under which to expose metrics"}}, "changed": false, "msg": "Validation of arguments failed:\nInvalid type dict for option '{'cert_file': '/etc/node_exporter/certificate.cer', 'key_file': '/etc/node_exporter/privateKey.pem'}', elements value check is supported only with 'list' type\nInvalid type dict for option '{}', elements value check is supported only with 'list' type\nInvalid type dict for option '{}', elements value check is supported only with 'list' type", "validate_args_context": {"argument_spec_name": "main", "name": "node_exporter", "path": "/home/ogrosjeanne/.ansible/collections/ansible_collections/prometheus/prometheus/roles/node_exporter", "type": "role"}}

PLAY RECAP ***************************************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
@gardar
Copy link
Member

gardar commented Mar 7, 2023

Released a new version of the collection with a fix #50 actually just this minute, please try version 0.1.5

@job-so
Copy link
Author

job-so commented Mar 7, 2023

You patched argument_specs.yml, so i will not propose my PR... ;-)
Thanks
Olivier

@job-so job-so closed this as completed Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants