HuaweiSwitch / CloudEngine-Ansible

Ansible modules to automate HUAWEI CloudEngine switches
GNU General Public License v3.0
144 stars 51 forks source link

ce_facts failed : start tag expected, '<' not found, line 1, column 1 (line 1). #57

Closed lonelyword closed 5 years ago

lonelyword commented 5 years ago

OS version: Redhat 7.4 Ansible Version: 2.7.5 Python Version: 2.7.5 ansible huawei -m ce_facts -a "gather_subset=config"

1.1.1.1 | FAILED! => { "changed": false, "msg": "Command: display version, start tag expected, '<' not found, line 1, column 1 (line 1)."

cfg_file in ce_startup have the same problem. Other modules, ce_vlan, works fine.

lonelyword commented 5 years ago

change python version to 3.7.2, still the same error

yuandongx commented 5 years ago

Due to the ansible version change, code rectification, in lib\ansible\plugins\action\action\ce.py, 'CLI_SUPPORTED_MODULES ' did not add ce_fact, resulting in this problem. Code follow-up updates will fix this problem.

lonelyword commented 5 years ago

ok

kpostrup commented 5 years ago

I'm getting the same error when trying from a playbook, using the example from: https://docs.ansible.com/ansible/devel/modules/ce_facts_module.html#ce-facts-module

# Note: examples below use the following provider dict to handle
#       transport and authentication to the node.

- name: CloudEngine facts test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Gather_subset is all"
    ce_facts:
      gather_subset: all
      provider: "{{ cli }}"

  - name: "Collect only the config facts"
    ce_facts:
      gather_subset: config
      provider: "{{ cli }}"

  - name: "Do not collect hardware facts"
    ce_facts:
      gather_subset: "!hardware"
      provider: "{{ cli }}"

Error:

TASK [Gather_subset is all] **********************************************************************************************************************************
fatal: [leaf01]: FAILED! => {"changed": false, "msg": "Command: dir, start tag expected, '<' not found, line 1, column 1 (line 1)."}
kpostrup commented 5 years ago

Please re-open issue.

yuandongx commented 5 years ago

Please re-open issue. The bugs will be fixed after codes are merged into gihub.

kpostrup commented 5 years ago

Please re-open issue. The bugs will be fixed after codes are merged into gihub.

Is this for me? I don't have access to re-open the issue.

michadom commented 5 years ago

This issue is still happening. Regards,

yuandongx commented 5 years ago

Ansible-2.8.1 will be released and you can have a try. We have commited codes(#54750) to fix the bug. Thank you.

yuandongx commented 5 years ago

@michadom Will you please have a try with ansible-2.8.1?

michadom commented 5 years ago

@michadom Will you please have a try with ansible-2.8.1?

Now it Works! I installed ansible 2.8.1 and works as expected. Thanks for fixing it and for all development that you all are doing to this project.

Regards,