splunk / splunk-platform-automator

Ansible framework providing a fast and simple way to spin up complex Splunk environments.
Apache License 2.0
117 stars 46 forks source link

Unsupported parameters for (ansible.legacy.command) module: warn #33

Closed guilhemmarchand closed 1 year ago

guilhemmarchand commented 1 year ago

Describe the bug Latest Ansible version lead to some failures in the playbook with "Unsupported parameters for (ansible.legacy.command) module: warn"

To Reproduce Steps to reproduce the behavior:

The issue is located in the following playbooks due to a deprecated parameter:

./ansible/roles/search_head/tasks/search_peers.yml:    warn: false
./ansible/roles/monitoring_console/tasks/dserver.yml:    warn: false

This causes a failure of the deploy.yml:

TASK [search_head : get list of current distributedSearch peers (single indexers)] ***************************************************************************************************************************
fatal: [sh1]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (ansible.legacy.command) module: warn. Supported parameters include: _raw_params, _uses_shell, argv, chdir, creates, executable, removes, stdin, stdin_add_newline, strip_empty_ends."}

Remove the statement "args warn:false" argument fixes the issue.


- name: get list of current distributedSearch peers (single indexers)
  tags:
    - splunk
    - splunk_baseconfig
    - search_head
    - search_peer
  # Same command is in monitoring_console/tasks/dserver.yml
  shell: sed -n '/^\[distributedSearch\]$/,+1p' {{ splunk_home }}/etc/system/local/distsearch.conf | grep servers | awk -F= '{print $2}' | sed -e 's%https\://%%g' -e 's/\:[0-9]*//g' | tr -d " "
  become: yes
  become_user: "{{ splunk_user }}"
  check_mode: no
  changed_when: false
  register: current_dservers
  args:
    warn: false
splunkenizer commented 1 year ago

Thanks, for the submit. Noticed the issue a couple of days ago. Working on a fix already :-)