semaphoreui / semaphore

Modern UI for Ansible, Terraform, OpenTofu, Bash, Pulumi.
https://semaphoreui.com
MIT License
10.14k stars 1.03k forks source link

ansible-galaxy collection Unsupported parameters for () module: Supported parameters include: #1359

Open zamantech opened 1 year ago

zamantech commented 1 year ago

the error

when run the command directly there is no issue but with semaphore shown as extended_query not define :

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (community.routeros.api) module: extended_query Supported parameters include: add, cmd, hostname, password, path, port, query, remove, ssl, update, username"}

docs

source: https://docs.ansible.com/ansible/latest/collections/community/routeros/api_module.html

playbook

- name: Extended query example - ".id,address,network" where address is not 192.168.255.10/24 or is 10.20.36.20/24
  community.routeros.api:
    hostname: "{{ hostname }}"
    password: "{{ password }}"
    username: "{{ username }}"
    path: "ip address"
    extended_query:
      attributes:
        - network
        - address
        - .id
      where:
        - attribute: "network"
          is: "=="
          value: "192.168.255.0"
        - or:
            - attribute: "address"
              is: "!="
              value: "192.168.255.10/24"
            - attribute: "address"
              is: "eq"
              value: "10.20.36.20/24"
        - attribute: "network"
          is: "in"
          value:
             - "10.20.36.0"
             - "192.168.255.0"
  register: extended_queryout

info

semaphore version
v2.8.75
Linux
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
ansible --version
ansible 2.10.8
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
ansible-galaxy list
# /root/.ansible/roles
- ansible-posix-1.5.4.tar.gz, (unknown version)
- ansible-netcommon-5.1.2.tar.gz, (unknown version)
- community-general-7.1.0.tar.gz, (unknown version)
[WARNING]: - the configured path /usr/share/ansible/roles does not exist.
[WARNING]: - the configured path /etc/ansible/roles does not exist.
ansible-galaxy collection list

# /usr/lib/python3/dist-packages/ansible_collections
Collection                Version
------------------------- -------
amazon.aws                1.4.0  
ansible.netcommon         1.5.0  
ansible.posix             1.1.1  
ansible.windows           1.4.0  
arista.eos                1.3.0  
awx.awx                   14.1.0 
azure.azcollection        1.4.0  
check_point.mgmt          1.0.6  
chocolatey.chocolatey     1.0.2  
cisco.aci                 1.1.1  
cisco.asa                 1.0.4  
cisco.intersight          1.0.10 
cisco.ios                 1.3.0  
cisco.iosxr               1.2.1  
cisco.meraki              2.2.0  
cisco.mso                 1.1.0  
cisco.nso                 1.0.3  
cisco.nxos                1.4.0  
cisco.ucs                 1.6.0  
cloudscale_ch.cloud       1.3.1  
community.aws             1.3.0  
community.azure           1.0.0  
community.crypto          1.4.0  
community.digitalocean    1.0.0  
community.docker          1.2.2  
community.fortios         1.0.0  
community.general         1.3.6  
community.google          1.0.0  
community.grafana         1.1.0  
community.hashi_vault     1.1.0  
community.hrobot          1.1.0  
community.kubernetes      1.1.1  
community.kubevirt        1.0.0  
community.libvirt         1.0.0  
community.mongodb         1.2.0  
community.mysql           1.2.0  
community.network         1.3.2  
community.okd             1.0.0  
community.postgresql      1.1.1  
community.proxysql        1.0.0  
community.rabbitmq        1.0.1  
community.routeros        1.1.0  
community.skydive         1.0.0  
community.vmware          1.7.0  
community.windows         1.3.0  
community.zabbix          1.2.0  
containers.podman         1.4.1  
cyberark.conjur           1.1.0  
cyberark.pas              1.0.5  
dellemc.os10              1.0.2  
dellemc.os6               1.0.6  
dellemc.os9               1.0.3  
f5networks.f5_modules     1.7.1  
fortinet.fortimanager     1.0.5  
fortinet.fortios          1.1.8  
frr.frr                   1.0.3  
gluster.gluster           1.0.1  
google.cloud              1.0.2  
hetzner.hcloud            1.2.1  
ibm.qradar                1.0.3  
infinidat.infinibox       1.2.4  
junipernetworks.junos     1.3.0  
mellanox.onyx             1.0.0  
netapp.aws                20.9.0 
netapp.elementsw          20.11.0
netapp.ontap              20.12.0
netapp_eseries.santricity 1.1.0  
netbox.netbox             1.2.1  
ngine_io.cloudstack       1.2.0  
ngine_io.exoscale         1.0.0  
ngine_io.vultr            1.1.0  
openstack.cloud           1.2.1  
openvswitch.openvswitch   1.1.0  
ovirt.ovirt               1.3.0  
purestorage.flasharray    1.6.2  
purestorage.flashblade    1.4.0  
servicenow.servicenow     1.0.4  
splunk.es                 1.0.2  
theforeman.foreman        1.5.1  
vyos.vyos                 1.1.1  
wti.remote                1.0.1  

# /root/.ansible/collections/ansible_collections
Collection         Version
------------------ -------
ansible.netcommon  5.1.2  
ansible.posix      1.5.4  
ansible.utils      2.10.3 
community.general  7.1.0  
community.routeros 2.8.3  
ansibleguy commented 1 year ago

Greetings!

First of all - thank you for supplying the information!

The error message you are supplying is produced by the Ansible Module you are calling. Semaphore has no impact on how an Ansible Module behaves. Semaphore 'only' starts ansible-playbook and that in turn executes the Module.

As it is not clear what command you ran directly - please make sure this specific Ansible Playbook works when ran manually via shell. (in the same environment/context)

If it also does not work when ran manually - please take the issue to community.routeros

Also: As you are running a manual installation of Semaphore - make sure to read the new documentation regarding it: Manual Installation

zamantech commented 1 year ago

For sure i try run directly,and was there is no issue so i asked here inside the same system that running semaphore

ansible-playbook -i mik.hosts.ini  ./extended_query-playbook.yml    --ask-vault-password   --skip-tags test,debuging --diff 
Vault password: 

PLAY [RouterOS test with API] **************************************************

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

TASK [Extended query example - ".id,address,network" where address is not 192.168.255.10/24 or is 10.20.36.20/24] ***
ok: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
ansibleguy commented 1 year ago

@zamantech Your initial post shows the version 1.1.0 for the collection in use! community.routeros 1.1.0 That version is from JAN 4 2021!

The extended_query was added last year (https://github.com/ansible-collections/community.routeros/commit/d57de117f5d71ee7dbfdd59926ddc41cab02594f) and merged MAY 25 2022

Please update your collections. That may fix you issue (no Semaphore issue)

zamantech commented 1 year ago

Thank you for your enlightenment,

ansibleguy commented 1 year ago

@zamantech As I mentioned - Semaphore is not handling this logic. It is 'just' executing 'ansible-playbook' which handles this logic however it is intended/designed by Ansible. Please close this issue-ticket if your problem was resolved. Thanks.