jaredzieche.sshuttle

Role: sshuttle

This role installs sshuttle as a system service.

Ansible Role

Requirements

  • You need to have SSH access to a remote host where the tunnel will be set up.
  • The host should be a Linux system.

Role Variables

  • sshuttle_user: The user account the service will run under.
  • sshuttle_group: The group that the service will run under.
  • sshuttle_package: The name of the sshuttle package to install.
  • sshuttle_hosts: A list of remote servers and their corresponding subnets, which will be converted to JSON for the service configuration. For example:
    sshuttle_hosts:
      "{{ remote_hostname }}":
        - 10.0.0.0/24
        - 172.16.0.0/24
        - 192.168.0.0/24
    
  • sshuttle_options: Command options from the man page to describe sshuttle connections in shuttle.py.
  • sshuttle_args: Additional command options from the man page for shuttle.py.
  • ssh_cmd_args: SSH command options from the man page for shuttle.py.
  • remote_auth: true/false value that indicates if the role should try to authorize the user with the remote tunnel host (default is false).
  • remote_ip: The IP address of the remote host that sshuttle will connect to.
  • remote_user: Username to authenticate with the remote host.
  • remote_hostname: The name used for the remote host entry in your .ssh/config.

Example Playbooks

  1. Run without creating an SSH config file:

    - name: Converge
      hosts: all
      vars:
        remote_hostname: "remote-host"
        remote_auth: false
      tasks:
        - name: "Include ansible-role-sshuttle"
          include_role:
            name: "ansible-role-sshuttle"
    
  2. Run and set up remote authentication (create .ssh/config and add an authorized key to the remote host). Ansible will add hosts to the group remote:

    - name: Converge
      hosts: all
      vars:
        remote_ip: "10.0.0.1"
        remote_user: "user that can authenticate with remote system"
        remote_password: "{{ remote_auth_password }}"
        remote_hostname: "remote-host"
        remote_auth: true
      tasks:
        - name: "Include ansible-role-sshuttle"
          include_role:
            name: "ansible-role-sshuttle"
    
    - name: Remote_auth
      hosts: remote
      vars:
        remote_ip: "10.0.0.1"
        remote_user: "user that can authenticate with remote system"
        remote_password: "{{ remote_auth_password }}"
        remote_hostname: "remote-host"
        remote_auth: true
      tasks:
        - name: "Include ansible-role-sshuttle"
          include_role:
            name: "ansible-role-sshuttle"
            tasks_from: remote_auth
    

License

MIT License

Author Information

Jared Zieche

Informazioni sul progetto

Install sshuttle as a service

Installa
ansible-galaxy install jaredzieche.sshuttle
Licenza
mit
Download
383
Proprietario