gantsign.ctop
Ansible角色: ctop
该角色用于下载和安装 ctop,它是一个用于容器指标的类 top 界面。通过终端可以快速查看 Docker 容器的 CPU、内存和网络 I/O。
要求
Ansible >= 2.9
Linux 发行版
Debian 家族
Debian
- Stretch (9)
- Buster (10)
- Bullseye (11)
Ubuntu
- Bionic (18.04)
- Focal (20.04)
RedHat 家族
Rocky Linux
- 8
Fedora
- 35
SUSE 家族
openSUSE
- 15.3
注:其他版本可能也能工作,但未经过测试。
Docker(已安装)
角色变量
以下变量将改变该角色的行为(默认值如下):
# ctop 版本号
ctop_version: '0.7.7'
# ctop 可重新分发文件的 SHA256 和
ctop_redis_sha256sum: 'b78374734ebe3d14b6edee3d5512c911c250d7fa7f3f964cb00acd3bc5a02a09'
# 存储下载 ctops 文件的目录
ctop_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}"
示例剧本
- hosts: servers
roles:
- role: gantsign.ctop
Zsh 的 Tab 完成
使用 Ansible
我们推荐使用 gantsign.antigen 角色为 ctop 启用 Tab 补全(这需要为每个用户配置)。
- hosts: servers
roles:
- role: gantsign.ctop
- role: gantsign.antigen
users:
- username: example
antigen_bundles:
- name: ctop
url: gantsign/zsh-plugins
location: ctop
使用 Antigen
如果你更喜欢直接使用 Antigen,可以在 Antigen 配置中添加以下内容:
antigen bundle gantsign/zsh-plugins ctop
GantSign 的更多角色
你可以在 Ansible Galaxy 上找到 GantSign 的更多角色。
开发与测试
该项目使用 Molecule 来帮助开发和测试;该角色使用 Testinfra 和 pytest 进行单元测试。
要进行开发或测试,你需要安装以下内容:
由于以上内容可能很难安装,本项目包含 Molecule Wrapper。Molecule Wrapper 是一个安装 Molecule 及其依赖项(不包括 Linux)的 shell 脚本,然后执行 Molecule,并传递你提供的命令。
要使用 Molecule Wrapper 测试该角色,请从项目根目录运行以下命令:
./moleculew test
注意:某些依赖项需要 sudo
权限进行安装。
许可证
MIT
作者信息
John Freeman
GantSign Ltd. 公司编号: 06109112 (在英格兰注册)
安装
ansible-galaxy install gantsign.ctop
许可证
mit
下载
16.6k
拥有者