ptavares.ansible_role_oh_my_zsh

构建状态 Ansible 角色 Ansible 角色质量 Ansible 角色下载 许可证

ansible-role-oh-my-zsh

用于安装和配置 zsh 和 oh-my-zsh 的 Ansible 角色

要求

仅与 ansible 2.5 及以上版本测试

角色变量

可用变量如下所示,包含默认值(请查看 defaults/main.yml):

自定义主题

# 默认加载的主题(包含在 oh-my-zsh 中)
# 所有包含的主题在此处 : https://github.com/robbyrussell/oh-my-zsh/tree/master/themes
oh_my_zsh_default_theme: robbyrussell

# 对于不在 $HOME/.oh-my-zsh/themes 或 $HOME/.oh-my-zsh/custom/themes/ 中的自定义主题:
# 1. 填写 oh_my_zsh_custom_theme_info
#    - 此主题将检出到目录 $HOME/.oh-my-zsh/custom/custom-themes/
# oh_my_zsh_custom_theme_info: { url: "oh_my_zsh_custom_theme_git_url", dir_dest_name: "oh_my_zsh_custom_git_dir_name" }
# 例:
oh_my_zsh_custom_theme_info: { url: "https://github.com/ptavares/zsh-themes.git", dir_dest_name: zsh-themes }

# 2. 选择要加载的自定义 zsh 主题名称
#    - 将从 $HOME/.oh-my-zsh/custom/custom-themes/oh_my_zsh_custom_theme_git_dir_name/oh_my_zsh_custom_theme_name 创建软链接到 $HOME/.oh-my-zsh/custom/themes/
# oh_my_zsh_custom_theme: oh_my_zsh_custom_theme_name
# 例:
oh_my_zsh_custom_theme: ptavares

# 3. 添加额外的主题配置
# oh_my_zsh_custom_theme_config:
#  - MY_CUSTOM_THEME_VAR1=value
#  - MY_CUSTOM_THEME_VAR2=value2

自定义插件

# 默认加载的插件(包含在 oh-my-zsh 安装中)
# 所有包含的插件在此处 : https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins
oh_my_zsh_default_plugins:
  - git

# 对于不在 $HOME/.oh-my-zsh/plugins 或 $HOME/.oh-my-zsh/custom/plugins/ 中的自定义插件:
# 1. 填写 oh_my_zsh_custom_plugins_info
#    - 插件将检出到目录 $HOME/.oh-my-zsh/custom/custom-plugins/
#    - 将从 $HOME/.oh-my-zsh/custom/custom-plugins/oh_my_zsh_custom_plugin_dir_name 创建软链接到 $HOME/.oh-my-zsh/custom/plugins/
# oh_my_zsh_custom_plugins_info: { url: "oh_my_zsh_custom_plugin_git_url", dir_dest_name: "oh_my_zsh_custom_plugin_git_dir_name" }
# 例:
oh_my_zsh_custom_plugins_info:
  - { url: "https://github.com/junegunn/fzf.git", dir_dest_name : fzf }
  - { url: "https://github.com/Treri/fzf-zsh.git", dir_dest_name: fzf-zsh }
  - { url: "https://github.com/zsh-users/zsh-autosuggestions.git", dir_dest_name: zsh-autosuggestions }
  - { url: "https://github.com/zdharma/fast-syntax-highlighting.git", dir_dest_name: fast-syntax-highlighting }
  - { url: "https://github.com/chrissicool/zsh-bash.git", dir_dest_name: zsh-bash }

# 2. 列出所有要在启动 zsh 时加载的自定义插件
# oh_my_zsh_custom_plugins:
#    - oh_my_zsh_custom_plugin_1
#    - oh_my_zsh_custom_plugin_2
# 例:
oh_my_zsh_custom_plugins:
  - fzf-zsh
  - zsh-autosuggestions
  - fast-syntax-highlighting
  - zsh-bash

# 3. 额外的插件命令
# 某些插件需要额外的命令才能成功运行
# oh_my_zsh_custom_plugins_command :
#    - "oh_my_zsh_custom_plugins_command_1"
#    - "oh_my_zsh_custom_plugins_command_2"
# 例:
oh_my_zsh_custom_plugins_command :
  - "$HOME/.oh-my-zsh/custom/plugins/fzf/install --all"
  - "fast-theme safari"

用您自己的条目自定义 .zhrc

# 在此处添加您需要放入 zhrc 文件的所有条目,例如别名
# oh_my_zsh_custom_zsh_entries:
#    - "oh_my_zsh_custom_zsh_entries_1"
#    - "oh_my_zsh_custom_zsh_entries_2"
# 例:
oh_my_zsh_custom_zsh_entries:
  - "# 仅列出目录的别名"
  - "alias lsd='ls -l | grep \"^d\"'"

依赖

无依赖

示例剧本

- hosts: all
  roles:
    - role: ptavares.ansible_role_oh_my_zsh

vars/main.yml 中:

  • defaults/main.yml 的内容复制到您的剧本的 vars 文件中。
  • 根据需要自定义它(填写角色变量)

许可证

MIT

关于项目

Ansible role for installating and configuring zsh and oh-my-zsh

安装
ansible-galaxy install ptavares.ansible_role_oh_my_zsh
许可证
mit
下载
176
拥有者