Tried this as well it did not worked

- name: clean the switch
cisco.ios.ios_command:
commands:
- command: request platform software package clean switch all
prompt: Do you want to proceed? [y/n]
answer: yes
newline: false

On Tue, Jun 8, 2021 at 2:11 AM Suneel Hegde <[email protected]> wrote:

> I am trying to execute the command from ansible to clean the cisco switch
> after the upgrade,
> everything worked and switch got upgrade. but this command is not working
> to clean the switch
>
> *test-switch#request platform software package clean switch all*
> This operation may take several minutes...
> Running command on switch 1
> Cleaning up unnecessary package files
> No path specified, will use booted path flash:packages.conf
> Cleaning flash:
>   Scanning boot directory for packages ... done.
>   Preparing packages list to delete ...
>     cat3k_caa-guestshell.16.12.03a.SPA.pkg
>       File is in use, will not delete.
>     cat3k_caa-rpbase.16.12.03a.SPA.pkg
>       File is in use, will not delete.
>     cat3k_caa-rpcore.16.12.03a.SPA.pkg
>       File is in use, will not delete.
>     cat3k_caa-srdriver.16.12.03a.SPA.pkg
>       File is in use, will not delete.
>     cat3k_caa-webui.16.12.03a.SPA.pkg
>       File is in use, will not delete.
>     packages.conf
>       File is in use, will not delete.
>   done.
>
> The following files will be deleted:
> [switch 1]:
> /flash/cat3k_caa-universalk9.16.12.03a.SPA.bin
> Do you want to proceed? [y/n]
>
> when I tried this using ansible its not working could any of you please
> help this is the way I am trying
>
> - name: clean the switch
>   ansible.netcommon.cli_command:
>     command: request platform software package clean switch all
>     prompt: Do you want to proceed? [y/n]
>     answer: y
>     newline: false
>
> also tried like this
>
>     - name: clean the switch
>       cli_command:
>         command: reload
>         prompt:
>           - Do you want to proceed? [y/n]
>         answer
>           - y
>
> Tried this also
>
>       cli_command:
>         command:
>         - request platform software package clean switch all
>         prompt:
>         - Do you want to proceed? [y/n]
>         answer:
>         - y
>         newline: false
>       var:
>         ansible_command_timeout: 300
>
> non of the above worked :-(
>
> Thank you
> Suneel
>

-- 
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/CANuO0k65UT89HhhLu_doRWVfyxf7fpSQTKhDsAGmykAUW2D5vA%40mail.gmail.com.

Reply via email to