redbeard28.bashaliases
ANSIBLE-ROLE-BASHALIASES
Ansible角色将Bash别名添加到您想要的bash文件中。
如何使用这个角色?
这个角色需要包含在剧本中。
像这样调用这个Galaxy角色:
ansible-galaxy install -r requirements.yml
在requirements.yml中:
# 来自GitHub,覆盖名称并指定特定标签
- src: redbeard28.bashaliases
更多信息 => Ansible文档
需求
- Ansible 2.9及以上
角色变量
---
activate_shell_aliases_extra: false
aliases_shell: "bash"
shell_rc_file: "~/.{{ aliases_shell }}rc"
shell_aliases_file: "~/.{{ aliases_shell }}_aliases"
shell_aliases:
- {alias: "ll", command: "ls -rthl --color=auto"}
- {alias: "dir", command: "dir --color=auto"}
- {alias: "grep", command: "grep --color=auto"}
shell_aliases_extra:
- \#function inspec { docker run -it --rm -v $(pwd):/share -v $(echo $HOME):/home/ chef/inspec "$@"; }
- export cookiecutterURL=https://github.com/redbeard28/ansible-role-template.git
依赖项
如果远程主机上未安装python3
- src: redbeard28.bootstrap
示例剧本
包含如何使用您的角色的示例(例如,以参数传递变量),这对用户总是很有帮助:
- hosts: all
roles:
- { role: redbeard28.bashaliases, tags: mytags }
Molecule测试框架
您可以使用molecule测试这个角色。
image=debian tag="buster" molecule converge
image=debian tag="buster" molecule verify
作者信息
来自Redbeard-Consulting的Jeremie CUADRADO¹