ntc_reboot

Synopsis

Added in version 1.9.2

Reboot a network device, optionally on a timer. Supported platforms include Cisco Nexus switches with NX-API, Cisco IOS switches or routers, Arista switches with eAPI.

Options

parameter required default choices comments
confirm no
    Safeguard boolean. Set to true if you're sure you want to reboot.
    host yes
      Hostame or IP address of switch.
      ntc_conf_file no
        The path to a local NTC configuration file. If omitted, and ntc_host is specified, the system will look for a file given by the path in the environment variable PYNTC_CONF, and then in the users home directory for a file called .ntc.conf.
        ntc_host no
          The name of a host as specified in an NTC configuration file.
          password yes
            Password used to login to the target device
            platform yes
            • cisco_nxos_nxapi
            • arista_eos_eapi
            • cisco_ios
            Switch platform
            port no
              TCP/UDP port to connect to target device. If omitted standard port numbers will be used. 80 for HTTP; 443 for HTTPS; 22 for SSH.
              secret no
                Enable secret for devices connecting over SSH.
                timer no
                  Time in minutes after which the device will be rebooted.
                  transport no https
                  • http
                  • https
                  Transport protocol for API-based devices.
                  username yes
                    Username used to login to the target device

                    Important

                    Requires pyntc

                    Examples


                    - ntc_reboot:
                        platform: cisco_nxos_nxapi
                        confirm: true
                        host: "{{ inventory_hostname }}"
                        username: "{{ username }}"
                        password: "{{ password }}"
                        transport: http
                    
                    - ntc_reboot:
                        ntc_host: n9k1
                        ntc_conf_file: .ntc.conf
                        confirm: true
                    
                    - ntc_file_copy:
                        platform: arista_eos_eapi
                        confirm: true
                        host: "{{ inventory_hostname }}"
                        username: "{{ username }}"
                        password: "{{ password }}"
                    
                    - ntc_file_copy:
                        platform: cisco_ios
                        confirm: true
                        timer: 5
                        host: "{{ inventory_hostname }}"
                        username: "{{ username }}"
                        password: "{{ password }}"
                        secret: "{{ secret }}"
                    

                    Return Values

                    Common return values are documented here common_return_values, the following are the fields unique to this module:

                    name despcription returned type sample
                    rebooted Whether the device was instructed to reboot. success boolean True