ansible - cisco IOS and “reload” command

前端 未结 5 513
梦如初夏
梦如初夏 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 02:54

    You can use:

    - name: reload device
      ios_command:
        commands:
          - "reload in 1\ny"
        provider: "{{ cli }}"
    

    This will reload the device in 1 minute and the reload prompt gets accepted. It works well for ansible because the default prompt of ios will come back (reload gets triggered in 1 minute).

    Regards, Simon

提交回复
热议问题