hadrienpatte.ssh_reconnect

SSH Reconnect

The ssh-reconnect role offers two handy tools for managing SSH connections in your roles:

  • Kill own ssh connections: This option will close all SSH connections for the current user.
  • Kill all ssh connections: This option will close all SSH connections for any user.

To use these tools, first, add the role to your playbook or include it as a dependency in your own role. Then, you can simply notify one of the tools using this format:

 - some_task:
   notify:
     - Kill own ssh connections

There is also a module (or action-plugin) that lets you end SSH connections directly without needing a handler.

Parameters

  • user: The name of the user whose SSH connections you want to close.
  • all: Set this to True if you want to close all SSH connections for all users.

By default, if you don't set any parameters, it will close all SSH connections for the user you are logged in as.

Examples

To close your own SSH connections:

- name: Close my own SSH connections
  ssh-reconnect:

To close all SSH connections:

- name: Close all SSH connections
  ssh-reconnect: all=True

To close SSH connections for the user "foo":

- name: Close all SSH connections for user foo
  ssh-reconnect: user=foo
Informazioni sul progetto

Kill all open ssh connections to force ansible to re-connect at next task

Installa
ansible-galaxy install hadrienpatte.ssh_reconnect
Licenza
mit
Download
641
Proprietario
Automation enthusiast