ansible - cisco IOS and “reload” command

前端 未结 5 576
梦如初夏
梦如初夏 2021-01-27 02:37

I would like to send command \"reload in \" to Cisco IOS, but that specific command needs to be confirmed like below:

#reload in 30
Reload scheduled in 30 minut         


        
5条回答
  •  不知归路
    2021-01-27 03:04

    Below worked for me with ansible-playbook 2.9.0 and Python 3.7. Please note that, on line with - command, make sure to use double quote " instead of single one '. And don't forget to put \n at the end of command.

        - name: Reloading switch using ios_command.
          ios_command:
            commands: 
              - command: "reload\n"
                prompt: 'Proceed with reload? [confirm]'
                answer: "\r"
    

提交回复
热议问题