junos_shutdown - Shut down or reboot a device running Junos OS.

Author:Jeremy Schulman, Juniper Networks

Synopsis

New in version 1.0.0.

Shut down (power off) or reboot a device running Junos OS. This includes all Routing Engines in a Virtual Chassis or a dual Routing Engine system. This is equivalent to executing either the Junos OS request system power-off or request system reboot operational command.

Options

parameter required default choices comments
at no None
    Specify a time for the reboot (yyyymmddhhmm). Can be used only with reboot=yes.
    host yes
      Set to {{ inventory_hostname }}
      in_min no
        Specify a delay, in minutes, before the shutdown or reboot. If both "at" and "in_min" are specified, "in_min" will be ignored.
        mode no None
          mode of console connection (telnet/serial). If mode is not provided SSH connection is used.
          passwd no assumes ssh-key active
            Login password
            port no 830
              port number to use when connecting to the device
              reboot no
              • yes
              • no
              If set to yes, then the device is rebooted rather than powered off.
              shutdown yes None
                Safety mechanism. You MUST set this to 'shutdown'.
                user no $USER
                  Login username

                  Note

                  Requires junos-eznc >= 1.2.2

                  Examples


                  - junos_shutdown:
                      host={{ inventory_hostname }}
                      shutdown="shutdown"
                      reboot=yes
                  
                  # over console server connection using PyEZ >= 2.0
                  - junos_shutdown:
                      host={{ inventory_hostname }}
                      shutdown="shutdown"
                      reboot=yes
                      mode='telnet'
                      port=7016