xanmanning.sshuttle
Ansible 角色:sshuttle
用于在 Python3 虚拟环境中安装 sshuttle
的 Ansible 角色。
需求
此角色已在 Ansible 2.7.0 及以上版本上测试,适用于以下 Linux 发行版:
- Amazon Linux 2
- CentOS 8
- CentOS 7
- Debian 10
- Fedora 29
- Fedora 30
- Fedora 31
- Ubuntu 18.04 LTS
免责声明
如果您遇到任何问题,请创建一个 GitHub 问题,我在业余时间维护这个角色,所以无法保证快速解决。
角色变量
变量 | 描述 | 默认值 |
---|---|---|
sshuttle_version |
使用特定版本的 sshuttle,例如 1.0.0 。如需最新版本,请指定 false 。 |
false |
sshuttle_install_dir |
安装 sshuttle 虚拟环境的目录。 | $HOME/.virtualenvs |
sshuttle_venv_name |
sshuttle 虚拟环境的名称。 | sshuttle |
sshuttle_venv_suffix |
为虚拟环境添加自定义后缀。 | sshuttle_version |
sshuttle_venv_site_packages |
允许虚拟环境继承全局 site-packages 中的包。 | false |
sshuttle_install_venv_helper |
安装一个虚拟环境助手,以便从“bin”目录启动虚拟环境可执行文件。 | true |
sshuttle_bin_dir |
安装虚拟环境助手的“bin”目录。 | $HOME/bin |
sshuttle_install_os_dependencies |
允许角色安装操作系统依赖项。 | false |
sshuttle_python3_path |
指定要在虚拟环境中使用的特定 Python 版本的路径。 | NULL |
依赖
没有其他角色的依赖。
示例剧本
为单用户安装的示例剧本:
- hosts: sshuttle_hosts
roles:
- { role: xanmanning.sshuttle, sshuttle_version: 1.0.0 }
为全局安装最新 sshuttle 版本的示例剧本:
---
- hosts: sshuttle_hosts
become: true
vars:
sshuttle_install_os_dependencies: true
sshuttle_install_dir: /opt/sshuttle/bin
sshuttle_bin_dir: /usr/bin
sshuttle_venv_name: current
roles:
- role: xanmanning.sshuttle
激活 sshuttle 虚拟环境
您需要激活 Python3 虚拟环境才能访问 sshuttle
。可以按以下步骤进行:
source {{ sshuttle_install_dir }}/{{ sshuttle_venv_name }}/bin/activate
在上述全局安装剧本中,命令如下:
source /opt/sshuttle/bin/current/bin/activate
许可证
作者信息
关于项目
Ansible Role to install [sshuttle](https://sshuttle.readthedocs.io/en/stable/manpage.html)
安装
ansible-galaxy install xanmanning.sshuttle
许可证
bsd-3-clause
下载
146
拥有者
Deep in the lab...