Apparently ios_command module accepts commands (in plural) instead of command.
Regards, El mar., 9 jun. 2020 a las 9:30, Redhat (<[email protected]>) escribió: > 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. > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/e30a106c-0400-45de-ae71-7c57a661d45ao%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/e30a106c-0400-45de-ae71-7c57a661d45ao%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFtje5NnswF2FSkK1nZwc-T9Skhy4L7k2s6omdiBGC67L78NjA%40mail.gmail.com.
