weareinteractive.unison
Ansible weareinteractive.unison 角色
weareinteractive.unison
是一个 Ansible 角色,它:
- 安装 unison
- 配置 unison
注意:
由于 Ansible Galaxy 现在支持 组织,此角色已从
franklinkim.unison
移动到weareinteractive.unison
!
安装
使用 ansible-galaxy
:
$ ansible-galaxy install weareinteractive.unison
使用 requirements.yml
:
- src: weareinteractive.unison
使用 git
:
$ git clone https://github.com/weareinteractive/ansible-unison.git weareinteractive.unison
依赖
- Ansible >= 2.0
变量
以下是此角色的所有默认变量列表,这些变量也可以在 defaults/main.yml
中找到。
---
# unison_configs:
# - name: sync1
# # 两个要同步的根目录。
# src: /home/unison
# dest: ssh://dev.null/home/unison
# # 如果你希望 Unison 在没有任何用户输入的情况下运行,可以尝试“批处理”模式。
# batch: yes
# # 如果你不想被提示,而是直接接受 Unison 的建议:
# auto: yes
# # 可选,你可以仅同步特定的子目录(在根目录下)。
# paths: []
# # 可选,你可以忽略与正则表达式匹配的特定文件或目录。
# ignore: []
# # 如果你想忽略文件属性的差异:
# perms: 0
#
# 配置列表
unison_configs: []
# unison 用户名 (字符串 | false)
unison_user: unison
# 配置的路径
unison_config_path: "/home/{{ unison_user }}/.unison"
# 包名称 (版本)
unison_package: unison
使用
这是一个示例剧本:
---
- hosts: all
# 安装依赖的预任务,以便在 docker 中运行测试
pre_tasks:
- name: 安装 openssh
action: "{{ ansible_pkg_mgr }} pkg=openssh-client state=present"
roles:
- weareinteractive.unison
vars:
unison_configs:
- name: sync
src: /home/unison
dest: ssh://dev.nul/home/unison
ignore:
- ".*"
- "~*"
测试
$ git clone https://github.com/weareinteractive/ansible-unison.git
$ cd ansible-unison
$ vagrant up
贡献
作为正式风格指南的替代,请注意保持现有的编码风格。为任何新增或更改的功能添加单元测试和示例。
- 叉取(Fork)它
- 创建你的特性分支(
git checkout -b my-new-feature
) - 提交你的更改(
git commit -am '添加一些特性'
) - 推送到分支(
git push origin my-new-feature
) - 创建新的 Pull Request
注意:要更新 README.md
文件,请安装并运行 ansible-role
:
$ gem install ansible-role
$ ansible-role docgen
许可
版权所有 (c) We Are Interactive,依据 MIT 许可证。
安装
ansible-galaxy install weareinteractive.unison
许可证
mit
下载
310