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

Unsupported parameters for (community.network.ce_command) module: transport #400

Open
Telur44 opened this issue Mar 28, 2022 · 4 comments
Open
Labels
feature This issue/PR relates to a feature request needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly

Comments

@Telur44
Copy link

Telur44 commented Mar 28, 2022

Hello,

I want to use the collection with Huawei S6730 switches.

I went here: https://docs.ansible.com/ansible/latest/collections/community/network/ce_command_module.html

And I copied exactly the example provided. However, every time I launch my playbook, I get the following error:

FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "Unsupported parameters for (community.network.ce_command) module: transport Supported parameters include: commands, interval, match, provider, retries, wait_for"}

I understand that the problem comes from "transport" but I really don't see how to solve it.

Could you please help me?

@sirkubax
Copy link

sirkubax commented Apr 28, 2022

seems the same as
#321

I've the same issuem looks like some step is adding this args, probably on the playbook level
I did not yet debug it that deeply, bit if you set
export ANSIBLE_KEEP_REMOTE_FILES=1 (just for testing)
and run

ansible-playbook playbooks/ce_command.yml -vvv

- hosts: localhost
  connection: local
  gather_facts: no
  vars:
    #ansible_connection: ansible.netcommon.netconf
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port |default(22) }}"
      username: "{{ username |default('huawei') }}"
      password: "{{ password |default('huawei') }}"
      transport: 'cli'
      
  tasks:

  - debug:
      msg: "{{ cli }}"
         
  - name: "Run display version on remote devices"
    ce_command:
      commands: display version
      provider: "{{ cli }}"
      #transport: cli

you can get (path would be different)

python /home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/AnsiballZ_ce_command.py explode
Module expanded into:
/home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/debug_dir

cat /home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/debug_dir/args 
{"ANSIBLE_MODULE_ARGS": {"commands": "display version", "provider": {"host": "localhost", "port": 22, "username": "huawei", "password": "huawei", "transport": "cli", "ssh_keyfile": null, "use_ssl": null, "validate_certs": null, "ti
meout": null}, "transport": "cli", "_ansible_check_mode": false, "_ansible_no_log": false, "_ansible_debug": false, "_ansible_diff": false, "_ansible_verbosity": 3, "_ansible_version": "2.11.2", "_ansible_module_name": "ce_command"
, "_ansible_syslog_facility": "LOG_USER", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p", "vfat"], "_ansible_string_conversion_action": "warn", "_ansible_socket": "/home/kuba/.ansible/pc/c92e282e64", "_ansib
le_shell_executable": "/bin/sh", "_ansible_keep_remote_files": true, "_ansible_tmpdir": "/home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/", "_ansible_remote_tmp": "~/.ansible/tmp"}}


cat /home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/debug_dir/args |jq
{
  "ANSIBLE_MODULE_ARGS": {
    "commands": "display version",
    "provider": {
      "host": "localhost",
      "port": 22,
      "username": "huawei",
      "password": "huawei",
      "transport": "cli",
      "ssh_keyfile": null,
      "use_ssl": null,
      "validate_certs": null,
      "timeout": null
    },
    "transport": "cli",
    "_ansible_check_mode": false,
    "_ansible_no_log": false,
    "_ansible_debug": false,
    "_ansible_diff": false,
    "_ansible_verbosity": 3,
    "_ansible_version": "2.11.2",
    "_ansible_module_name": "ce_command",
    "_ansible_syslog_facility": "LOG_USER",
    "_ansible_selinux_special_fs": [
      "fuse",
      "nfs",
      "vboxsf",
      "ramfs",
      "9p",
      "vfat"
    ],
    "_ansible_string_conversion_action": "warn",
    "_ansible_socket": "/home/kuba/.ansible/pc/c92e282e64",
    "_ansible_shell_executable": "/bin/sh",
    "_ansible_keep_remote_files": true,
    "_ansible_tmpdir": "/home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/",
    "_ansible_remote_tmp": "~/.ansible/tmp"
  }
}

so the extra transport is present in the module input arguments (extra, the one we configure is in the provider` scope, it might be that the whole plugin community.network., not only community.network.ce_command, has some issue

you can remove this from args, and run the module again with execute, it would work 'better' :)
not a fix, just a prove that it should work, when the extra transport is not injected externally

vi /home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/debug_dir/args

python /home/kuba/.ansible/tmp/ansible-tmp-1651153489.9478908-149575-68141174905975/AnsiballZ_ce_command.py execute

{"failed": true, "msg": "Command: display version, socket path /home/kuba/.ansible/pc/c92e282e64 does not exist or cannot be found. see troubleshooting socket path issues in the network debug and troubleshooting guide.", "invocatio
n": {"module_args": {"commands": ["display version"], "provider": {"host": "localhost", "port": 22, "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "transport": "cli", "ssh_keyf
ile": null, "use_ssl": null, "validate_certs": null, "timeout": null}, "match": "all", "retries": 10, "interval": 1, "wait_for": null}}}

@ansibullbot
Copy link
Collaborator

@Telur44: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • component name

Please set the description of this issue with an appropriate template from:
https://github.com/ansible/ansible/tree/devel/.github/ISSUE_TEMPLATE

click here for bot help

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly labels Jun 9, 2022
@ansibullbot
Copy link
Collaborator

@Telur44 This issue is waiting for you to provide the requested data in the description. Please edit the description or the issue will be closed.

click here for bot help

@khalil-tabbal
Copy link

Hi @Telur44 did you find a way to interact with Huawei S6730 switches ?

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly
Projects
None yet
Development

No branches or pull requests

4 participants