Initiate operational actions on the Junos system
Initiate an operational action (shutdown, reboot, halt or zeroize) on a Junos system. The particular action to execute is defined by the mandatory action option.
The following software packages must be installed on hosts that execute this module:
junos-eznc >= 2.5.2
Python >= 3.5
The following options may be specified for this module:
The action performed by the module.
The following actions are supported:
shutdown - Power off the Junos devices. The values
halt - Stop the Junos OS running on the RE, but do not power off the system. Once the system is halted, it will reboot if a keystroke is entered on the console. This is the equivalent of the
reboot - Reboot the system. This is the equivalent of the
zeroize - Restore the system (configuration, log files, etc.) to a factory default state. This is the equivalent of the
If the system has multiple Routing Engines and this option is
This option applies to all action values.
The all_re option is mutually exclusive with the other_re option.
The time at which to shutdown, halt, or reboot the system.
The value may be specified in one of the following ways:
now - The action takes effect immediately.
+minutes — The action takes effect in
yymmddhhmm — The action takes effect at
hh:mm — The action takes effect at
The at option can not be used when the action option has a value of
Specify a delay, in minutes, before the shutdown, halt, or reboot.
The in_min option can not be used when the action option has a value of
Overwrite media when performing the zeroize operation. This option is only valid when the action option has a value of
If the system has dual Routing Engines and this option is
The other_re option can not be used when the action option has a value of
The other_re option is mutually exclusive with the all_re option.
Whether or not this is a vmhost reboot.
--- - name: 'Explicit host argument' hosts: junos connection: local gather_facts: no collections: - juniper.device tasks: - name: Reboot all REs of the device system: action: "reboot" - name: Power off the other RE of the device. system: action: "shutdown" othe_re: True - name: Reboot this RE at 8pm today. system: action: "reboot" all_re: False at: "20:00" - name: Halt the system on 25 January 2018 at 4pm. system: action: "halt" at: "1801251600" - name: Reboot the system in 30 minutes. system: action: "reboot" in_min: 30 - name: Reboot the system in 30 minutes. system: action: "reboot" at: "+30m" - name: Zeroize the local RE only. system: action: "zeroize" all_re: False - name: Zeroize all REs and overwrite medea. system: action: "zeroize" media: True
The value of the action option.
The value of the all_re option.
Indicates if the device's state has changed. If the action is performed (or if it would have been performed when in check mode) then the value will be
Indicates if the task failed.
The value of the media option.
A human-readable message indicating the result.
The value of the other_re option.
This module only INITIATES the action. It does NOT wait for the action to complete.
Some Junos devices are effected by a Junos defect which causes this Ansible module to hang indefinitely when connected to the Junos device via the console. This problem is not seen when connecting to the Junos device using the normal NETCONF over SSH transport connection. Therefore, it is recommended to use this module only with a NETCONF over SSH transport connection. However, this module does still permit connecting to Junos devices via the console port and this functionality may still be used for Junos devices running Junos versions less than 15.1.
The NETCONF system service must be enabled on the target Junos device.