*Ansible version = 2.7.5*

Hello all,

I am using Ansible to save configurations of all my switches but they are 
CISCO small businesses.

I am curently using a playbook like this :

---
- hosts: SW-Switches
  gather_facts: no
  connection: local

  vars_prompt:
  - name: "mgmt_username"
    prompt: "Username"
    private: no
  - name: "mgmt_password"
    prompt: "Password"


  tasks:
  - name: Provider
    set_fact:
      provider:
        host: "{{ inventory_hostname }}"
        username: "{{ mgmt_username }}"
        password: "{{ mgmt_password }}"


  - name: Show run
    ios_command:
      provider: "{{ provider }}"
      commands:
        - command: show running-configuration
      register: showrun

  - name: save output
    copy:
      content: "{{ showrun.stdout }}"
      dest: "/etc/ansible/show_run_test11.22.conf"
~


*and it returns an error:*

[root@BX-ANSIBLE ansible]# ansible-playbook test11.22.yml
Username: ########
Password: ########

PLAY [SW-Switches] 
*********************************************************************************

TASK [SYS | Define provider] 
***********************************************************************
ok: [BX-COM-SW6]

TASK [IOS | Show run] 
******************************************************************************
fatal: [BX-COM-SW6]: 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"}
        to retry, use: --limit @/etc/ansible/test11.22.retry

PLAY RECAP 
*****************************************************************************************
BX-COM-SW6                 : ok=1    changed=0    unreachable=0    failed=1


I run the command "ios_command : show clock" instead of "show 
running-configuration" and it works fine. 

I guess there is something i have to do to let it access to next level of 
command on switches.

Am i missing something to get it saved on my ansible Server?

NB: i know small business switches can't get multiple command line but i 
only give it 1 command at a time.

Thanks for you help


-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d3b29d2a-2aa7-4c90-a4ae-544b6076a4bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to