Erreur parameter in ios_command module

32 views
Skip to first unread message

Redhat

unread,
Jun 9, 2020, 4:29:58 AM6/9/20
to Ansible Project
Hello;

I wanted to update switch cisco by ansible. To copy the ios image from SFTP server, the playbook deployment will display the following error:

FAILED! => {"changed": false, "msg": "Unsupported parameters for (ios_command) module: register Supported parameters include: auth_pass, authorize, commands, host, interval, match, password, port, provider, retries, ssh_keyfile, timeout, username, wait_for"}


ansible --version:
ansible 2.9.9
  config file = /etc/ansible/cisco/test/ansible.cfg
  configured module search path = [u'/etc/ansible/ntc-ansible/ntc-ansible/library']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)



group_vars:

new_ios : c2960s.152-2.E8.bin
name : xxxx
pswd : xxxx


Playbook:

- name: Upgrade IOS
  hosts: host
  connection: local
  gather_facts: no

  vars:
    provider:
      authorize: yes
      host: "{{ host }}"
      username: "{{ username }}"
      password: "{{ password }}"
      auth_pass: "{{ password_enable }}"
  

  tasks:

    - name: Copy IOS to flash
      delegate_to: localhost
      ios_command:
        command: "scp -p 22 sftp://XX.XX.XX.XX/{{ new_ios }}  bootflash:"
        username: "{{ name }}"
        password: "{{ pswd }}"
        prompt: '[{{ new_ios }}]'
        answer: "\r"
      register: config

    - debug: msg="{{ config.stdout }}"

      vars:
        ansible_command_timeout: 18000
        delay_factor: 12





Thank you in advance for your proposals.

Regards. 

Jorge Rúa

unread,
Jun 9, 2020, 4:33:01 AM6/9/20
to ansible...@googlegroups.com
Apparently ios_command module accepts commands (in plural) instead of command.

Regards,

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e30a106c-0400-45de-ae71-7c57a661d45ao%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages